www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17077] New: Unexpected optlink termination

https://issues.dlang.org/show_bug.cgi?id=17077

          Issue ID: 17077
           Summary: Unexpected optlink termination
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: meapineapple gmail.com

This is the code for which this error is occurring when linking on Win7:
https://github.com/pineapplemachine/mach.d/tree/optlink-error-repro

I was experiencing errors with 2.071.2-b6 and the current state of that branch
was one where the error was not being produced. Compiling with 2.071.2 should
produce the error as-is. To produce the error in 2.071.2-b6, add `unittest{}`
to line 14 in mach.d/mach/error/enforce/bounds.d. (The specific line should not
particularly matter, but that is where I was placing it while testing myself.)

https://github.com/pineapplemachine/mach.d/blob/optlink-error-repro/mach/error/enforce/bounds.d#L14

In order to reproduce, clone the repository and run the following command:
rdmd -I "path/to/mach.d" -g -main -unittest
"path/to/mach.d/mach/error/enforce/bounds.d"

The same optlink error occurs when attempting to run unit tests for modules
depending on bounds.d. It does not occur for any of the dependencies of
bounds.d.

The optlink error involves this popup: http://puu.sh/tfmBK/c5068eb2fb.png
And this text in stdout/err:

checkpoint(256)
--- errorlevel 1

The text in the popup is this:

EAX=00000010
EBX=0000001C
ECX=00000000
EDX=004337CF
ESI=0044AAE8
EDI=00000100
EBP=0018FF54
ESP=0018FDEC
EIP=0040347E
First=00402000

In addition to adding `unittest{}` to bounds.d, I have also been hitting this
same error depending on the addition of seemingly arbitrary method and function
calls in other modules, too. When the calls are commented out, the code is
successfully compiled.

--
Jan 08 2017