Known reasons why D crashes without any message?

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 13 04:28:46 PDT 2017


On Wednesday, 13 September 2017 at 10:20:48 UTC, Thorsten Sommer 
wrote:
> [...]
>
> Besides the unit tests, the main program is now able to startup 
> but crashes after a while without any message at all. No stack 
> trace, no exception, nothing. Obviously, this makes it hard to 
> debug anything...
>
> [...]
>
> Are there any well-known circumstances, bugs, etc. where an 
> abrupt interruption of a D program without any message is 
> possible? My expectation was, that I would receive at least a 
> stack trace. For debugging, I disabled parallelism at all in 
> order to eliminate effects like exceptions are hidden in 
> threads, missing/wrong variable sharing, etc.
>
> [...]

Things D generally depends on the platform to deal with (such as 
null pointer dereferences) won't yield you a message from the D 
side.
What is the exit code of the program? If it's of the form `128+n` 
with `n == SIGXYZ` you know more of why it crashed [1]. If the 
exit code is 139 e.g., you know some code tried to access memory 
via an invalid reference (as SIGSEGV == 11 on Linux x64), which 
often means you dereferenced a null pointer somewhere.

[1] http://www.tldp.org/LDP/abs/html/exitcodes.html


More information about the Digitalmars-d mailing list