www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Does anyone know what's going on with Linux stack traces?

reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
Program:

import std.file; void main() { readText("nonexisting"); }

On my Kubuntu 12.10 VM, I see this when I compile and run it:

std.file.FileException std/file.d(214): nonexistent: No such file 
or directory
----------------
crash(void[] std.file.read(const(char[]), uint)+0x50) [0x8082a00]
crash(immutable(char)[] 
std.file.readText!(immutable(char)[]).readText(const(char[]))+0x16) 
[0x80807d2]
crash(_Dmain+0x14) [0x80807b8]
crash(extern (C) int rt.dmain2._d_run_main(int, char**, extern 
(C) int function(char[][])*).void runMain()+0x10) [0x8081d74]
crash(extern (C) int rt.dmain2._d_run_main(int, char**, extern 
(C) int function(char[][])*).void tryExec(scope void 
delegate())+0x18) [0x8081a20]
crash(extern (C) int rt.dmain2._d_run_main(int, char**, extern 
(C) int function(char[][])*).void runAll()+0x32) [0x8081db2]
crash(extern (C) int rt.dmain2._d_run_main(int, char**, extern 
(C) int function(char[][])*).void tryExec(scope void 
delegate())+0x18) [0x8081a20]
crash(_d_run_main+0x121) [0x80819f1]
crash(main+0x14) [0x80818c4]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0xf75014d3]
----------------

However, on a Gentoo and an Ubuntu server, I get this:

std.file.FileException std/file.d(214): nonexisting: No such file 
or directory
----------------
crash() [0x804c010]
crash() [0x8049de2]
crash() [0x8049dc8]
crash() [0x804b384]
crash() [0x804b030]
crash() [0x804b3c2]
crash() [0x804b030]
crash() [0x804b001]
crash() [0x804aed4]
/lib32/libc.so.6(__libc_start_main+0xe5) [0xf75cfbb5]
crash() [0x8049ce1]
----------------

For some reason, backtrace_symbols is returning an empty string. 
addr2line has no issue with decoding the addresses, however.

If I copy a binary compiled on one machine to another, its 
behavior is preserved, so it appears to be something in the build 
environment (and not the execution environment). It's not the D 
compiler... does anyone know what might cause this? (gcc / ld 
version?)
Feb 08 2013
next sibling parent "Dicebot" <m.strashun gmail.com> writes:
http://stackoverflow.com/questions/10527901/d2-not-getting-any-backtrace-info 
probably this one?
Feb 08 2013
prev sibling parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Friday, 8 February 2013 at 09:39:47 UTC, Dicebot wrote:
 http://stackoverflow.com/questions/10527901/d2-not-getting-any-backtrace-info 
 probably this one?

Ahh, indeed... thanks!
Feb 08 2013