[Issue 16333] New: show stack overflow as error message instead of segfaulting
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jul 28 12:36:34 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16333
Issue ID: 16333
Summary: show stack overflow as error message instead of
segfaulting
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: greensunny12 at gmail.com
Is there any way that we can show the user that a stack overflow has happened?
Just a SEGFAULT is quite difficult to debug.
Consider this simple program:
```
void endless()
{
endless();
}
void main()
{
endless();
}
```
All it will print is:
segmentation fault (core dumped) ./main
while it is quite easy to see what's going wrong here, in a more complex
application it isn't. At least it took me a couple of hours to realize that my
program doesn't do semi-random segfaults (given special input data), but
deterministic stack overflows.
Even C++ throws a StackOverflow Error.
--
More information about the Digitalmars-d-bugs
mailing list