Seemingly patternless optlink premature termination

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 8 10:49:50 PST 2017


On 1/8/2017 6:15 AM, pineapple wrote:
> I'm working on my dumb library and I have run into a case where when I add this
> line to a module, I get an optlink error attempting to compile it:
>
>     unittest{}
>
> The module compiles fine without it. So do the modules which depend on it.
>
> But with that line? optlink errors everywhere.
>
> A screencap of the error box that pops up:
>
>     http://puu.sh/tfmBK/c5068eb2fb.png
>
> And the contents of stdout:
>
>     checkpoint(256)
>     --- errorlevel 1
>
> I encountered a similar error right before this and eventually worked out that I
> had introduced a cyclic dependency into my project some time ago - strangely not
> rearing its head as an error until I made a completely unrelated addition to the
> tests in a module incidentally importing one of the modules involved in that
> dependency cycle - and addressing that issue seemed to resolve the optlink
> error. (At least until I tried to add some extra unit tests to one of the
> modules involved in that cycle.)
>
> I am utterly failing to find a way to make a simple repro case from this, or to
> understand what could conceivably be causing this error to occur in a module
> whose dependency graph is small and simple.
>

Please post bug reports to bugzilla. I transcribed the error here:

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

Try to include the code that causes the problem.

The way to debug this (for anyone interested) is to get it to fail running under 
windbg.exe. Then examine the instructions around where it failed. Look in the 
source code to find where those instructions are, and hence the location in the 
code where it faulted.

P.S. Isn't it maddening that Windows doesn't allow copying the data from a 
message window?


More information about the Digitalmars-d mailing list