Repository navigation
A list group overlay throws on an entry that is not a group - #717
Open
WhiskyTangoFawks wants to merge 3 commits into
Open
WhiskyTangoFawks wants to merge 3 commits into
WhiskyTangoFawks wants to merge 3 commits into
Conversation
GroupListOverlay.Factory read every entry of a list group (CELL, and each game's equivalent) as a group header and stepped by its length. A record in that place was read as a group, stepped by its content length, and once a length read 0 the position stopped moving, so the location list grew until the process ran out of memory. A group whose length is shorter than its header stalled the same way. It now throws a RecordException naming the record type, as the overlay of an ordinary group does, and a MalformedDataException for a group too short to hold its header. Every caller passed ObjectType.Group, so the parameter goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test moves to Core, beside the parse it covers, and runs for Oblivion, Fallout 3, Skyrim, Fallout 4 and Starfield. Each builds the list group with MutagenWriter and HeaderExport from that game's GameConstants, and takes its ModKey from AutoData, in place of the hand-written Fallout 4 plugin bytes. The parse runs under a 30 second bound, so a parse that stops advancing fails the test instead of hanging the suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WhiskyTangoFawks
force-pushed
the
fix/list-group-stray-record
branch
from
October 24, 2026 14:56
6b218d6 to
d198e53
Compare
Noggog
requested changes
Oct 30, 2026
Noggog
left a comment
Member
There was a problem hiding this comment.
steps by group length with no progress check, so a zero-length sub-block group can still stall there
Would be good to handle while we're "in the area". But if you want to do as separate PR, that's up to you
| { | ||
| var majorMeta = package.MetaData.Constants.MajorRecordHeader(stream.RemainingMemory); | ||
| var formKey = FormKey.Factory(package.MetaData.MasterReferences, majorMeta.FormID, reference: false); | ||
| throw new RecordException(formKey: formKey, recordType: null, modKey: package.MetaData.ModKey, edid: null, message: "Unexpected type encountered when parsing group locations: " + majorMeta.RecordType); |
Member
There was a problem hiding this comment.
ModGroupsMalformedException seems more appropriate here?
Both list group throws, a record where a group belongs and a group shorter than its header, now throw ModGroupsMalformedException naming the mod, as review asked. The record's type and FormKey move into the message. ParseRecordLocations, which a cell or worldspace block overlay uses to find its sub-blocks, stepped by a group's length with no progress check. A sub-block group shorter than its header stepped by 0 and grew its location list until out of memory. It now throws the same exception. Not run red: the old code does not fail these tests, it loops until out of memory, and the change is built and tested by CI rather than locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Switched both list group throws to |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GroupListOverlay<T>.Factoryreads each entry of a list group (CELL, and each game's equivalent) as a group header. A major record in that position was read as a group and stepped by its content length. Once a length read 0, the loop stopped advancing and its location list grew untilOutOfMemoryException, after about 80 s on Fallout 4.It now throws a
ModGroupsMalformedExceptionnaming the mod, with the record's type and FormKey in the message, and the same exception for a group shorter than its header. TheobjectTypeparameter is removed, since every caller passedObjectType.Group.PluginBinaryOverlay.ParseRecordLocations, which a cell or worldspace block overlay uses to find its sub-blocks, stepped by group length with no progress check, so a sub-block shorter than its header stalled the same way. It now throws the same exception. Only a group can trip the check, since a subrecord's or major record's total length always includes its header.ListGroupOverlayTestsbuilds the bytes from each game'sGameConstants, for Oblivion, Fallout 3, Skyrim, Fallout 4 and Starfield. A stray record or a group shorter than its header in a list group, and a sub-block shorter than its header, all throw; an empty cell block still reads as one block. On the old code the throwing cases hang until out of memory rather than failing.Left as they are:
Cell.ParseRecordLocationssteps over a cell's children groups by length with no progress check, so a children group shorter than its header can still stall there.