Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No stack trace on linux #2004

Closed
henrygouk opened this issue Feb 18, 2017 · 2 comments
Closed

No stack trace on linux #2004

henrygouk opened this issue Feb 18, 2017 · 2 comments

Comments

@henrygouk
Copy link

Uncaught exceptions do not result in a stack trace being printed. I've tried compiling the following program (with LDC v1.1.0) on two Ubuntu machines (one running 14.04, the other 16.04):

void foo()
{
	throw new Exception("bar");
}

void main()
{
	foo();
}

Both result in the following output:

object.Exception@test.d(3): bar
----------------

Similar behaviour is exhibited if the throw statement is replaced with an assert(0);.

Compiling with DMD (v2.071.0) results in this output:

object.Exception@test.d(3): bar
----------------
??:? void test.foo() [0x422a89]
??:? _Dmain [0x422a98]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x4230d6]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x423020]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x423092]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x423020]
??:? _d_run_main [0x422f91]
??:? main [0x422b25]
??:? __libc_start_main [0xac19482f]
@dnadlinger
Copy link
Member

Can confirm on Arch Linux. Investigating…

@dnadlinger
Copy link
Member

This has already been fixed in master (will be in 1.2.0). The switch to using backtrace(3) hadn't been made in 1.1.0 apparently, and neither the LDC-specific innermost frame skipping code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants