skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.7k stars 186 forks source link

GDB crashes #8

Closed s997863 closed 1 year ago

s997863 commented 3 years ago

Hi,

I downloaded w64devkit-1.7.0.zip and typing "GDB" brings up an appcrash dialog box saying "gdb.exe has stopped working".

The w64devkit shell still remains open after I close this box. I can get as far as the GDB welcome screen by directly clicking on the gdb.exe file from Windows Explorer, and it opens up a command prompt, but the crash window still appears if I type in anything.

I'm running on Windows-7 Ultimate SP1, 64-bit. Other functions in this devkit seem to be working ok: so far I've tried vim, gvim, cc, make, and compiled the Asteroids demo.

======== Thanks for your efforts. I'm trying this out as a step-up from running Turbo-C++ 3.0 under DosBox, and I'm loathe to download many gigabytes of VS Community just to continue the beginner exercises from the "K&R" & "Modern Approach" C books.

========

skeeto commented 3 years ago

Thanks for reporting this and including plenty of information. I hadn't realized GDB was working so poorly. This seems to be related to running GDB on Mingw-w64 8.0.2, and it's a bug in either GDB or Mingw-w64 (or both). The bug is also present in GDB 10.2 (due for the next release). GDB in w64devkit 1.6.0 works more smoothly where it's Mingw-w64 7.0.0.

Fortunately GDB still seems to function if you debug a program with debugging symbols and you don't enter an invalid command. (This is why I hadn't noticed yet.)

Unfortunately GDB's Windows support has always been lacking, so crashes like this are not unusual. It's probably not worth downgrading Mingw-w64 just to make GDB crash a bit less often, so hopefully this is fixed upstream in the future. Unfortunately there are bugs in GDB that makes it incompatible with Mingw-w64 9.0.0, so I can't yet check if it's already been fixed.

skeeto commented 2 years ago

I just attempted to spend some time investigating this issue further, but it looks like it was fixed in f533388d2cb437ddaff62aa6a61435ebae0dbf1c with the upgrade to GCC 11.2.0. (It's still broken a commit earlier in 8260e65129923b8adf213aa15abca349eb085e61.) I don't know why it's now working, but hopefully it doesn't regress.

Since everything is in a really good state right now, and quite thoroughly tested through my own dogfooding, I'll probably cut a new release soon which will include this much more stable GDB.

skeeto commented 1 year ago

Despite my own regular GDB use, I've not observed a crash since GCC 11.2.0, so I'm going to call this resolved.