Bug 8218 – shared library segmentation fault when missing un-needed import

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Mac OS X
Creation time
2012-06-11T01:36:19Z
Last change time
2024-12-13T18:00:24Z
Keywords
bootcamp, dll
Assigned to
No Owner
Creator
thelastmammoth
Moved to GitHub: dmd#18447 →

Comments

Comment #0 by thelastmammoth — 2012-06-11T01:36:19Z
That sounds like a bug: dmd -shared -oflibfun.dylib fun #WOULD WORK with -lib instead of -shared dmd -g -L-L. main ./main #SEGFAULTS... see lldb output below //main.d: import std.stdio; pragma(lib,"fun"); void main(){ writeln(); } //fun.d: //import std.stdio; //UNCOMMENT THIS LINE TO MAKE IT WORK ... extern(C) int parse(int x){return x;} -------------------------------- output of lldb: Process 64987 stopped * thread #1: tid = 0x1f03, 0x0000000100000e3a main`D3std5stdio12__T7writelnZ7writelnFZv + 14 at stdio.d:1567, stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000100000e3a main`D3std5stdio12__T7writelnZ7writelnFZv + 14 at stdio.d:1567 1564 { 1565 static if (T.length == 0) 1566 { -> 1567 enforce(fputc('\n', .stdout.p.handle) == '\n'); 1568 } 1569 else static if (T.length == 1 && 1570 isSomeString!(typeof(args[0])) && (lldb) bt * thread #1: tid = 0x1f03, 0x0000000100000e3a main`D3std5stdio12__T7writelnZ7writelnFZv + 14 at stdio.d:1567, stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000100000e3a main`D3std5stdio12__T7writelnZ7writelnFZv + 14 at stdio.d:1567 frame #1: 0x0000000100000e25 main`_Dmain + 9 at main.d:5 frame #2: 0x0000000100011915 main`D2rt6dmain24mainUiPPaZi7runMainMFZv + 29 frame #3: 0x00000001000112ca main`D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 38 frame #4: 0x0000000100011962 main`D2rt6dmain24mainUiPPaZi6runAllMFZv + 58 frame #5: 0x00000001000112ca main`D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 38 frame #6: 0x0000000100011255 main`main + 237 frame #7: 0x0000000100000e14 main`start + 52
Comment #1 by robert.schadek — 2024-12-13T18:00:24Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18447 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB