D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14027 - segmentation fault in dmd in some circular import situation
Summary: segmentation fault in dmd in some circular import situation
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 All
: P1 major
Assignee: No Owner
URL:
Keywords: industry
Depends on:
Blocks:
 
Reported: 2015-01-22 11:04 UTC by Kanael Arditti
Modified: 2017-05-11 23:47 UTC (History)
2 users (show)

See Also:


Attachments
needed modules for recreating the bug (3.00 KB, application/x-tar)
2015-01-22 11:04 UTC, Kanael Arditti
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Kanael Arditti 2015-01-22 11:04:50 UTC
Created attachment 1471 [details]
needed modules for recreating the bug

When compiling the attached files with the following command line, dmd crashes with segfault. Note that the order of the modules in the command line matters.

Command line:
dmd module_a.d module_b.d

Compiling with -v outputs this:
binary    dmd
version   v2.066.1
config    /etc/dmd.conf
parse     module_a
parse     module_b
importall module_a
import    object	(/usr/include/dmd/druntime/import/object.di)
importall module_b
semantic  module_a
zsh: segmentation fault  dmd -v module_a.d module_b.d
Comment 1 Walter Bright 2017-05-11 23:46:42 UTC
The files are:
----------- module_a.d -----------
module module_a;
import module_b;

enum U = 1;
----------- module_b.d -----------
module module_b;
import module_a;

struct J(int M) {}

struct Y {
    J!U x;
}
----------------------------------
Comment 2 Walter Bright 2017-05-11 23:47:59 UTC
It works without error when compile it with HEAD.