Unsolved Latest Qt Creator, MinGW 64-bit Build, GDB Crashes When Hitting Breakpoints
-
Hello,
I have a project that I was working with before being furloughed for 3 months. I'm now back and trying to pick things up. In trying to fix various problems encountered due to updating several programs, I've tried to rule out version compatibility problems by completely uninstalling and reinstalling Qt. I'm still seeing a problem. Some breakpoints result in GDB crashing, apparently when trying to retrieve variables, but only some. For example, a breakpoint in a slot method seems to work find. The method calls emit. A breakpoint early in the slot method then crashes immediately.
This project was working with an older toolchain. I could start a version-by-version search to find one that works, but if anyone has suggestions that would help me avoid that, I'd rather not.
Versions I'm currently using:
Qt Creator 4.12.3
MinGW 8.1.0 for 64-bit C++
Qt 5.15.0
GNU gdb 8.1 for MinGW 64-bitLooking at the debugger logs. It looks gdb takes a nose dive when making a second call to theDumper.fetchVariables().
I'm pasting a section of the debugger log.
Any suggestions welcome. Thanks!
193show version 194show debug-file-directory 195set print object on 196set breakpoint pending on 197set print elements 10000 198set unwindonsignal on 199set width 0 200set height 0 Setting up inferior... 201set substitute-path C:/work/build/qt5_workdir/w/s C:/Qt/5.15.0/mingw81_64/../Src 202set substitute-path Q:/qt5_workdir/w/s C:/Qt/5.15.0/mingw81_64/../Src 203set substitute-path c:/Users/qt/work/install C:/Qt/5.15.0/mingw81_64/../Src 204set substitute-path c:/users/qt/work/qt C:/Qt/5.15.0/mingw81_64/../Src 205python sys.path.insert(1, 'C:/Qt/Tools/QtCreator/share/qtcreator/debugger/') 206python sys.path.append('C:/Qt/Tools/mingw810_64/bin/data-directory/python') 207python from gdbbridge import * 208python theDumper.loadDumpers({"token":208}) 209-interpreter-exec console "set target-async off" Setting breakpoints... 210-gdb-set environment PATH=C:\Users\ppotts\Documents\GitHub\SAM4S_Platform\Firmware and EEPROM Loader Tool\.\;C:\Qt\5.15.0\mingw81_64\bin;C:\Qt\Tools\mingw810_64\bin;C:\Qt\5.15.0\mingw81_64\bin;C:\Qt\Tools\mingw810_64\bin;C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\National Instruments\Shared\ULx\;C:\Program Files (x86)\Measurement Computing\DAQ\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Dynamics AX\40\Client\bin;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Graphviz2.38\bin;C:\Program Files (x86)\Atmel\sam-ba_2.16\drv\;C:\adb;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\IVI\Bin;C:\Program Files\IVI Foundation\IVI\bin;C:\Program Files (x86)\Lenovo\Access Connections\;C:\Program Files\Lenovo\Fingerprint Manager Pro\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Pandoc\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Thorlabs\Thorlabs OSA;C:\Program Files\Thorlabs\Thorlabs OSA\bin;C:\Program Files (x86)\Atmel\sam-ba_2.18\drv\;C:\Program Files (x86)\Atmel\sam-ba_2.18;%PY_HOME%;%PY_HOME%\Lib;%PY_HOME%\Scripts;%PY_HOME%\DLLs;%PY_HOME%\Lib\lib-tk;%PY_HOME%\Lib\site-packages;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\ 211-gdb-set environment QTDIR=C:\Qt\5.15.0\mingw81_64 212cd C:/Users/ppotts/Documents/GitHub/SAM4S_Platform/build-firmware_and_eeprom_loader-Desktop_Qt_5_15_0_MinGW_64_bit-Debug 213-file-exec-and-symbols "C:/Users/ppotts/Documents/GitHub/SAM4S_Platform/build-firmware_and_eeprom_loader-Desktop_Qt_5_15_0_MinGW_64_bit-Debug/debug/SAM4S2 Firmware and EEPROM Loader.exe" 214-break-insert -f "\"mainwindow.cpp\":858" 215-break-insert -f "\"threads.cpp\":1403" 216-break-insert -f "\"mainwindow.cpp\":495" 217-exec-run Thread group i1 created. Thread 1 created. [New Thread 4168.0x3250] Library C:\Windows\SYSTEM32\ntdll.dll loaded. Library C:\Windows\system32\kernel32.dll loaded. Library C:\Windows\system32\KernelBase.dll loaded. Library C:\Qt\5.15.0\mingw81_64\bin\Qt5Core.dll loaded. Library C:\Windows\system32\advapi32.dll loaded. Library C:\Windows\system32\msvcrt.dll loaded. Library C:\Windows\SYSTEM32\sechost.dll loaded. Library C:\Windows\system32\rpcrt4.dll loaded. Library C:\Qt\5.15.0\mingw81_64\bin\libgcc_s_seh-1.dll loaded. Library C:\Qt\5.15.0\mingw81_64\bin\libwinpthread-1.dll loaded. Library C:\Windows\system32\mpr.dll loaded. Library C:\Windows\system32\netapi32.dll loaded. Library C:\Windows\system32\netutils.dll loaded. Library C:\Windows\system32\srvcli.dll loaded. Library C:\Windows\system32\wkscli.dll loaded. Library C:\Windows\system32\ole32.dll loaded. Library C:\Windows\system32\gdi32.dll loaded. Library C:\Windows\system32\user32.dll loaded. Library C:\Windows\system32\lpk.dll loaded. Library C:\Windows\system32\usp10.dll loaded. Library C:\Windows\system32\shell32.dll loaded. Library C:\Windows\system32\shlwapi.dll loaded. Library C:\Windows\system32\userenv.dll loaded. Library C:\Windows\system32\profapi.dll loaded. Library C:\Windows\system32\version.dll loaded. Library C:\Windows\system32\winmm.dll loaded. Library C:\Windows\system32\ws2_32.dll loaded. Library C:\Windows\system32\nsi.dll loaded. Library C:\Qt\5.15.0\mingw81_64\bin\libstdc++-6.dll loaded. Library C:\Qt\5.15.0\mingw81_64\bin\Qt5Gui.dll loaded. Library C:\Windows\system32\d3d11.dll loaded. Library C:\Windows\system32\dxgi.dll loaded. Library C:\Windows\system32\dwmapi.dll loaded. Library C:\Qt\5.15.0\mingw81_64\bin\Qt5SerialPort.dll loaded. Library C:\Windows\system32\setupapi.dll loaded. Library C:\Windows\system32\cfgmgr32.dll loaded. Library C:\Windows\system32\oleaut32.dll loaded. Library C:\Windows\system32\devobj.dll loaded. Library C:\Qt\5.15.0\mingw81_64\bin\Qt5Widgets.dll loaded. Library C:\Windows\system32\uxtheme.dll loaded. Library C:\Users\ppotts\Documents\GitHub\SAM4S_Platform\Firmware and EEPROM Loader Tool\SiUSBXp.dll loaded. Library C:\Windows\system32\winusb.dll loaded. Running. Application started. Library C:\Windows\system32\imm32.dll loaded. Library C:\Windows\system32\msctf.dll loaded. Library C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll loaded. Library C:\Qt\5.15.0\mingw81_64\plugins\platforms\qwindows.dll loaded. Library C:\Windows\system32\wtsapi32.dll loaded. Library C:\Windows\system32\cryptbase.dll loaded. Library C:\Windows\system32\powrprof.dll loaded. Library C:\Windows\system32\powrprof.dll unloaded. Library C:\Qt\5.15.0\mingw81_64\plugins\styles\qwindowsvistastyle.dll loaded. Library C:\Windows\system32\DWrite.dll loaded. Thread 2 created. [New Thread 4168.0x28bc] Library C:\Windows\system32\wintrust.dll loaded. Library C:\Windows\system32\crypt32.dll loaded. Library C:\Windows\system32\msasn1.dll loaded. Library C:\Windows\system32\d3d9.dll loaded. Library C:\Windows\system32\d3d8thk.dll loaded. Library C:\Windows\system32\igdumdim64.dll loaded. Library C:\Windows\system32\igdusc64.dll loaded. Library C:\Windows\system32\igdumdim64.dll unloaded. Library C:\Windows\system32\igdusc64.dll unloaded. Thread 3 created. [New Thread 4168.0x1fc8] Library C:\Windows\system32\cryptsp.dll loaded. Thread 4 created. [New Thread 4168.0x748] Library C:\Windows\system32\rsaenh.dll loaded. Library C:\Windows\system32\RpcRtRemote.dll loaded. Thread 5 created. [New Thread 4168.0xba0] Thread 6 created. [New Thread 4168.0x2b44] Thread 7 created. [New Thread 4168.0x3208] Stopped. 218importPlainDumpers off Stopped at breakpoint 3 in thread 1. 219-thread-info 220python theDumper.fetchStack({"limit":20,"nativemixed":0,"token":220}) 221-stack-select-frame 0 222python theDumper.fetchVariables({"autoderef":0,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["return","inspect","watch","local"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"","passexceptions":0,"qobjectnames":1,"resultvarname":"","stringcutoff":"10000","timestamps":0,"token":222,"typeformats":{},"watchers":[]}) <Rebuild Watchmodel 3 @ 19:30:58.418 [49750ms] > --- token barrier --- Run requested... Running requested... 223-exec-continue Running. Stopped. Stopped at breakpoint 2 in thread 2. 224-thread-info 225python theDumper.fetchStack({"limit":20,"nativemixed":0,"token":225}) 226-stack-select-frame 0 227python theDumper.fetchVariables({"autoderef":0,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["return","inspect","watch","local"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"","passexceptions":0,"qobjectnames":1,"resultvarname":"","stringcutoff":"10000","timestamps":0,"token":227,"typeformats":{},"watchers":[]}) Debugger finished.
-
OK, seeing no suggestions, I took a look at a previous working configuration which will successfully work with the same project and same breakpoints, on a different computer:
Qt Creator 4.11
Qt 5.13.0 for MinGW 64-bit
MinGW 7.3.0 for 64-bit
GNU gdb 8.1 for MinGW 7.3.0So, I am using the maintenance tool to install the older Qt and MinGW.
I don't see an option in the maintenance tool to install the older Qt Creator or specify an exact version of GNU gdb. I also don't see an option for exactly Qt 5.13.0, but only 5.13.2. But I will see what happens if I select the closest matches I can.
-
OK, I have taken another tack: rolling back my source code.
This fixes it.
So there is some source or project change that seems to result in a crashing GDB. I will try to narrow that down to a minimal difference.
-
It appears that linking in the redistributable library from Silicon Labs, lSiUSBXp, like so:
win32: LIBS += -L$$PWD/./ -lSiUSBXp
Causes GDB to crash on hitting breakpoints, even before explicitly calling any of the functions in that library. This does not happen using a different Silicon Labs library:
win32: LIBS += -L$$PWD/./ -lSLABHIDtoUART
So, that's fun.
In my view, this shouldn't result in GDB crashing, but mainly I just have to figure out a workaround.
-
Well, for now I have given up on the MinGW & GDB toolchain and since I have Visual Studio 2019 Community installed, I'm using that toolchain with CDB, and debugging is working fine.
Not sure I can submit a bug report since a 3rd-part library is involved, and so I am not sure I can pare it down to a minimum case.
-
Also encountered this very same problem.
It's definitely a GDB bug. It even happens when I compile a simple C++ hello world program from the console and then debug it with gdb. As soon as you hit a breakpoint and ask the debugger "info registers" then it's all over.
Have created a ticket here:
https://sourceware.org/bugzilla/show_bug.cgi?id=26304