D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17451 - ICE in ddmd/declaration.d(2179)
Summary: ICE in ddmd/declaration.d(2179)
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2017-05-29 06:01 UTC by Seb
Modified: 2020-03-24 08:53 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Seb 2017-05-29 06:01:15 UTC
This is a reduced ICE from vibe.d (hence the funky names). It happens with the latest DMD as of now (v2.075.0-devel-e5ebfc571)

> dmd -c libevent2.d

libevent2.d:
---
interface ManualEvent {}

interface EventDriver {
	ManualEvent createManualEvent() ;
}

struct ArraySet(Key)
{
	~this()
    {
		try allocator;
		catch false; // should never happen
	}
}

struct HashMap(TValue)
{
	alias Value = TValue;
	static if ({ Value v; }) {}
}

struct Task {}

class Libevent2Driver : EventDriver {
	Libevent2ManualEvent createManualEvent() {}
}

struct ThreadSlot {
	ArraySet!Task tasks;
}

class Libevent2ManualEvent {
	HashMap!ThreadSlot m_waiters;
}
---

core.exception.AssertError@ddmd/declaration.d(2179): Assertion failure
----------------
??:? _d_assertp [0x713ac4]
??:? _ZN14VarDeclaration13callScopeDtorEP5Scope [0x53349b]
??:? _ZN14VarDeclaration8semanticEP5Scope [0x53294d]
??:? _ZN14DeclarationExp8semanticEP5Scope [0x589323]
??:? _ZN24StatementSemanticVisitor5visitEP12ExpStatement [0x6150cb]
??:? _ZN12ExpStatement6acceptEP7Visitor [0x60a5a1]
??:? ddmd.statement.Statement ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*) [0x6229b6]
??:? _ZN24StatementSemanticVisitor5visitEP17CompoundStatement [0x615361]
??:? _ZN17CompoundStatement6acceptEP7Visitor [0x60acf1]
??:? ddmd.statement.Statement ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*) [0x6229b6]
??:? _ZN15FuncDeclaration9semantic3EP5Scope [0x5a8b8e]
??:? _ZN7FuncExp8semanticEP5Scope [0x5884e2]
??:? bool ddmd.staticcond.evalStaticCondition(ddmd.dscope.Scope*, ddmd.expression.Expression, ddmd.expression.Expression, ref bool) [0x62302a]
??:? _ZN17StaticIfCondition7includeEP5ScopeP12ScopeDsymbol [0x50cf20]
??:? _ZN22ConditionalDeclaration7includeEP5ScopeP12ScopeDsymbol [0x504ed1]
??:? _ZN19StaticIfDeclaration7includeEP5ScopeP12ScopeDsymbol [0x505121]
??:? _ZN17AttribDeclaration8semanticEP5Scope [0x502896]
??:? _ZN19StaticIfDeclaration8semanticEP5Scope [0x505224]
??:? _ZN17StructDeclaration8semanticEP5Scope [0x55bec7]
??:? _ZN16TemplateInstance13expandMembersEP5Scope [0x572ccd]
??:? _ZN16TemplateInstance16tryExpandMembersEP5Scope [0x572d3e]
??:? _ZN16TemplateInstance8semanticEP5ScopeP5ArrayIP10ExpressionE [0x56ea15]
??:? _ZN16TemplateInstance8semanticEP5Scope [0x56f14b]
??:? _ZN12TypeInstance7resolveE3LocP5ScopePP10ExpressionPP4TypePP7Dsymbolb [0x5e1db5]
??:? _ZN12TypeInstance8semanticE3LocP5Scope [0x5e1e9f]
??:? _ZN14VarDeclaration8semanticEP5Scope [0x530726]
??:? _ZN16ClassDeclaration8semanticEP5Scope [0x52ba15]
??:? _ZN4Type9covariantEPS_Pm [0x5d299c]
??:? _ZN15FuncDeclaration13findVtblIndexEP5ArrayIP7DsymbolEi [0x5abfa4]
??:? _ZN15FuncDeclaration8semanticEP5Scope [0x5a6971]
??:? _ZN16ClassDeclaration8semanticEP5Scope [0x52ba15]
??:? _ZN6Module8semanticEP5Scope [0x551b39]
??:? int ddmd.mars.tryMain(ulong, const(char)**) [0x5d052c]
??:? _Dmain [0x5d1686]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFNlZv [0x71570e]
??:? scope void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x715658]
??:? scope void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x7156ca]
??:? scope void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x715658]
??:? _d_run_main [0x7155d6]
??:? main [0x5d1d1b]
??:? __libc_start_main [0xd5961510]
Comment 1 Seb 2017-05-29 07:05:26 UTC
According to a bisect this can happen since: https://github.com/dlang/dmd/pull/6550
Comment 2 Seb 2017-05-29 07:49:47 UTC
> According to a bisect this can happen since: https://github.com/dlang/dmd/pull/6550

Please ignore, the PR in which the failing check was introduced is:

https://github.com/dlang/dmd/pull/6065
Comment 3 uplink.coder 2017-05-29 23:00:22 UTC
Destructors are now transitivity called. Maybe it has something todo with that.

The actual assert triggering makes sure the struct h is not forward referenced (I believe)
Comment 4 uplink.coder 2017-05-29 23:01:11 UTC
Destructors are now transitivity called. Maybe it has something todo with that.

The actual assert triggering makes sure the struct h is not forward referenced (I believe)
Comment 5 Walter Bright 2017-05-30 01:47:24 UTC
https://github.com/dlang/dmd/pull/6844
Comment 6 github-bugzilla 2017-05-31 23:12:54 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/a98029d193806d78d4c3a8ad30adbfa07822f0ae
fix Issue 17451 - ICE in ddmd/declaration.d(2179)

https://github.com/dlang/dmd/commit/18a36ca994656db307d8b92d254aed240122a5d9
Merge pull request #6844 from WalterBright/fix17451

fix Issue 17451 - ICE in ddmd/declaration.d(2179)
merged-on-behalf-of: Martin Nowak <code@dawg.eu>
Comment 7 github-bugzilla 2017-08-07 13:16:30 UTC
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/a98029d193806d78d4c3a8ad30adbfa07822f0ae
fix Issue 17451 - ICE in ddmd/declaration.d(2179)

https://github.com/dlang/dmd/commit/18a36ca994656db307d8b92d254aed240122a5d9
Merge pull request #6844 from WalterBright/fix17451