Bug 17451 – ICE in ddmd/declaration.d(2179)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-05-29T06:01:15Z
Last change time
2020-03-24T08:53:01Z
Keywords
ice
Assigned to
No Owner
Creator
Seb

Comments

Comment #0 by greensunny12 — 2017-05-29T06:01:15Z
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 by greensunny12 — 2017-05-29T07:05:26Z
According to a bisect this can happen since: https://github.com/dlang/dmd/pull/6550
Comment #2 by greensunny12 — 2017-05-29T07:49:47Z
> 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 by uplink.coder — 2017-05-29T23:00:22Z
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 by uplink.coder — 2017-05-29T23:01:11Z
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 by bugzilla — 2017-05-30T01:47:24Z
Comment #6 by github-bugzilla — 2017-05-31T23:12:54Z
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 <[email protected]>
Comment #7 by github-bugzilla — 2017-08-07T13:16:30Z
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