D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17290 - DMD crash due to circular reference in function return type
Summary: DMD crash due to circular reference in function return type
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ice, pull
: 17140 (view as issue list)
Depends on:
Blocks:
 
Reported: 2017-04-01 18:08 UTC by lyrachord
Modified: 2020-03-21 03:56 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description lyrachord 2017-04-01 18:08:44 UTC
f.T f(){ }

void main(){
}
Comment 1 RazvanN 2017-04-03 11:00:13 UTC
Could you please be more explicit?
Comment 2 ag0aep6g 2017-04-03 11:21:52 UTC
(In reply to RazvanN from comment #1)
> Could you please be more explicit?

Try to compile the given code. dmd crashes with a segmentation fault. It shouldn't crash, but show an error message.
Comment 3 basile-z 2019-03-01 08:52:28 UTC
There's a cycle when trying to solve T. Somewhere the ".inuse" member of the declaration of function "f" must be incremented and later decremented to detect the cycle.

Just gotta find the right place, using the backtrace of the ICE, because this case is tricky. You can fix it at several place but then it breaks the test suite or even some stuff in druntime.
Comment 4 Dlang Bot 2019-03-02 08:52:03 UTC
@Basile-z created dlang/dmd pull request #9403 "fix issue 17290 - DMD crash due to circular reference in function return type" fixing this issue:

- fix issue 17290 - DMD crash due to circular reference in function return type

https://github.com/dlang/dmd/pull/9403
Comment 5 basile-z 2019-03-02 09:55:47 UTC
*** Issue 17140 has been marked as a duplicate of this issue. ***
Comment 6 Dlang Bot 2019-03-02 11:20:22 UTC
dlang/dmd pull request #9403 "fix issue 17290 - DMD crash due to circular reference in function return type" was merged into master:

- e10fb38ed81aa27fe688cef0c36f8cc3da2948dc by Basile Burg:
  fix issue 17290 - DMD crash due to circular reference in function return type

https://github.com/dlang/dmd/pull/9403
Comment 7 Dlang Bot 2019-06-16 20:57:31 UTC
dlang/dmd pull request #10046 "[dmd-cxx] Backport semanticRun refactoring and recursive semantic SEGV bug fixes" was merged into dmd-cxx:

- d7dc83daead6b5ac8413e55fc3cff706ead7da18 by Basile Burg:
  fix issue 17290 - DMD crash due to circular reference in function return type

https://github.com/dlang/dmd/pull/10046