Bug 8377 – Unexpected OPTLINK Termination at EIP=004106BE

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
tools
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-07-11T06:40:00Z
Last change time
2017-01-10T01:45:00Z
Keywords
Optlink
Assigned to
nobody
Creator
dlang-bugzilla

Attachments

IDFilenameSummaryContent-TypeSize
1134file.obj.zipA troublesome object fileapplication/zip52194
1135winnt.dReduced sourcetext/plain2940

Comments

Comment #0 by dlang-bugzilla — 2012-07-11T06:40:11Z
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 by bugzilla — 2012-07-11T11:35:50Z
Why is this a regression? The linker hasn't changed.
Comment #2 by code — 2012-07-11T11:49:17Z
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 by dlang-bugzilla — 2012-08-03T16:29:46Z
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 by WorksOnMyMachine — 2012-08-03T21:09:05Z
*** Issue 8501 has been marked as a duplicate of this issue. ***
Comment #5 by Sergey.Chelombitko — 2012-08-04T13:31:50Z
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 by bugzilla — 2012-08-04T18:54:25Z
Can someone please provide a zip with just the obj files and the linker command? I don't need the source code.
Comment #7 by dlang-bugzilla — 2012-08-04T19:09:26Z
Created attachment 1134 A troublesome object file Running either "dmd file.obj" or "link file.obj" triggers the error.
Comment #8 by bugzilla — 2012-08-04T20:17:50Z
ok, I can duplicate the problem with this .obj file.
Comment #9 by github-bugzilla — 2012-08-04T23:07:31Z
Comment #10 by bugzilla — 2012-08-04T23:08:52Z
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 by dlang-bugzilla — 2012-08-04T23:25:19Z
Comment #12 by dlang-bugzilla — 2012-08-05T00:43:44Z
Created attachment 1135 Reduced source Here is the reduced file that triggers the new assert. "dmd winnt.d" by itself triggers it.
Comment #13 by github-bugzilla — 2012-08-05T02:24:09Z
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 by github-bugzilla — 2012-08-05T02:24:27Z
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 by bugzilla — 2012-08-05T02:26:14Z
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 by dlang-bugzilla — 2012-08-05T02:30:05Z
Confirming fix - all my projects now build correctly. Thank you!
Comment #17 by WorksOnMyMachine — 2012-08-05T23:37:10Z
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.