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

"trivial-auto-var-init=pattern" causes crashes when using MinGW

    XMLWordPrintable

Details

    • Windows
    • 6c11f4070 (dev), 0fa33b8c6 (6.8)

    Description

      When "trivial-auto-var-init=pattern" is enabled, using QTest to run a simple attached example will crash (SIGSEGV) when destructor is called. Something seems to be messing with the vtable.

      Steps to reproduce:

      • Build attached sample in DEBUG mode
      • Run the resulting exe

      This simple example application seems to crash only in debug builds, but more complex product such as Qt SafeRenderer seems to crash in release mode also when running unit tests in CI. Using the runtime from user code (such as SafeRenderer example) seems to work ok, so this issue might be relevant only when using the flag with QTest.

      Reproduces with mingw13 that ships with 6.8.0 RC 2 and mingw13 with dev in CI. Linux, MacOS and MSVC on Windows seem to work fine even with this flag.

      This is the stack trace when the crash happens.

      ********* Start testing of TestClass *********
      Config: Using QtTest library 6.8.0, Qt 6.8.0 (x86_64-little_endian-llp64 shared (dynamic) release build; by GCC 13.1.0), windows 10
      PASS   : TestClass::initTestCase()
      A crash occurred in C:\temp\crash_issue_with_internal_add_test\testtt.exe.
      While testing test_case1
      Function time: 0ms Total time: 7ms
      
      Exception address: 0x00007ff640c82bda
      Exception code   : 0xc0000005
      
      Stack:
      #  1: ZN5QTest12CrashHandler19WindowsFaultHandler19windowsFaultHandlerEP19_EXCEPTION_POINTERS() - 0x00007ffe14699fc0
      #  2: UnhandledExceptionFilter() - 0x00007ffe52dcd8e0
      #  3: memset() - 0x00007ffe55694680
      #  4: _C_specific_handler() - 0x00007ffe5567cdc0
      #  5: _chkstk() - 0x00007ffe55692810
      #  6: RtlRaiseException() - 0x00007ffe556420d0
      #  7: KiUserExceptionDispatcher() - 0x00007ffe55691410
      #  8: Unable to obtain symbol
      #  9: Unable to obtain symbol
      # 10: Unable to obtain symbol
      # 11: ZN18QMetaMethodInvoker10invokeImplE11QMetaMethodPvN2Qt14ConnectionTypeExPKPKvPKPKcPKPKN9QtPrivate18QMetaTypeInterfaceE() - 0x00007ffda316bc40
      # 12: ZN11QMetaMethod10invokeImplES_PvN2Qt14ConnectionTypeExPKPKvPKPKcPKPKN9QtPrivate18QMetaTypeInterfaceE() - 0x00007ffda316d990
      # 13: ZN12QTestPrivate14parseBlackListEv() - 0x00007ffe1468c960
      # 14: ZN5QTest5qInitEP7QObjectiPPc() - 0x00007ffe14696190
      # 15: ZN5QTest5qInitEP7QObjectiPPc() - 0x00007ffe14696190
      # 16: ZN5QTest5qInitEP7QObjectiPPc() - 0x00007ffe14696190
      # 17: ZN5QTest4qRunEv() - 0x00007ffe14698540
      # 18: ZN5QTest5qExecEP7QObjectiPPc() - 0x00007ffe14698e50
      # 19: Unable to obtain symbol
      # 20: Unable to obtain symbol
      # 21: Unable to obtain symbol
      # 22: BaseThreadInitThunk() - 0x00007ffe53c47360
      # 23: RtlUserThreadStart() - 0x00007ffe5563cc70
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            peppe Giuseppe D'Angelo
            jussi_witick Jussi Witick
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes