Skip to content

Attaching Final Skims Fails for Large Files #308

@bricegnichols

Description

@bricegnichols

When running DaySim in estimation mode to attach final skims to daysim outputs, some files crash in Reader.cs. This particularly happens when large files like full simulation daysim data like trips are loaded. The point of failure is here, where the length of the file being imported is converted to an integer: https://github.com/RSGInc/DaySim/blob/master/DaySim.Framework/Persistence/Reader.cs#L41

For large files this causes an overflow of the integer, resulting in a negative value which fails to create a proper index. We've found that the following correction of line 41 will avoid this issue by converting the value to an integer only after dividing the file length by the file's size value:

_count = (int)(file.Length / _size);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions