www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Exit with code xx

reply Ozan <ozan.nurettin.sueel sap.com> writes:
Hi

Is there any overview, list, wiki about what's behind runtime 
errors like
"Program exited with code -11"?

Okay, I made a mistake...but it's better to know where and what 
kind?

Thanks & Regards,
Ozan
Nov 25 2015
next sibling parent John Colvin <john.loughran.colvin gmail.com> writes:
On Wednesday, 25 November 2015 at 16:11:09 UTC, Ozan wrote:
 Hi

 Is there any overview, list, wiki about what's behind runtime 
 errors like
 "Program exited with code -11"?

 Okay, I made a mistake...but it's better to know where and what 
 kind?

 Thanks & Regards,
 Ozan
That's just normal exit-code stuff, same as in C . Could be a segfault of some sort. If you've compiled with -release and/or no bounds checks (can be hidden behind -O flags with ldc/gdc), try dropping those options and you might get a more useful error. Alternatively, fire up a debugger and find where things went wrong the old-fashioned way, e.g. $ gdb ./myProgram (gdb) run segfault, some information .... (gdb) bt full full stack trace
Nov 25 2015
prev sibling next sibling parent Alex Parrill <initrd.gz gmail.com> writes:
On Wednesday, 25 November 2015 at 16:11:09 UTC, Ozan wrote:
 Hi

 Is there any overview, list, wiki about what's behind runtime 
 errors like
 "Program exited with code -11"?

 Okay, I made a mistake...but it's better to know where and what 
 kind?

 Thanks & Regards,
 Ozan
You know about process exit codes right? On Linux, a negative exit code means that the process exited due to a signal. Signal 11 is SIGSEGV, aka a segmentation fault. Run your binary in a debugger (ex. gdb) and find out where it's causing the error.
Nov 25 2015
prev sibling parent Ozan <ozan.nurettin.sueel sap.com> writes:
On Wednesday, 25 November 2015 at 16:11:09 UTC, Ozan wrote:
 Hi

 Is there any overview, list, wiki about what's behind runtime 
 errors like
 "Program exited with code -11"?

 Okay, I made a mistake...but it's better to know where and what 
 kind?

 Thanks & Regards,
 Ozan
Okay, I found my little bug: An array error. So "Program exited with code -11" is about memory bugs, I think. Regards, Ozan
Nov 25 2015