Debugging with GDB - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Debugging with GDB (/thread-2069.html) |
Debugging with GDB - xoft - 07-23-2015 I'm trying to find the bug that causes the Google test to fail occasionally in the CI servers. Unfortunately I'm not too familiar with Linux debugging, so I've hit a dead-end. I used a simple bash script to run the test 100 times, and it crashed once during the run, producing a core file. Then I tried loading the core file and printing the backtrace, this is what I got: Code: Core was generated by `./Google-exe'. On Windows it happens quite often that missing symbols cause the stacktrace to be wrong after the first missing entry, so if it is the same on Linux, it could shed more light into the issue. I tried running the 100-repetition script with gdb - start gdb, load the executable, set a breakpoint on the __GI_abort function, then run. Unfortunately it doesn't work because at the time the executable is loaded, the __GI_abort function is not loaded yet, so a breakpoint cannot be set on it. Here's my experimental script (doesn't work): Code: for ((n=0;n<100;n++)) RE: Debugging with GDB - xoft - 07-24-2015 Ah, did it. I added a custom constructor to cAssertFailure and set the breakpoint there; this allowed me to use the 100-repetition script and finally I found the problem: The cNetworkSingleton has a HasTerminated flag which was being set too soon - before all the network links have been closed. The links then tried to remove themselves from a cNetworkSingleton which was already marked as HasTerminated, which triggered an assert / throw. RE: Debugging with GDB - worktycho - 07-24-2015 In terms of the actual debugging problem, it looks like either your on the wrong thread, and it wasn't doing anything, or the stack got hosed above the call to abort, so all you can see are libc internals. RE: Debugging with GDB - xoft - 07-24-2015 Yeah, the stack probably got hosed, but still I'd like to see the libc internals' symbols. |