Bug 21085 – [glue] Only 9999 "hidden identifiers" can be generated

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2020-07-28T10:45:25Z
Last change time
2020-08-10T12:09:38Z
Keywords
pull
Assigned to
No Owner
Creator
Stefan Koch

Attachments

IDFilenameSummaryContent-TypeSize
1801bug.dcode to reproduce the bug.application/x-dsrc11029

Comments

Comment #0 by uplink.coder — 2020-07-28T10:45:25Z
Created attachment 1801 code to reproduce the bug. To reproduce this bug you need to dmd with ldc. After that try to compile bug.d with the freshly build dmd. It should segfault, if it does not try again. The reason it segfaults is that too many hidden identifiers get generated and there is a stackoverflow.
Comment #1 by dlang-bot — 2020-07-28T10:47:40Z
@UplinkCoder updated dlang/dmd pull request #11469 "[critical bugfix] Increase size for temporary HID identifier" fixing this issue: - Fix Issue 21085 - Increase size for temporary HID identifier For hidden parameters, a unique identifier is generated within the backend of the form __HID%d. For that string "__HID".length + 4 + "\0".length bytes were allocated, Making 9999 hidden parameters the highest number which could be used. This change removes the assumption that there can be only 9999 hidden parameters. And extends the buffer to the maximal number of 10 digits which is the maxmal number that can be represented with a 32bit unsinged integer. https://github.com/dlang/dmd/pull/11469
Comment #2 by dlang-bot — 2020-07-28T12:31:22Z
dlang/dmd pull request #11469 "[critical bugfix] Increase size for temporary HID identifier" was merged into stable: - b0b774c999e07aa6b005f2d17eab7c048cd07c94 by Stefan Koch: Fix Issue 21085 - Increase size for temporary HID identifier For hidden parameters, a unique identifier is generated within the backend of the form __HID%d. For that string "__HID".length + 4 + "\0".length bytes were allocated, Making 9999 hidden parameters the highest number which could be used. This change removes the assumption that there can be only 9999 hidden parameters. And extends the buffer to the maximal number of 10 digits which is the maxmal number that can be represented with a 32bit unsinged integer. https://github.com/dlang/dmd/pull/11469
Comment #3 by dlang-bot — 2020-08-10T12:09:38Z
dlang/dmd pull request #11542 "merge stable" was merged into master: - 50dfa0de2f24996dbdb748ef9a4cd1eb97f463ac by Stefan Koch: Fix Issue 21085 - Increase size for temporary HID identifier For hidden parameters, a unique identifier is generated within the backend of the form __HID%d. For that string "__HID".length + 4 + "\0".length bytes were allocated, Making 9999 hidden parameters the highest number which could be used. This change removes the assumption that there can be only 9999 hidden parameters. And extends the buffer to the maximal number of 10 digits which is the maxmal number that can be represented with a 32bit unsinged integer. https://github.com/dlang/dmd/pull/11542