Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressing folders that are several gigabytes in size may result in an Arithmetic Overflow at the end #7

Closed
Iridium-IO opened this issue Oct 14, 2017 · 1 comment

Comments

@Iridium-IO
Copy link
Member

I've probably used a signed integer somewhere I shouldn't :/

  • Compression will complete without issue. This is a purely cosmetic bug
  • Compression overview will not show because of the error.
System.OverflowException: Arithmetic operation resulted in an overflow.
   at CompactGUI.Compact.CalculateSaving() in \Compact.vb:line 465
   at CompactGUI.Compact.ProgressTimer_Tick(Object sender, EventArgs e) in \Compact.vb:line 179
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
1938 files within 177 directories were compressed.
13,295,326,334 total bytes of data are stored in 12,246,654,104 bytes.
The compression ratio is 1.1 to 1.
@Iridium-IO
Copy link
Member Author

Iridium-IO commented Oct 15, 2017

Found the error:
Dim querysize = 0 was a signed integer, so it overflowed if it tried to read a file size greater than ~2GB.
It's been fixed by changing it to a 64-bit integer:

Dim querysize As Int64 = 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant