Skip to content

Exception loading an older model file with no strings  #1289

Closed

Description

@eerhardt

When I changed our model format for the ComponentCatalog changes (#970), I refactored some model loading code incorrectly. There are some existing models that are breaking our validation checks:

The old code was doing:

if (header.FpStringTable == 0)
{
// No strings.
strings = null;
ex = null;
return true;

The new code now does:

if (header.FpStringTable == 0)
{
// No strings.
strings = null;
}

Notice that it doesn't return early in the new code. Lower in the method there are checks here:

Contracts.CheckDecode(header.FpTail == reader.FpCur() - fpMin);
ulong tail = reader.ReadUInt64();
Contracts.CheckDecode(tail == TailSignatureValue, "Corrupt model file tail");

These checks are now failing with older model files. They were never run in the old code when there were no strings, so we shouldn't be running them anymore when reading older model files.

/cc @yaeldekel

Activity

  1. self-assigned this
    on Oct 17, 2018
  2. added 2 commits that reference this issue on Oct 17, 2018
    3fe66fb
    d5407f7
  3. added this to the 1018 milestone on Oct 18, 2018
  4. added a commit that references this issue on Oct 18, 2018
    14dadfe
  5. ghost locked as resolved and limited conversation to collaborators on Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions