https://issues.dlang.org/show_bug.cgi?id=21480
Issue ID: 21480 Summary: uncaught exceptions: stack trace truncated at NUL char Product: D Version: D2 Hardware: All OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: druntime Assignee: nob...@puremagic.com Reporter: kde...@vogtner.de from http://forum.dlang.org/thread/ggyxirvvnypggstfk...@forum.dlang.org#post-ggyxirvvnypggstfkbzj:40forum.dlang.org ~~~char2.d void main () { import std.stdio; import std.conv; char [2] win = [0, 'X']; auto ne = new Exception ("A " ~ win.to!string ~ " B"); try throw ne; catch (Exception e) writeln ("exception caught: e.msg = <", e.msg, ">"); throw ne; } ~~~ Output: exception caught: e.msg = <A X B> object.Exception@char2.d(6): A <--- truncated at \0 [...] Commment from P.B.: This is definitely a bug. The problem is that the D runtime uses `fprintf` to print the exception's error message, when it should be using `fwrite`: https://github.com/dlang/druntime/blob/v2.094.2/src/rt/dmain2.d#L733 --