Bug 24144 – [REG2.105] Silent file name index overflow
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-09-13T12:27:07Z
Last change time
2023-09-16T07:31:20Z
Keywords
industry, pull
Assigned to
No Owner
Creator
kinke
Comments
Comment #0 by kinke — 2023-09-13T12:27:07Z
Since D v2.105, the compiler's `Loc` struct only supports up to 64K file names. At work, we hit a wild issue while compiling a (private) dub package (about 50 .d modules) - the overflow was so bad that it affected the .a library output file name. Instead of generating some `.a` file specified with `-of`, the compiler emitted the library as file `~/.dub/packages/symmetry_thrift_d/1.0.8/symmetry_thrift_d/src/thrift/internal/codegen.d-mixin-73`, without any error or warning (there's an assertion in https://github.com/dlang/dmd/blob/v2.105.1/compiler/src/dmd/location.d#L118, but not part of release builds...). The linker command then later failed.
So I'm guessing lots of mixins lead to lots of virtual file names, so that exceeding 64K file names isn't that difficult.
Comment #1 by dlang-bot — 2023-09-13T14:29:02Z
@kinke created dlang/dmd pull request #15604 "[stable] Fix Issue 24144 - [REG2.105] Silent file name index overflow" fixing this issue:
- Fix Issue 24144 - [REG2.105] Silent file name index overflow
* Print an ICE message for Loc.filename overflows
* Increase the Loc size again, raising the file name limit from 64K
to 4G but keeping the index indirection from #15199. The `Loc`
size for DMD-as-a-library is 16 bytes then, and 12 bytes otherwise.
https://github.com/dlang/dmd/pull/15604
Comment #2 by dlang-bot — 2023-09-14T11:39:57Z
dlang/dmd pull request #15604 "[stable] Fix Issue 24144 - [REG2.105] Silent file name index overflow" was merged into stable:
- bbf1e551d0eddaf75f425aec6d748c1bf6ddc2aa by Martin Kinkelin:
Fix Issue 24144 - [REG2.105] Silent file name index overflow
* Print an ICE message for Loc.filename overflows
* Increase the Loc size again, raising the file name limit from 64K
to 4G but keeping the index indirection from #15199. The `Loc`
size for DMD-as-a-library is 16 bytes then, and 12 bytes otherwise.
https://github.com/dlang/dmd/pull/15604
Comment #3 by dlang-bot — 2023-09-16T07:31:20Z
dlang/dmd pull request #15609 "merge stable" was merged into master:
- 13da64b0c11d804bc4a5a0d6c0f1d311890e1510 by Martin Kinkelin:
Fix Issue 24144 - [REG2.105] Silent file name index overflow (#15604)
* Print an ICE message for Loc.filename overflows
* Increase the Loc size again, raising the file name limit from 64K
to 4G but keeping the index indirection from #15199. The `Loc`
size for DMD-as-a-library is 16 bytes then, and 12 bytes otherwise.
https://github.com/dlang/dmd/pull/15609