Jump to page: 1 2
Thread overview
Backtraces on Linux 64-bit
Oct 28, 2013
aldanor
Oct 30, 2013
Martin Nowak
Oct 30, 2013
Dicebot
Oct 31, 2013
Martin Nowak
Oct 31, 2013
Dicebot
Nov 09, 2013
Martin Nowak
Nov 09, 2013
Timothee Cour
Nov 09, 2013
Martin Nowak
Nov 10, 2013
yazd
Nov 15, 2013
aldanor
Oct 30, 2013
deadalnix
Oct 31, 2013
Martin Nowak
Oct 31, 2013
deadalnix
October 28, 2013
Hi all,

Does anybody know what's the current story with 64-bit Linux backtraces? I've seen a couple of posts here and on stackoverflow (like this http://stackoverflow.com/questions/10527901/d2-not-getting-any-backtrace-info), couldn't find any definitive answers for the 64-bit case.

./test(pure @safe immutable(char)[] std.exception.enforce!(immutable(char)[]).enforce(immutable(char)[], lazy const(char)[], immutable(char)[], ulong)+0x6a) [0x50a85e]
./test(_Dmain+0x17f) [0x4a188b]
./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void runMain()+0x18) [0x529740]
./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void tryExec(scope void delegate())+0x2a) [0x529272]
./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void runAll()+0x40) [0x529790]
./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void tryExec(scope void delegate())+0x2a) [0x529272]
./oracle(_d_run_main+0x1ae) [0x52922e]
./test(main+0x17) [0x52907b]
/lib64/libc.so.6(__libc_start_main+0xe6) [0x7f87dd21dc36]


Note: I have the -L--export-dynamic flag enabled in dmd.conf, but it doesn't seem to do much; I'm running dmd64 v2.063.2.
October 30, 2013
On 10/28/2013 11:43 AM, aldanor wrote:
> ./test(pure @safe immutable(char)[]
> std.exception.enforce!(immutable(char)[]).enforce(immutable(char)[],
> lazy const(char)[], immutable(char)[], ulong)+0x6a) [0x50a85e]
> ./test(_Dmain+0x17f) [0x4a188b]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int
> function(char[][])*).void runMain()+0x18) [0x529740]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int
> function(char[][])*).void tryExec(scope void delegate())+0x2a) [0x529272]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int
> function(char[][])*).void runAll()+0x40) [0x529790]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int
> function(char[][])*).void tryExec(scope void delegate())+0x2a) [0x529272]
> ./oracle(_d_run_main+0x1ae) [0x52922e]
> ./test(main+0x17) [0x52907b]
> /lib64/libc.so.6(__libc_start_main+0xe6) [0x7f87dd21dc36]
>
Apparently you have a stacktrace so what exactly is the problem?

> Note: I have the -L--export-dynamic flag enabled in dmd.conf, but it
> doesn't seem to do much; I'm running dmd64 v2.063.2.
It's really annoying that we rely on --export-dynamic for backtraces.
Exporting symbols from the executable can have unwanted side effects.
But unless someone writes a backtrace handler that understands DWARF we're stuck.
October 30, 2013
On Wednesday, 30 October 2013 at 20:14:30 UTC, Martin Nowak wrote:
> Apparently you have a stacktrace so what exactly is the problem?

It had line numbers and file names some time ago. I have missed the moment when it  became broken :(
October 30, 2013
On Monday, 28 October 2013 at 10:43:09 UTC, aldanor wrote:
> Hi all,
>
> Does anybody know what's the current story with 64-bit Linux backtraces? I've seen a couple of posts here and on stackoverflow (like this http://stackoverflow.com/questions/10527901/d2-not-getting-any-backtrace-info), couldn't find any definitive answers for the 64-bit case.
>
> ./test(pure @safe immutable(char)[] std.exception.enforce!(immutable(char)[]).enforce(immutable(char)[], lazy const(char)[], immutable(char)[], ulong)+0x6a) [0x50a85e]
> ./test(_Dmain+0x17f) [0x4a188b]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void runMain()+0x18) [0x529740]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void tryExec(scope void delegate())+0x2a) [0x529272]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void runAll()+0x40) [0x529790]
> ./test(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void tryExec(scope void delegate())+0x2a) [0x529272]
> ./oracle(_d_run_main+0x1ae) [0x52922e]
> ./test(main+0x17) [0x52907b]
> /lib64/libc.so.6(__libc_start_main+0xe6) [0x7f87dd21dc36]
>
>
> Note: I have the -L--export-dynamic flag enabled in dmd.conf, but it doesn't seem to do much; I'm running dmd64 v2.063.2.

I have the project to improve this for D. And I'll do it one day :D

https://github.com/bombela/backward-cpp
October 31, 2013
On 10/30/2013 09:59 PM, deadalnix wrote:
> I have the project to improve this for D. And I'll do it one day :D
>
> https://github.com/bombela/backward-cpp

Awesome stuff. Let me know how we could help you to port this to D.
Maybe it's simpler to write a C wrapper?
October 31, 2013
On 10/30/2013 09:37 PM, Dicebot wrote:
>
> It had line numbers and file names some time ago. I have missed the
> moment when it  became broken :(

There are line numbers on windows. The unix stuff relies on the dynamic symbol tables to find symbol names (that's why it needs --export-dynamic). To get line number information you need to process debug information.
October 31, 2013
On Thursday, 31 October 2013 at 19:00:42 UTC, Martin Nowak wrote:
> There are line numbers on windows. The unix stuff relies on the dynamic symbol tables to find symbol names (that's why it needs --export-dynamic). To get line number information you need to process debug information.

It does not work now even with --export-dynamic on Linux, that is the whole point.
October 31, 2013
On Thursday, 31 October 2013 at 18:59:02 UTC, Martin Nowak wrote:
> On 10/30/2013 09:59 PM, deadalnix wrote:
>> I have the project to improve this for D. And I'll do it one day :D
>>
>> https://github.com/bombela/backward-cpp
>
> Awesome stuff. Let me know how we could help you to port this to D.
> Maybe it's simpler to write a C wrapper?

I don't plan to port it in the sens I'll translate it to D. Simply propose some patch to make it work with D.
November 09, 2013
On 10/31/2013 08:05 PM, Dicebot wrote:
> It does not work now even with --export-dynamic on Linux, that is the
> whole point.
It can't by design, there are no line numbers in dynamic symbol tables.
November 09, 2013
On Sat, Nov 9, 2013 at 12:45 PM, Martin Nowak <code@dawg.eu> wrote:

> On 10/31/2013 08:05 PM, Dicebot wrote:
>
>> It does not work now even with --export-dynamic on Linux, that is the whole point.
>>
> It can't by design, there are no line numbers in dynamic symbol tables.
>

And yet lldb *can* display line numbers so the info is there.

* thread #1: tid = 0x324b, 0x000000000041636c test2 fun2 + 4 at test.d:7,
stop reason = breakpoint 1.1
frame #0: 0x000000000041636c test2 fun2 + 4 at test_multi.d:7
frame #1: 0x0000000000416381 test2 _D5tests10test_multi4fun1FZv + 9 at
test_multi.d:10


« First   ‹ Prev
1 2