Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb: Program exited with code 030000000375

I am teaching myself to use gdb and am running some random tests. It may be worth mentioning that I am using a portable installation of MinGW on Windows 7 x64. I've created a program which I know results in a stack overflow, and as I run through it in gdb I first get two SIGSEGV signals (no surprise), and then it exits (again no surprise) with code 030000000375.

Program received signal SIGSEGV, Segmentation fault.
Program received signal SIGSEGV, Segmentation fault.
Program exited with code 030000000375.

Curiosity getting the best of me... what the heck is that code? I googled it and found very little.

Thanks!

UPDATE: For reference I tried the same program on Ubuntu, and the results are slightly different:

Program received signal SIGSEGV, Segmentation fault.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
like image 510
The111 Avatar asked Jul 07 '12 08:07

The111


1 Answers

gdb prints out the exit code in octal format. Not obvious, but indicated by the leading 0.

So 030000000375 is 0xC00000FD in hex, which makes the code look much more common to a windows programmer.

0xC00000FD is STATUS_STACK_OVERFLOW and should be defined in ntstatus.h.

like image 79
alk Avatar answered Oct 20 '22 14:10

alk