www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18485] New: dmd generates a binary that throws SIGSEGV when


          Issue ID: 18485
           Summary: dmd generates a binary that throws SIGSEGV when using
                    interface files (di) importing modules
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: diego.lago.gonzalez gmail.com

D compiler (dmd) generates a binary file (test program) that throws a SIGSEGV
when it is linked against a library (*.so) using an interface file (*.di)
instead of a source file (*.di) when importing the library API (module).

Compiling the library is made with or without -H option to generate or not the
interface file (*.di). After that, the test program is compiled against the
library importing the source file (*.d).

With this import, [as stated in
documentation](https://dlang.org/dmd-linux.html#interface-files), `dmd` uses
interface files before source files if they are present.

And, when the test program is compiled using that interface file, that program
throws a SIGSEGV on every run.

Repository with a proof of concept:

Feb 21 2018