Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96639

QMainWindow crash during "closeEvent"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.3.0 Alpha
    • 6.1.3
    • Active Qt
    • None
    • Qt Creator 5.0.1 (Sep 14 2021 01:17:14)
      Qt 6.1.3
      Microsoft Windows 10 Home (Version: 21H1 Build: 19043.1237)
    • Windows
    • e9cef8e7fa1c1cf4956cd25ccc5504f2e7790e4e (qt/qtbase/dev) 504245f9d451852a942b7774a55c5094167cb7b0 (qt/qtbase/6.2)

    Description

      Under certain circumstances on a Windows 10 (home) host, a Qt widget application appears to crash when a QMessageBox is invoked within an overridden "closeEvent" method.

       

      The issue may be reproduced as follows:

      • Create a new Qt widget application within Qt Creator, override the "closeEvent" method with code that instantiates a QMessageBox (e.g. QMessageBox::question).
      • Compile application with either MSVC or mingw (64-bit) using debug or release settings. As I use Qt open source, this has only been tested with dynamic binding.
      • Run program (either within Qt Creator or externally).
      • Maximize window and close application by clicking the frame's close button along its rightmost extremity (forcing the cursor into the top-right corner of the screen is possibly the easiest way to reproduce this issue on a standard Windows 10 configuration).
      • The application will subsequently crash whilst attempting to instantiate the QMessageBox (SIGSEGV Segmentation Fault).

       

      NOTE: Whilst this issue sometimes manifests when closing non-maximised windows, it is far more difficult to reproduce consistently.

      After further testing, this issue appears to be DPI related: it's only reproducible when resolution is set to 2560x1600, and scaling is set to 200% or 250%. issue is also reproducible under Ubuntu 20.04 (Cinnamon desktop) at resolution 2560x1600 with double (hidpi) scaling enabled.

      The complete Qt project directory (zipped) has been attached for convenience.

      Attachments

        1. stackTrace.txt
          7 kB
        2. Test.zip
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard Richard Moe Gustavsen
            retrocode Lee Westlake
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes