Bug 17898 – Segfault in compile with -deps and -unittest
Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2017-10-14T11:22:24Z
Last change time
2022-05-20T18:38:27Z
Keywords
pull
Assigned to
No Owner
Creator
Saurabh Das
Comments
Comment #0 by saurabh.das — 2017-10-14T11:22:24Z
Reported by Dhananjay at http://forum.dlang.org/post/[email protected]
Sample program "test.d":
import std.stdio : writeln;
unittest { writeln("Unittest"); }
void main() { writeln("Main"); }
Command: dmd -deps=deps.csv -unittest test.d
Output: Segmentation fault: 11
OS: Mac OS X 10.11.6. Has also been reproduced on linux/x64.
DMD version: 2.076.1
The error goes away if -unittest or -deps is not passed.
Comment #1 by saurabh.das — 2017-10-14T11:33:59Z
PS: This is also observed in DMD 2.075.1 but not on DMD 2.074.1
Comment #2 by dbugz — 2017-10-16T10:04:00Z
Tracked this regression down to a deps pull by bisecting dmd:
https://github.com/dlang/dmd/pull/6748
Reverting that commit fixes this issue and supposedly the similar deps bug 17601 too.
Comment #3 by code — 2018-12-23T00:35:03Z
Also crashes with `-debug -deps`, somewhere in IR gen.
@MartinNowak updated dlang/dmd pull request #9122 "Fix Issue 17898 - Segfault in compile with -deps and -debug/unittest" fixing this issue:
- Fix Issue 17898 - Segfault in compile with -deps and -debug/unittest
Revert "Merge pull request #6748 from RazvanN7/Fix_Issue_7016"
This reverts commit afebe0c2ba89594b434d676fbe0c050389a5b48c, reversing
changes made to a91bc973217924a47c46aca7012c10b8762bd26b.
The original change was apparently never used for rdmd and made `-deps` unusable
due to causing segfault during IR-gen. Furthermore the PR killed a common
use-case for the `-deps` switch, collecting shallow dependencies for make et.al.
And lastly https://dlang.org/changelog/2.079.0.html#includeimports added an
alternative implementation for recursive compilation, so recursive dependencies
are no longer needed for rdmd. I'm also not aware of any other user of
recursive dependencies.
https://github.com/dlang/dmd/pull/9122
Comment #6 by maxhaton — 2022-05-20T18:38:27Z
Closing this as a WORKSFORME as I can't reproduce.