D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15760 - Segfault when compiling when using __gshared and selective import.
Summary: Segfault when compiling when using __gshared and selective import.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2016-03-04 19:39 UTC by Christian D
Modified: 2016-03-24 23:52 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 Christian D 2016-03-04 19:39:15 UTC
#cat alice.d

import bob : Foo;

struct Bar {
	__gshared Foo foo;
}

#cat bob.d
import alice;

struct Foo {
	Bar a;
}

Compiling with dmd, gdc or ldc causes a segmentation fault.

'dmd alice.d bob.d' segfaults, but 'dmd bob.d alice.d' doesn't.
Changing the first import from 'bob : Foo' to just 'bob' stops the segfault.
Also happens if foo is a pointer but if boo is one, it doesn't have the problem.
Comment 1 Christian D 2016-03-04 19:40:44 UTC
*bar instead of boo
Comment 2 Kenji Hara 2016-03-24 15:39:22 UTC
The compiler segfault is fortunately fixed by the PR for issue 15519.

https://github.com/D-Programming-Language/dmd/pull/5333

I'll add a test case to avoid future regression.
Comment 3 Kenji Hara 2016-03-24 15:42:17 UTC
(In reply to Kenji Hara from comment #2)
> I'll add a test case to avoid future regression.

https://github.com/D-Programming-Language/dmd/pull/5573
Comment 4 github-bugzilla 2016-03-24 23:52:35 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ec22537b5e745a286944342f2177237bd27dbb12
fix Issue 15760 - Segfault when compiling when using __gshared and selective import

https://github.com/D-Programming-Language/dmd/commit/96aebe4cce9da42c137890aba692aecf08968b33
Merge pull request #5573 from 9rnsr/fix15760

Issue 15760 - Segfault when compiling when using __gshared and selective import