D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20280 - Compiler segfault when building two small files
Summary: Compiler segfault when building two small files
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 critical
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2019-10-08 00:07 UTC by briancschott
Modified: 2021-04-02 05:45 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description briancschott 2019-10-08 00:07:41 UTC
Steps to reproduce: 

1) Create a.d and b.d with the following contents

a.d:
----------------------------------------
struct Alpha(uint _)
{
    import a;
}

struct Foxtrot(uint _)
{
    alias Attributes = Alpha!10;
    enum A = 10;
}
----------------------------------------

b.d:
----------------------------------------
import a;

alias Charlie = Foxtrot!(0);
----------------------------------------

2) Run the compiler. `dmd a.d b.d`

I've been able to reproduce this issue with several front-end versions. It is present in 2.088.1-beta.1 as well.
Comment 1 RazvanN 2019-10-09 07:26:20 UTC
I think that a module importing itself should be an error.
Comment 2 Dlang Bot 2019-10-10 09:34:25 UTC
@RazvanN7 created dlang/dmd pull request #10465 "Fix Issue 20280 - Compiler segfault when building two small files" fixing this issue:

- Fix Issue 20280 - Compiler segfault when building two small files

https://github.com/dlang/dmd/pull/10465
Comment 3 Dlang Bot 2019-11-26 07:01:42 UTC
dlang/dmd pull request #10465 "Fix Issue 20280 - Compiler segfault when building two small files" was merged into stable:

- 4e373d704bfdb7d1d18fb6bd1c7365f96fc9831a by RazvanN7:
  Fix Issue 20280 - Compiler segfault when building two small files

https://github.com/dlang/dmd/pull/10465
Comment 4 Dlang Bot 2021-04-02 05:45:26 UTC
dlang/dmd pull request #12339 "[dmd-cxx] Backport fixes and trivial features from upstream dmd" was merged into dmd-cxx:

- 44a3dc29fc40fbf2c7a209db32c1ccba6239e92c by RazvanN7:
  [dmd-cxx] Fix Issue 20280 - Compiler segfault when building two small files

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