Qt Creator gdb hang on startup
-
I'm getting a hang when I try to run gdb. This is with Creator 4.15.2 installed locally from the qt.io installer. RHEL 7.6 and gdb 8.3.1
I've seen a thread from about 5 years ago suggesting that I disable gdbinit, which does not help. Possibly related is the fact that the executable does set some auto-loads in .debug_gdb, one is no longer used and the other two are disabled because they aren't set up in .gdbinit.
On the gdb side, pstack says that it is waiting in 'poll()'. On the Qt Creator side, in the Debugger Log I see (real names redacted)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="0",original-location=""source.c":237"},{number="1.1",enabled="y",addr="0x0000000002e4103c",func="function",file="/path/source.c",fullname="/path/source.c",line="266",thread-groups=["i1"]},{number="1.2",enabled="y",addr="0x0000000002e4103c",func="function",file="/path/source.c",fullname="/path/source.c",line="266",thread-groups=["i2"]}
NON-CRITICAL TIMEOUT
COMMANDS STILL IN PROGRESS:And it just sits there.
Looking at the Creator source
the above log message is supposed to be printing the commands after the colon. So it looks like in my case there are no commands, just a timeout. Perhaps it would be better if the above output said something like "(none)" if the list of commands is empty.
pstack on the qtcreator process seems to show everything waiting in poll or on mutexes.
If I attach strace to qtcreator then try to start a gdb session then I see lots of write() and poll() syscalls as the exe and shared libs get loaded and the symbol tables are read.
After that there are a load of madvise(). After that I don't see much that I can interpret, just read()/write()/poll() syscalls.
Update: just upgraded to Qt Creator 5.0.0, same problem.
After trying quite a few things. I've found that I can set a breakpoint on main and stop there. The hang occurs a bit later where the following is happening
system("ldd exe | grep libfoo | awk 'some pretty print filter'").
If I uncheck "Debug all child processes" then there is no hang.