Skip to content

stack trace missing on assert failure #115

@thelastmammoth

Description

@thelastmammoth

the stack trace appears in dmd, not ldmd2/ldc (even with various combination of debug flags):
(i'm on osx if that's relevant).

main4.d:

int fun(int x){ assert(x<0); return x+x;}
void main(){int x=fun(10);}
ldmd2 main4 && ./main4                                                                                                  
[email protected](1): Assertion failure

==> no stack trace

dmd main4 && ./main4                                                                                                
core.exception.AssertError@main4(1): Assertion failure
----------------
5   main4                               0x00000001095d2576 _d_assertm + 42
6   main4                               0x00000001095c2477 void main4.__assert(int) + 23
7   main4                               0x00000001095c2491 int main4.fun(int) + 25
8   main4                               0x00000001095c245a _Dmain + 14
9   main4                               0x00000001095d2ea9 extern (C) int rt.dmain2.main(int, char**).void runMain() + 29
10  main4                               0x00000001095d285e extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 38
11  main4                               0x00000001095d2ef6 extern (C) int rt.dmain2.main(int, char**).void runAll() + 58
12  main4                               0x00000001095d285e extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 38
13  main4                               0x00000001095d27e9 main + 237
14  main4                               0x00000001095c2444 start + 52
15  ???                                 0x0000000000000001 0x0 + 1
----------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions