Ensure 32-bit Git LFS binaries can handle files larger than 4 GiB #3426
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.
When parsing pointers, we parsed the size of the object using ParseInt with a third argument of 0. This caused the argument to be parsed as an int, which on 32-bit systems is 32 bits in size. Consequently, when we had an object larger than 4 GiB in size on a 32-bit system, we would reject the pointer file as invalid and never realize the object needed to be pushed, leading to the server side rejecting our pushes due to missing objects.
Set the size of the integer we're parsing to 64 bits to ensure that we can always parse a pointer correctly. With this change, we can handle files larger than 4 GiB on 32-bit binaries.
I have opted not to add a test to this case because the processing time to hash a 4 GiB file is significant and the test would be fairly slow, but if people feel strongly that we should add one anyway, I can do that. Note that this would likely not affect CI, because I believe all of those systems are 64 bit.