Thread overview
[Issue 20753] "Error: unknown" with structs of arrays, speculative instantiation and recursive types
May 04, 2020
Iain Buclaw
May 04, 2020
Iain Buclaw
May 04, 2020
Iain Buclaw
Nov 26, 2021
RazvanN
Nov 26, 2021
RazvanN
Nov 26, 2021
Vladimir Panteleev
May 04, 2020
https://issues.dlang.org/show_bug.cgi?id=20753

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
How are you building dmd? I first tried a debug version of v2.085.1, and I hit an assert on the test.

core.exception.AssertError@dmd/statement.d(449): Assertion failure
----------------
??:? _d_assertp [0xab84b225]
??:? dmd.statement.ErrorStatement dmd.statement.ErrorStatement.__ctor()
[0xab724c25]
??:? _ZN24StatementSemanticVisitor8setErrorEv [0xab745f87]
??:? _ZN24StatementSemanticVisitor5visitEP12ExpStatement [0xab746172]
??:? _ZN12ExpStatement6acceptEP7Visitor [0xab725739]
??:? _Z17statementSemanticP9StatementP5Scope [0xab745f32]
??:? _ZN24StatementSemanticVisitor5visitEP17CompoundStatement [0xab74630b]
??:? _ZN17CompoundStatement6acceptEP7Visitor [0xab725f99]
??:? _Z17statementSemanticP9StatementP5Scope [0xab745f32]
??:? _ZN16Semantic3Visitor5visitEP15FuncDeclaration [0xab75b088]
??:? _ZN15FuncDeclaration6acceptEP7Visitor [0xab6b371d]
??:? _Z9semantic3P7DsymbolP5Scope [0xab7599b4]
??:? _ZN16Semantic3Visitor5visitEP16TemplateInstance [0xab759b54]
??:? _ZN16TemplateInstance6acceptEP7Visitor [0xab675fd9]
??:? _Z9semantic3P7DsymbolP5Scope [0xab7599b4]
??:? void dmd.dtemplate.TemplateInstance.trySemantic3(dmd.dscope.Scope*)
[0xab675f92]
??:? void
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0xab663435]
??:? _ZN22DsymbolSemanticVisitor5visitEP16TemplateInstance [0xab6598a6]
??:? _ZN16TemplateInstance6acceptEP7Visitor [0xab675fd9]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xab6528ec]
??:? _ZN25ExpressionSemanticVisitor5visitEP8ScopeExp [0xab693d9e]
??:? _ZN8ScopeExp6acceptEP7Visitor [0xab6827a5]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0xab6abd9e]
??:? _ZN25ExpressionSemanticVisitor5visitEP7CallExp [0xab696bcf]
??:? _ZN7CallExp6acceptEP7Visitor [0xab6865f9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0xab6abd9e]
??:? _ZN24StatementSemanticVisitor5visitEP15ReturnStatement [0xab74fbae]
??:? _ZN15ReturnStatement6acceptEP7Visitor [0xab727c25]
??:? _Z17statementSemanticP9StatementP5Scope [0xab745f32]
??:? _ZN24StatementSemanticVisitor5visitEP17CompoundStatement [0xab74630b]
??:? _ZN17CompoundStatement6acceptEP7Visitor [0xab725f99]
??:? _Z17statementSemanticP9StatementP5Scope [0xab745f32]
??:? _ZN16Semantic3Visitor5visitEP15FuncDeclaration [0xab75b088]
??:? _ZN15FuncDeclaration6acceptEP7Visitor [0xab6b371d]
??:? _Z9semantic3P7DsymbolP5Scope [0xab7599b4]
??:? _ZN15FuncDeclaration17functionSemantic3Ev [0xab6aee4d]
??:? _ZN15FuncDeclaration16functionSemanticEv [0xab6aed63]
??:? dmd.func.FuncDeclaration dmd.func.resolveFuncCall(ref
const(dmd.globals.Loc), dmd.dscope.Scope*, dmd.dsymbol.Dsymbol,
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, dmd.mtype.Type,
dmd.root.array.Array!(dmd.expression.Expression).Array*,
dmd.func.FuncResolveFlag) [0xab6b3ef7]
??:? _ZN25ExpressionSemanticVisitor5visitEP7CallExp [0xab698bef]
??:? _ZN7CallExp6acceptEP7Visitor [0xab6865f9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0xab6abd9e]
??:? dmd.expression.Expression
dmd.expressionsem.resolveUFCSProperties(dmd.dscope.Scope*,
dmd.expression.Expression, dmd.expression.Expression) [0xab68ccb1]
??:? _ZN25ExpressionSemanticVisitor5visitEP8DotIdExp [0xab69ce24]
??:? _ZN8DotIdExp6acceptEP7Visitor [0xab68588d]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0xab6abd9e]
??:? void dmd.typesem.resolve(dmd.mtype.Type, ref const(dmd.globals.Loc),
dmd.dscope.Scope*, dmd.expression.Expression*, dmd.mtype.Type*,
dmd.dsymbol.Dsymbol*, bool).visitTypeof(dmd.mtype.TypeTypeof) [0xab732aad]
??:? void dmd.typesem.resolve(dmd.mtype.Type, ref const(dmd.globals.Loc),
dmd.dscope.Scope*, dmd.expression.Expression*, dmd.mtype.Type*,
dmd.dsymbol.Dsymbol*, bool) [0xab731dd4]
??:? dmd.mtype.Type dmd.typesem.typeSemantic(dmd.mtype.Type, dmd.globals.Loc,
dmd.dscope.Scope*).visitTypeof(dmd.mtype.TypeTypeof) [0xab72ff26]
??:? _Z12typeSemanticP4Type3LocP5Scope [0xab72d0bd]
??:? _ZN4Type11trySemanticERK3LocP5Scope [0xab6f65f5]
??:? _ZN25ExpressionSemanticVisitor5visitEP5IsExp [0xab69a926]
??:? _ZN5IsExp6acceptEP7Visitor [0xab684365]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0xab6abd9e]
??:? dmd.init.Initializer dmd.initsem.inferType(dmd.init.Initializer,
dmd.dscope.Scope*).visitExp(dmd.init.ExpInitializer) [0xab6cb057]
??:? dmd.init.Initializer dmd.initsem.inferType(dmd.init.Initializer,
dmd.dscope.Scope*) [0xab6caa9f]
??:? _ZN22DsymbolSemanticVisitor5visitEP14VarDeclaration [0xab653265]
??:? _ZN14VarDeclaration6acceptEP7Visitor [0xab61efe9]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xab6528ec]
??:? void
dmd.dsymbolsem.DsymbolSemanticVisitor.visit(dmd.dstruct.StructDeclaration).__lambda5!(dmd.dsymbol.Dsymbol).__lambda5(dmd.dsymbol.Dsymbol)
[0xab65f40f]
??:? void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,
void delegate(dmd.dsymbol.Dsymbol)) [0xab64cd73]
??:? _ZN22DsymbolSemanticVisitor5visitEP17StructDeclaration [0xab65ed85]
??:? _ZN17StructDeclaration6acceptEP7Visitor [0xab64c819]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xab6528ec]
??:? void
dmd.dtemplate.TemplateInstance.expandMembers(dmd.dscope.Scope*).symbolDg(dmd.dsymbol.Dsymbol)
[0xab675eb4]
??:? void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,
void delegate(dmd.dsymbol.Dsymbol)) [0xab64cd73]
??:? void dmd.dtemplate.TemplateInstance.expandMembers(dmd.dscope.Scope*)
[0xab675e40]
??:? void dmd.dtemplate.TemplateInstance.tryExpandMembers(dmd.dscope.Scope*)
[0xab675f1e]
??:? void
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0xab662f79]
??:? _ZN22DsymbolSemanticVisitor5visitEP16TemplateInstance [0xab6598a6]
??:? _ZN16TemplateInstance6acceptEP7Visitor [0xab675fd9]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xab6528ec]
??:? void dmd.typesem.resolve(dmd.mtype.Type, ref const(dmd.globals.Loc),
dmd.dscope.Scope*, dmd.expression.Expression*, dmd.mtype.Type*,
dmd.dsymbol.Dsymbol*, bool).visitInstance(dmd.mtype.TypeInstance) [0xab732929]
??:? void dmd.typesem.resolve(dmd.mtype.Type, ref const(dmd.globals.Loc),
dmd.dscope.Scope*, dmd.expression.Expression*, dmd.mtype.Type*,
dmd.dsymbol.Dsymbol*, bool) [0xab731dc6]
??:? dmd.mtype.Type dmd.typesem.typeSemantic(dmd.mtype.Type, dmd.globals.Loc,
dmd.dscope.Scope*).visitInstance(dmd.mtype.TypeInstance) [0xab72fe1e]
??:? _Z12typeSemanticP4Type3LocP5Scope [0xab72d0ab]
??:? _ZN22DsymbolSemanticVisitor5visitEP14VarDeclaration [0xab65336f]
??:? _ZN14VarDeclaration6acceptEP7Visitor [0xab61efe9]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xab6528ec]
??:? void
dmd.dsymbolsem.DsymbolSemanticVisitor.visit(dmd.dstruct.StructDeclaration).__lambda5!(dmd.dsymbol.Dsymbol).__lambda5(dmd.dsymbol.Dsymbol)
[0xab65f40f]
??:? void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,
void delegate(dmd.dsymbol.Dsymbol)) [0xab64cd73]
??:? _ZN22DsymbolSemanticVisitor5visitEP17StructDeclaration [0xab65ed85]
??:? _ZN17StructDeclaration6acceptEP7Visitor [0xab64c819]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xab6528ec]
??:? void
dmd.dsymbolsem.DsymbolSemanticVisitor.visit(dmd.dmodule.Module).__lambda2!(dmd.dsymbol.Dsymbol).__lambda2(dmd.dsymbol.Dsymbol)
[0xab657c67]
??:? void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,
void delegate(dmd.dsymbol.Dsymbol)) [0xab64cd73]
??:? _ZN22DsymbolSemanticVisitor5visitEP6Module [0xab657bf3]
??:? _ZN6Module6acceptEP7Visitor [0xab63e9b5]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xab6528ec]
??:? int dmd.mars.tryMain(ulong, const(char)**, ref dmd.globals.Param)
[0xab6ededf]
??:? _Dmain [0xab6ef480]

--
May 04, 2020
https://issues.dlang.org/show_bug.cgi?id=20753

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--
May 04, 2020
https://issues.dlang.org/show_bug.cgi?id=20753

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Iain Buclaw from comment #1)
> How are you building dmd? I first tried a debug version of v2.085.1, and I hit an assert on the test.
> 

Ah, I failed to read the last sentence.  So the regression is in fact caused by pr5500, and pr9485 only partially solved the problem by no longer ICE'ing.

--
November 26, 2021
https://issues.dlang.org/show_bug.cgi?id=20753

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #3 from RazvanN <razvan.nitu1305@gmail.com> ---
Running the code on run.dlang.io [1], it seems that at some point this code compiled, but then it issued an error which was transformed into an ICE. So by "Works in DMD 2.085 but not newer.", I guess you mean that a proper error is outputted? I can't imagine how this used to work we have a mutual dependency at semantic between HashCollection and IniFragment.

[1] https://github.com/dlang/dmd/pull/13348#issuecomment-979940003

--
November 26, 2021
https://issues.dlang.org/show_bug.cgi?id=20753

--- Comment #4 from RazvanN <razvan.nitu1305@gmail.com> ---
(In reply to RazvanN from comment #3)
> Running the code on run.dlang.io [1], it seems that at some point this code compiled, but then it issued an error which was transformed into an ICE. So by "Works in DMD 2.085 but not newer.", I guess you mean that a proper error is outputted? I can't imagine how this used to work we have a mutual dependency at semantic between HashCollection and IniFragment.
> 
> [1] https://github.com/dlang/dmd/pull/13348#issuecomment-979940003

I'm sorry, but I messed up the link. The proper link is: https://run.dlang.io/is/2qlZvz

--
November 26, 2021
https://issues.dlang.org/show_bug.cgi?id=20753

--- Comment #5 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
(In reply to RazvanN from comment #3)
> Running the code on run.dlang.io [1], it seems that at some point this code compiled, but then it issued an error which was transformed into an ICE. So by "Works in DMD 2.085 but not newer.", I guess you mean that a proper error is outputted? I can't imagine how this used to work we have a mutual dependency at semantic between HashCollection and IniFragment.

By "works" here I meant "does not crash with -o-", but it does result in various errors with -c.

With -c, it succeeds in the version range 2.066.0 to 2.071.2.

--
December 13
https://issues.dlang.org/show_bug.cgi?id=20753

--- Comment #6 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19694

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--