www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8218] New: shared library segmentation fault when missing un-needed import

http://d.puremagic.com/issues/show_bug.cgi?id=8218

           Summary: shared library segmentation fault when missing
                    un-needed import
           Product: D
           Version: D2
          Platform: All
        OS/Version: Mac OS X
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com



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

main`D3std5stdio12__T7writelnZ7writelnFZv + 14 at stdio.d:1567, stop reason =
EXC_BAD_ACCESS (code=1, address=0x0)

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

main`D3std5stdio12__T7writelnZ7writelnFZv + 14 at stdio.d:1567, stop reason =
EXC_BAD_ACCESS (code=1, address=0x0)

at stdio.d:1567



+ 38


+ 38



-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 11 2012