Repository navigation
DXF: read up to 100 million group codes, or a set limit, without running out of memory silently (#1976) - #2683
Conversation
…_DXF_TAGS to override it (#1948)
… be refused The tag list for a counted ASCII file is reserved once with a fallible allocation, so where the system refuses the memory, opening fails with an error instead of ending the app. Growing it would also take half as much again for a moment. 100 million rather than 150 bounds a crafted 512 MB file to about 4 GB of tags; CADCRAFT_MAX_DXF_TAGS raises it, and the error says so.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Builds on #1976 by @MrBeeboh and keeps those commits: the
CADCRAFT_MAX_DXF_TAGSoverride, and a higher default.What changed from #1976, after the memory objection that review raised:
DxfError::OutOfMemoryinstead of the end of the app. Where the system enforces a commit limit, as Windows does, running out of memory for that list is now an error. Reserving once also avoids a vector doubling briefly taking half as much again. String values are still allocated as they are read, and Linux overcommit can still end the process later, so this narrows the risk rather than removing it.CADCRAFT_MAX_DXF_TAGS.Since #2673, converting a DWG's text happens in a separate worker process. Parsing that text into a drawing still happens in the app, which is why its limit matters.
Fixes #1948
Fixes #1465
Summary by CodeRabbit
CADCRAFT_MAX_DXF_TAGSsetting.