Open bricegnichols opened 3 years ago
In the Copenhagen version, I changed some id fields to 16 byte integers, which should also solve the problem. Will also do that for the main version.
Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Brice Nichols @.> Sent: Thursday, October 7, 2021 3:50:58 PM To: RSGInc/DaySim @.> Cc: Subscribed @.***> Subject: [RSGInc/DaySim] Attaching Final Skims Fails for Large Files (#308)
CAUTION - EXTERNAL EMAIL
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);
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/RSGInc/DaySim/issues/308, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADWCYPB4PPQWEHFDDGZ6673UFYP5FANCNFSM5FSKU63Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
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);