Bug 24188 – ICE (Illegal instruction) with missing imported symbol
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-10-14T17:03:23Z
Last change time
2023-11-01T22:39:27Z
Keywords
pull
Assigned to
No Owner
Creator
John Colvin
Comments
Comment #0 by john.loughran.colvin — 2023-10-14T17:03:23Z
dev@dev:~/testCrash$ . ~/dlang/dmd-2.105.2/activate
dev@dev:~/testCrash$ tree
.
├── a
│ └── c.d
└── test.d
1 directory, 2 files
(dmd-2.105.2)dev@dev:~/testCrash$ cat test.d
auto b() {
import a.c : D;
struct A {
D e;
}
}
(dmd-2.105.2)dev@dev:~/testCrash$ cat a/c.d
(dmd-2.105.2)dev@dev:~/testCrash$ dmd a/c.d test.d
test.d(2): Error: module `c` from file a/c.d must be imported with 'import c;'
test.d(2): Error: size of type `D` is not known
test.d(2): Error: size of type `D` is not known
Illegal instruction
Comment #1 by destructionator — 2023-10-14T18:14:55Z
Regression introduced some time after v2.098.0, works fine in that version.
More details off dmd master trying the bug:
test.d(2): Error: module `c` from file a/c.d must be imported with 'import c;'
test.d(2): Error: size of type `D` is not known
---
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the reduction.
---
DMD v2.101.0-beta.1-1152-gcb2010dc6c
predefs DigitalMars LittleEndian D_Version2 all D_SIMD Posix ELFv1 linux CRuntime_Glibc CppRuntime_Gcc D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC assert D_PreConditions D_PostConditions D_Invariants D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binary /home/me/d/pull-request-stuff/dmd/generated/linux/release/64/dmd
version v2.101.0-beta.1-1152-gcb2010dc6c
config /home/me/d/pull-request-stuff/dmd/generated/linux/release/64/dmd.conf
DFLAGS -I/home/me/d/pull-request-stuff/dmd/generated/linux/release/64/../../../../druntime/import -I/home/me/d/pull-request-stuff/dmd/generated/linux/release/64/../../../../../phobos -L-L/home/me/d/pull-request-stuff/dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64 -L--export-dynamic -fPIC
---
core.exception.AssertError@src/dmd/declaration.d(1286): Assertion failure
----------------
??:? _d_assertp [0x9ad2f0]
src/dmd/declaration.d:1286 _ZN14VarDeclaration14setFieldOffsetEP20AggregateDeclarationR10FieldStateb [0x6acfed]
src/dmd/dstruct.d:309 _ZN17StructDeclaration12finalizeSizeEv [0x6ec591]
src/dmd/aggregate.d:236 _ZN20AggregateDeclaration13determineSizeERK3Loc [0x6667b1]
src/dmd/semantic2.d:643 _ZN16Semantic2Visitor5visitEP20AggregateDeclaration [0x7f133a]
src/dmd/parsetimevisitor.d:88 _ZN16ParseTimeVisitorI10ASTCodegenE5visitEP17StructDeclaration [0x7ebf49]
src/dmd/dstruct.d:503 _ZN17StructDeclaration6acceptEP7Visitor [0x6ecb91]
src/dmd/semantic2.d:79 _Z9semantic2P7DsymbolP5Scope [0x7ef96d]
src/dmd/expressionsem.d:5683 _ZN25ExpressionSemanticVisitor5visitEP14DeclarationExp [0x759f73]
src/dmd/expression.d:4186 _ZN14DeclarationExp6acceptEP7Visitor [0x73d2b5]
src/dmd/expressionsem.d:12924 _Z18expressionSemanticP10ExpressionP5Scope [0x771c97]
src/dmd/statementsem.d:199 void dmd.statementsem.statementSemanticVisit(dmd.statement.Statement, dmd.dscope.Scope*).visitExp(dmd.statement.ExpStatement) [0x7fc903]
src/dmd/statement.d:1888 void dmd.statementsem.statementSemanticVisit(dmd.statement.Statement, dmd.dscope.Scope*).visit.VisitStatement(dmd.statement.Statement) [0x80a1cb]
src/dmd/statementsem.d:3735 dmd.statement.Statement dmd.statementsem.statementSemanticVisit(dmd.statement.Statement, dmd.dscope.Scope*) [0x7fc80f]
src/dmd/statementsem.d:148 _Z17statementSemanticP9StatementP5Scope [0x7fc7e4]
src/dmd/statementsem.d:266 void dmd.statementsem.statementSemanticVisit(dmd.statement.Statement, dmd.dscope.Scope*).visitCompound(dmd.statement.CompoundStatement) [0x7fcbca]
src/dmd/statement.d:1888 void dmd.statementsem.statementSemanticVisit(dmd.statement.Statement, dmd.dscope.Scope*).visit.VisitStatement(dmd.statement.Statement) [0x80a1f0]
src/dmd/statementsem.d:3735 dmd.statement.Statement dmd.statementsem.statementSemanticVisit(dmd.statement.Statement, dmd.dscope.Scope*) [0x7fc80f]
src/dmd/statementsem.d:148 _Z17statementSemanticP9StatementP5Scope [0x7fc7e4]
src/dmd/semantic3.d:598 _ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x7f37f3]
src/dmd/func.d:2995 _ZN15FuncDeclaration6acceptEP7Visitor [0x77e155]
src/dmd/semantic3.d:83 _Z9semantic3P7DsymbolP5Scope [0x7f1f11]
src/dmd/semantic3.d:205 _ZN16Semantic3Visitor5visitEP6Module [0x7f23d0]
src/dmd/dmodule.d:1278 _ZN6Module6acceptEP7Visitor [0x6d44dd]
src/dmd/semantic3.d:83 _Z9semantic3P7DsymbolP5Scope [0x7f1f11]
src/dmd/main.d:508 int dmd.main.tryMain(ulong, const(char)**, ref dmd.globals.Param) [0x660e62]
src/dmd/main.d:133 _Dmain [0x65ff04]
Comment #2 by destructionator — 2023-10-14T18:26:18Z
Tagging regression. It works in 2.098.
Works in b2a24bb959d521d367d9b26b6a67683a3ce480d1
broken in 997b00bf45eb4ad2cd97c6cb872308e9797bcf0a
Appearntly introduced by 997b00bf45eb4ad2cd97c6cb872308e9797bcf0a.
Comment #3 by dlang-bot — 2023-10-15T22:59:12Z
@SixthDot created dlang/dmd pull request #15693 "fix issue 24188 - ICE with missing imported symbol" fixing this issue:
- fix issue 24188 - ICE with missing imported symbol
The aliases created for the selections of an import were not invalidated
https://github.com/dlang/dmd/pull/15693
Comment #4 by dlang-bot — 2023-10-16T00:20:25Z
dlang/dmd pull request #15693 "fix issue 24188 - ICE with missing imported symbol" was merged into stable:
- c4b43a26886b224020d785b47cc52f61b04cabee by Basile Burg:
fix issue 24188 - ICE with missing imported symbol
The aliases created for the selections of an import were not invalidated
https://github.com/dlang/dmd/pull/15693
Comment #5 by dlang-bot — 2023-11-01T22:39:27Z
dlang/dmd pull request #15771 "merge stable" was merged into master:
- c738088800a2ef2262b60a165ae00025d89daa41 by SixthDot:
fix issue 24188 - ICE with missing imported symbol (#15693)
The aliases created for the selections of an import were not invalidated
https://github.com/dlang/dmd/pull/15771