Issue 8377 - Unexpected OPTLINK Termination at EIP=004106BE
Summary: Unexpected OPTLINK Termination at EIP=004106BE
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: x86 Windows
: P2 regression
Assignee: No Owner
URL:
Keywords: Optlink
: 8501 (view as issue list)
Depends on:
Blocks:
 
Reported: 2012-07-11 06:40 UTC by Vladimir Panteleev
Modified: 2017-01-10 01:45 UTC (History)
4 users (show)

See Also:


Attachments
A troublesome object file (50.97 KB, application/zip)
2012-08-04 19:09 UTC, Vladimir Panteleev
Details
Reduced source (2.87 KB, text/plain)
2012-08-05 00:43 UTC, Vladimir Panteleev
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2012-07-11 06:40:11 UTC
Trying to build DFeed using DMD git head results in an OPTLINK crash.

Steps to reproduce:

1) Build DMD/Druntime/Phobos from latest Git
2) Clone https://github.com/CyberShadow/DFeed and its submodules (ae)
3) rdmd --build-only -version=WindowsXP dfeed_web.d

I'm not going to even reduce this one unless there's an indication that someone is going to look at it (it literally takes days, and my previous OPTLINK report was ignored).
Comment 1 Walter Bright 2012-07-11 11:35:50 UTC
Why is this a regression? The linker hasn't changed.
Comment 2 David Nadlinger 2012-07-11 11:49:17 UTC
It is a regression if you consider Optlink to be just an internal component of DMD "as a whole". Yes, it technically might not be a new bug, just a bug that didn't show up before. But the point is that code which compiled fine in previous versions would break if a new release was made right now.
Comment 3 Vladimir Panteleev 2012-08-03 16:29:46 UTC
The problem still exists in the DMD 2.060 release. The problem seems to be triggered by some code in a library. I can't build many of my projects with DMD 2.060 on Windows, which includes DFeed.
Comment 4 Sean Cavanaugh 2012-08-03 21:09:05 UTC
*** Issue 8501 has been marked as a duplicate of this issue. ***
Comment 5 zerg 2012-08-04 13:31:50 UTC
I'm facing the same problem with DMD 2.060 when taking address of constant from module that was compiled into static library. It seems to be directly related to number (or total size, probably) of constants in that module. Looks like having too many constants causes bad code generation.
DMD 2.059 - no such problem.
Comment 6 Walter Bright 2012-08-04 18:54:25 UTC
Can someone please provide a zip with just the obj files and the linker command? I don't need the source code.
Comment 7 Vladimir Panteleev 2012-08-04 19:09:26 UTC
Created attachment 1134 [details]
A troublesome object file

Running either "dmd file.obj" or "link file.obj" triggers the error.
Comment 8 Walter Bright 2012-08-04 20:17:50 UTC
ok, I can duplicate the problem with this .obj file.
Comment 10 Walter Bright 2012-08-04 23:08:52 UTC
It looks like a corrupt .obj file. Can anyone add this diagnostic to cgobj.c, build dmd, and then see if the source that causes it can be isolated?
Comment 11 Vladimir Panteleev 2012-08-04 23:25:19 UTC
It's this file:
http://svn.dsource.org/projects/bindings/trunk/win32/winnt.d
Comment 12 Vladimir Panteleev 2012-08-05 00:43:44 UTC
Created attachment 1135 [details]
Reduced source

Here is the reduced file that triggers the new assert.

"dmd winnt.d" by itself triggers it.
Comment 13 github-bugzilla 2012-08-05 02:24:09 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fb0483e8a0d5492393b794e095e272f81b32ac89
fix Issue 8377 - Unexpected OPTLINK Termination at EIP=004106BE
Comment 14 github-bugzilla 2012-08-05 02:24:27 UTC
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5446febb6b41b952eb93e24808ae3da03e6caab7
fix Issue 8377 - Unexpected OPTLINK Termination at EIP=004106BE
Comment 15 Walter Bright 2012-08-05 02:26:14 UTC
This is definitely a regression in the compiler, where it puts out a corrupted .obj file when the align directive is used.

It's a disastrous bug, and affects all platforms.
Comment 16 Vladimir Panteleev 2012-08-05 02:30:05 UTC
Confirming fix - all my projects now build correctly. Thank you!
Comment 17 Sean Cavanaugh 2012-08-05 23:37:10 UTC
I just built dmd for windows from the github sources, and all my projects compile and run properly now dropping in the fixed binary into the 2.060 installation.