I happened to notice this by accident, because of a bug in our testsuite that caused us to spawn GDB as ... % gdb "" ... instead of ... % gdb ... when we want to start GDB without an executable name. The atypical command where we launch GDB with an empty exec name causes the crash on only one of our Windows machines (Win XP 32bit to be exact). To reproduce: % gdb "" [...] : No such file or directory. (gdb) set height 0 Critical error handler: process 2496 (c:\[...]\gdb.exe) terminated due to access violation It looks like a MinGW bug - while debugging this, GDB receives a SIGTRAP notification from ntdll: (gdb) step warning: HEAP[toto.exe]: warning: Heap block at 003E2460 modified at 003E2492 past requested size of 2a Program received signal SIGTRAP, Trace/breakpoint trap. 0x7c91120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll The backtrace shows that we're in _mingw_stat and that the _path has changed from something sensible (the current working directory with a slash at the end) to something obviously wrong: #8 0x0040193b in _mingw_stat ( _path=0xffffffff
, _st=0x22ff38) at stat.c:71 I can reproduce the same SIGTRAP debugging the following little C program, even if that little program does not crash. | #include