On Friday, 7 October 2022 at 14:12:14 UTC, Andrey Zherikov wrote:
> I'll try to run dmd under gdb in hope to get more details but may be above would be enough for compiler devs to ring a bell.
Here is gdb stack:
Breakpoint 2, Array<Expression*>::operator[](unsigned long) (this=..., i=1722) at /home/andrey/dmd/dmd/compiler/src/dmd/root/array.d:269
269 return data[i];
(gdb) p this
$4 = (const dmd.root.array.Array!(dmd.expression.Expression).Array &) @0x555555da6398: {length = 3, data = {0x7ffff4f4ca00, 0x7ffff4f4c730, 0x7ffff4f4c730, 0x7ffff4f4a350, 0x7ffff4f4a170,
0x7fffdbfa30c0, 0x7fffdbd3f1e0, 0x7fffdbfa3c10, 0x7ffff4f4db10, 0x7ffff4f4db60, 0x7ffff4f4db60, 0x7ffff4f4db10, 0x7fffdbd3e300, 0x7ffff4f4c910, 0x7fffdbd3e3f0, 0x7fffdbd3dd80, 0x7fffdbd3dd80,
0x7ffff4f4cf70, 0x7ffff3d4d420, 0x7fffdbd3dd80, 0x7ffff4f4d150, 0x7ffff4f4d360, 0x7ffff4f4d3c0, 0x7ffff4f4d3f0, 0x7fffdbd3dd80, 0x7ffff4f4d1b0, 0x7ffff4f4d230, 0x7ffff4f4d260, 0x7fffdc25a2f0,
0x7fffdc243570, 0x7fffdc243570, 0x7fffdc366260, 0x7fffdc366c20, 0x7fffdc6bd600, 0x7ffff4f77f40, 0x7ffff4f7c0a0, 0x7ffff4f82390, 0x7fffdc6bd680, 0x7fffdc243a20, 0x7fffdc25a2f0, 0x7ffff4f94860,
0x7fffdc243a20, 0x7fffdc482ff0, 0x7fffdc260500, 0x7fffdc482ff0, 0x7ffff4f94800, 0x7fffdc482ff0, 0x7ffff37973a0, 0x7fffdc243570, 0x7ffff4f94800, 0x7ffff4f96830, 0x7ffff4f96890, 0x7ffff4f968c0,
0x7fffdc243570, 0x7ffff4f963e0, 0x7ffff4f96460, 0x7ffff4f96490, 0x7ffff2c1a760, 0x7ffff2c1a7a0, 0x7ffff4f948c0, 0x7ffff283ff70, 0x7ffff283ff40, 0x7fffdc482ff0, 0x7ffff2c1a760, 0x7ffff2c1a7a0,
0x7ffff2c24140, 0x7ffff4f948c0, 0x7ffff283ff70, 0x7ffff2c27be0, 0x7ffff2c3a1a0, 0x7ffff4f949f0, 0x7ffff4f94a50, 0x7ffff2c3a5b0, 0x7ffff54223d0, 0x7ffff27ae960, 0x7ffff27aec70, 0x7ffff27aeda0,
0x7ffff54223d0, 0x7ffff4f94bc0, 0x7ffff4f94bf0, 0x7ffff27b6460, 0x7ffff2835f80, 0x7ffff27b6460, 0x7ffff2839790, 0x7ffff27aeda0, 0x7fffdc482ff0, 0x7ffff4f948c0, 0x7fffdc482ff0, 0x7ffff27e28e0,
0x7fffdc243570, 0x7ffff4f948c0, 0x7ffff4f96000, 0x7ffff4f96060, 0x7ffff4f96090, 0x7fffdc243570, 0x7ffff4f95bb0, 0x7ffff4f95c30, 0x7ffff4f95c60, 0x7ffff45a1d40, 0x7ffff4f84d80, 0x7fffec3f85b0,
0x7fffec3f85e0, 0x7fffec3f85b0, 0x7ffff4f84e70, 0x7ffff4f84f30, 0x7ffff45a1ef0, 0x7ffff4f84f30, 0x7fffec3f9180, 0x7fffec3f9150, 0x7fffec3f9120, 0x7ffff4f7aa90, 0x7fffec3c0680, 0x7ffff45a1d40,
0x7ffff4f7aa90, 0x7fffec3cc210, 0x7fffec3cc240, 0x7fffec3cc210, 0x7ffff4f7ab80, 0x7ffff4f7ac40, 0x7ffff45a1ef0, 0x7ffff4f7ac40, 0x7fffec3ccde0, 0x7fffec3ccdb0, 0x7fffec3ccd80,
0xffffffffffffffff <repeats 17 times>}, smallarray = {0x7ffff4e03e80}}
(gdb) where
#0 Array<Expression*>::operator[](unsigned long) (this=..., i=1722) at /home/andrey/dmd/dmd/compiler/src/dmd/root/array.d:269
#1 0x0000555555906f1b in CtfeStack::push(VarDeclaration*) (this=..., v=0x7fffdbbf7e90) at src/dmd/dinterpret.d:353
#2 0x000055555590cc25 in _D3dmd10dinterpret11Interpreter5visitMRCQBm10expression14DeclarationExpZ__T9__lambda6TCQDh7dsymbol7DsymbolZQBgMFQBaZi (__capture=0x7fffffff3210, s=0x7fffdbbf7e90)
at src/dmd/dinterpret.d:2316
#3 0x0000555555900346 in _D3dmd11declaration16TupleDeclaration10foreachVarMFMDFCQCb7dsymbol7DsymbolZiZi (this=0x7fffdbbf8c60, dg=...) at src/dmd/declaration.d:701
#4 0x000055555590c876 in Interpreter::visit(DeclarationExp*) (this=0x7fffffff3260, e=0x7fffdbbf4170) at src/dmd/dinterpret.d:2309
#5 0x000055555598862e in DeclarationExp::accept(Visitor*) (this=0x7fffdbbf4170, v=0x7fffffff3260) at src/dmd/expression.d:4112
#6 0x0000555555919f19 in _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCcQz10ExpressionPSQCvQCu10InterStateEQDoQDn8CTFEGoalZQCd (goal=<incomplete type>, istate=0x7fffffff3640,
e=0x7fffdbbf4170, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6526
#7 0x0000555555908930 in Interpreter::visit(ExpStatement*) (this=0x7fffffff3320, s=0x7fffdbbf4140) at src/dmd/dinterpret.d:816
#8 0x0000555555a3bb32 in ExpStatement::accept(Visitor*) (this=0x7fffdbbf4140, v=0x7fffffff3320) at src/dmd/statement.d:485
#9 0x000055555591a13c in _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCc9statement9StatementPSQDbQDa10InterStateZCQDvQCs10Expression (istate=0x7fffffff3640, s=0x7fffdbbf4140,
pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6591
#10 0x00005555559089f2 in Interpreter::visit(CompoundStatement*) (this=0x7fffffff3400, s=0x7fffdbbf3de0) at src/dmd/dinterpret.d:834
#11 0x0000555555a3c056 in CompoundStatement::accept(Visitor*) (this=0x7fffdbbf3de0, v=0x7fffffff3400) at src/dmd/statement.d:628
#12 0x000055555591a13c in _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCc9statement9StatementPSQDbQDa10InterStateZCQDvQCs10Expression (istate=0x7fffffff3640, s=0x7fffdbbf3de0,
pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6591
#13 0x00005555559089f2 in Interpreter::visit(CompoundStatement*) (this=0x7fffffff34e0, s=0x7fffdbbfd460) at src/dmd/dinterpret.d:834
#14 0x0000555555a3c056 in CompoundStatement::accept(Visitor*) (this=0x7fffdbbfd460, v=0x7fffffff34e0) at src/dmd/statement.d:628
#15 0x000055555591a13c in _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCc9statement9StatementPSQDbQDa10InterStateZCQDvQCs10Expression (istate=0x7fffffff3640, s=0x7fffdbbfd460,
pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6591
#16 0x00005555559082c0 in _D3dmd10dinterpret17interpretFunctionFPSQBm10expression8UnionExpCQCl4func15FuncDeclarationPSQDmQDl10InterStatePSQEg4root5array__T5ArrayTCQFfQDt10ExpressionZQBbQxZQBa (
thisarg=0x0, arguments=0x7fffdbbf6840, istate=0x0, fd=0x7fffdbbf3ad0, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:644
#17 0x0000555555914ff9 in Interpreter::visit(CallExp*) (this=0x7fffffff3990, e=0x7fffdbbf3a30) at src/dmd/dinterpret.d:4986
#18 0x000055555598ae46 in CallExp::accept(Visitor*) (this=0x7fffdbbf3a30, v=0x7fffffff3990) at src/dmd/expression.d:5169
#19 0x0000555555919f19 in _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCcQz10ExpressionPSQCvQCu10InterStateEQDoQDn8CTFEGoalZQCd (goal=<incomplete type>, istate=0x0, e=0x7fffdbbf3a30,
pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6526
#20 0x0000555555919f72 in _D3dmd10dinterpret9interpretFCQBc10expression10ExpressionPSQCfQCe10InterStateEQCyQCx8CTFEGoalZQCn (goal=<incomplete type>, istate=0x0, e=0x7fffdbbf3a30)
at src/dmd/dinterpret.d:6536
#21 0x000055555590620b in _D3dmd10dinterpret13ctfeInterpretFCQBh10expression10ExpressionZQBd (e=0x7fffdbbf3a30) at src/dmd/dinterpret.d:100
#22 0x00005555559821ed in Expression::ctfeInterpret() (this=0x7fffdbbf3a30) at src/dmd/expression.d:1619
#23 0x00005555559e005e in _D3dmd7initsem19initializerSemanticRCQBj4init11InitializerPSQCg6dscope5ScopeKCQCy5mtype4TypeEQDnQCe13NeedInterpretZ8visitExpMFCQEvQDm14ExpInitializerZQEk (
__capture=0x7fffffff3cc0, i=0x7fffdbbf3a00) at src/dmd/initsem.d:465
#24 0x00005555559de692 in initializerSemantic(Initializer*, Scope*, Type*&, NeedInterpret) (init=0x7fffdbbf3a00, sc=0x7fffdbbf6ef0, tx=@0x7fffdbbf3950: 0x7fffebb7d280, needInterpret=<incomplete type>)
at src/dmd/initsem.d:1058
#25 0x0000555555a335e9 in Semantic2Visitor::visit(VarDeclaration*) (this=0x7fffffff3d60, vd=0x7fffdbbf38f0) at src/dmd/semantic2.d:259
#26 0x0000555555902766 in VarDeclaration::accept(Visitor*) (this=0x7fffdbbf38f0, v=0x7fffffff3d60) at src/dmd/declaration.d:1703
#27 0x0000555555a32e7e in semantic2(Dsymbol*, Scope*) (dsym=0x7fffdbbf38f0, sc=0x7fffdbbf6ef0) at src/dmd/semantic2.d:79
#28 0x0000555555a332d1 in Semantic2Visitor::visit(TemplateInstance*) (this=0x7fffffff3e40, tempinst=0x7fffdbf35f00) at src/dmd/semantic2.d:173
#29 0x000055555596c19e in TemplateInstance::accept(Visitor*) (this=0x7fffdbf35f00, v=0x7fffffff3e40) at src/dmd/dtemplate.d:7518
#30 0x0000555555a32e7e in semantic2(Dsymbol*, Scope*) (dsym=0x7fffdbf35f00, sc=0x7fffdbbe4a70) at src/dmd/semantic2.d:79
#31 0x0000555555957095 in _D3dmd10dsymbolsem24templateInstanceSemanticFCQBs9dtemplate16TemplateInstancePSQCz6dscope5ScopePSQDr4root5array__T5ArrayTCQEq10expression10ExpressionZQBkZv (fargs=0x0,
(gdb)
#32 0x000055555594c3b7 in DsymbolSemanticVisitor::visit(TemplateInstance*) (this=0x7fffffff41e0, ti=0x7fffdbf35f00) at src/dmd/dsymbolsem.d:2639
#33 0x000055555596c19e in TemplateInstance::accept(Visitor*) (this=0x7fffdbf35f00, v=0x7fffffff41e0) at src/dmd/dtemplate.d:7518
#34 0x0000555555944396 in dsymbolSemantic(Dsymbol*, Scope*) (dsym=0x7fffdbf35f00, sc=0x7fffdbf3e310) at src/dmd/dsymbolsem.d:130
#35 0x0000555555a661dc in _D3dmd7typesem7resolveFCQw5mtype4TypeKxSQBm7globals3LocPSQCd6dscope5ScopeJCQCv10expression10ExpressionJQDcJCQEc7dsymbol7DsymbolbZ13visitInstanceMFCQFpQEu12TypeInstanceZv (
__capture=0x7fffffff4280, mt=0x7fffdbf35e80) at src/dmd/typesem.d:2799
#36 0x0000555555a65785 in _D3dmd7typesem7resolveFCQw5mtype4TypeKxSQBm7globals3LocPSQCd6dscope5ScopeJCQCv10expression10ExpressionJQDcJCQEc7dsymbol7DsymbolbZv (intypeid=false, ps=@0x7fffffff42e0: 0x0,
pt=@0x7fffffff42d0: 0x0, pe=@0x7fffffff42d8: 0x0, sc=0x7fffdbf3e310, loc=..., mt=0x7fffdbf35e80) at src/dmd/typesem.d:3169
#37 0x000055555596986e in _D3dmd9dtemplate16TemplateInstance14semanticTiargsFKxSQCa7globals3LocPSQCr6dscope5ScopePSQDj4root5array__T5ArrayTCQEiQz10rootobject10RootObjectZQBmiCQFr11declaration16TupleDeclarationZb (atd=0x0, flags=0, tiargs=0x7fffdbf35dd0, sc=0x7fffdbf3e310, loc=...) at src/dmd/dtemplate.d:6599
#38 0x000055555596a0b0 in _D3dmd9dtemplate16TemplateInstance14semanticTiargsMFPSQCa6dscope5ScopeZb (this=0x7fffdbf362c0, sc=0x7fffdbf3e310) at src/dmd/dtemplate.d:6851
#39 0x00005555559bc57b in _D3dmd13expressionsem9semanticYFCQBf10expression22DotTemplateInstanceExpPSQCu6dscope5ScopeiZCQDnQCi10Expression (flag=1, sc=0x7fffdbf3e310, exp=0x7fffdbf35d60)