Bug 23876 – segfault / ICE regression with packages

Status
NEW
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2023-05-02T13:05:39Z
Last change time
2024-12-07T13:42:38Z
Assigned to
No Owner
Creator
Jan Jurzitza
Moved to GitHub: dmd#17460 →

Comments

Comment #0 by d.bugs — 2023-05-02T13:05:39Z
reproduction test case: reduced.d ```d void onInvalidType() { import mystd.meta; import mystd.range; } ``` mystd/meta.d ```d import mystd.range.primitives ; ``` mystd/range/package.d ```d import mystd.range; ``` mystd/range/primitives.d ```d // file is empty ``` dmd -c reduced.d
Comment #1 by d.bugs — 2023-05-02T13:06:24Z
smaller reduced.d: ```d import mystd.meta; import mystd.range; ```
Comment #2 by razvan.nitu1305 — 2023-05-04T13:47:53Z
This seems to be a gc bug caused by the compiler implementation code. When the compiler parses the import declarations, to be more precise, the chain of packages separated by dots it needs to concatenate the identifiers to an array. That concatenation calls the _d_arrayappend hook, which currently is not templated which calls some conservative gc methods. The failure is somewhere in the innards of those functions, but up until this point I haven't been able to precisely pinpoint it. Changing to druntime bug.
Comment #3 by robert.schadek — 2024-12-07T13:42:38Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17460 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB