cs01 / gdbgui

Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.
https://gdbgui.com
GNU General Public License v3.0
9.93k stars 499 forks source link

underlying gdb process has been killed after running to first breakpoint #218

Open chisaipete opened 6 years ago

chisaipete commented 6 years ago

Describe the bug I load my binary, manually set a break-point several statements into my main function, then click run. The program spawns multiple threads as expected (it's using SDL2) but once it reaches the first break-point, execution stops, the gui is updated, and I see the following in red text in the gdbgui console:

The underlying gdb process has been killed. This tab will no longer function as expected.
Error occurred on server when running gdb command: gdb is not running
Error occurred on server when running gdb command: gdb is not running
Error occurred on server when running gdb command: gdb is not running
Error occurred on server when running gdb command: gdb is not running
...

Screenshots issue_gdbgui

Please complete the following information:

Additional context If it helps, I'm using the neuwin.net Mingw distro. Pretty light as far as mingw on windows gets.

chisaipete commented 6 years ago

I should also mention that I can debug this and other programs just fine using gdb on the command line.

cs01 commented 6 years ago

Thanks for filing. It might be a gdb bug in its machine interface implementation. Unfortunately with the info you provided I don't know what the cause is. Maybe if you re-run with strace and post results here it will help.

chisaipete commented 6 years ago

I'm not sure what you mean. Is "strace" a specific gdb or gdbgui command? I'm running on Windows 10, isn't strace a linux utility?

cs01 commented 6 years ago

Yes strace intercepts and prints all system calls. You're right that it might not be available on windows (I am pretty Linux centric). It might be available as a package in mingw. Or there might be another utility available to debug the issue.

What I'm really looking for is a way to see what is causing the abrupt exit, which is likely due to a segfault. The info you provided is not quite specific enough to be actionable since I can't tell what the root cause is (lots of things can cause a segfault).

msik314 commented 5 years ago

I am running into this issue, too.

The differenences in my information are this: gdbgui version: 0.13.1.2 browser: Firefox python packages: Click==7.0 pipx==0.13.1.1 userpath==1.1.0

I do have strace on Windows, and this is the relevant part of my strace log: --- Process 3928 thread 9116 exited with status 0x0 --- Process 3928 thread 10232 exited with status 0x0 --- Process 3928 thread 6772 created --- Process 948 thread 8276 created --- Process 1532 thread 6536 created --- Process 8376 thread 8552 created --- Process 3928 thread 10040 exited with status 0x0 --- Process 3928 thread 420 created --- Process 3928 thread 6772 exited with status 0x0 --- Process 948 thread 3672 exited with status 0x0 --- Process 3928 thread 9884 created --- Process 9492 loaded C:\Windows\System32\cryptbase.dll at 00007ff9a2350000 --- Process 9492, exception c0000005 at 00007ff9a3bb42e0 --- Process 8376 thread 4292 created --- Process 9492 thread 9672 exited with status 0xc0000005 --- Process 9492 exited with status 0xc0000005 --- Process 9320 exited with status 0xc0000005 --- Process 5636 thread 9676 created --- Process 5636 thread 6036 created --- Process 5636 thread 9676 exited with status 0x0 --- Process 5636 thread 6036 exited with status 0x0

Exception 0xc0000005 is the exception code for a Memory Access Violation a.k.a Segfault. I can provide the full log if necessary.

Update: I did some digging and I think that gdb is crashing when trying to read the registers. At least in my case, this is then an issue with gdb itself.

dgtlrift commented 4 years ago

Is there a diagnostic code that gdbgui can output when it catches a segv from GDB? I'm seeing the same error code when starting an app via GDB.

w809291634 commented 1 year ago

gcc版本出现问题,找一个适合的mingw,下面是我用的版本,测试能够使用 winlibs-x86_64-posix-seh-gcc-7.5.0-mingw-w64-7.0.0-r1.7z