$ cat test.d import std.stdio; void main(string[] args) { std.stdio.writeln(args); } $ dmd test.d $ ./test Segmentation fault $ ./test|cat $ uname -a Darwin jyasskin-macbookpro.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 i386 MacBookPro2,2 Darwin $ dmd --help Digital Mars D Compiler v2.047 ... The segfault is weird in that it goes away when stdout is redirected through cat. The expected output still doesn't appear though. gdb reports: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x00000000 0x0000ad3d in __tls_get_addr () (gdb) bt #0 0x0000ad3d in __tls_get_addr () #1 0x000078f9 in _moduleTlsCtor () #2 0x0000760a in _moduleCtor () #3 0x0000ff70 in D2rt6dmain24mainUiPPaZi6runAllMFZv () #4 0x0000fe7e in D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv () #5 0x0000fe0c in main ()
Can't reproduce with dmd 2.058.