-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: 32bit build fails #390
Conversation
config.go
Outdated
if size > maxAllocSize || size <= 0 { | ||
return maxAllocSize | ||
if int64(size) > maxAllocSize || size <= 0 { | ||
return int(maxAllocSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this not overflow on a 32bit system? Perhaps the entire function needs to return an int64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, if I change that to be an int64
we end up with an issue in codec_array.go
because sliceType.UnsafeGrow
accepts an int
and not an int64
. Which means we'd just be pushing the overflow to that spot instead.
Maybe we need to change the maxAllocSize
to a different value for 32-bit systems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems reasonable. I am a little surprised the actual value is not different between these systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this with my most recent commit. Let me know what you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏🏻 Thanks for the contribution
Thanks @nrwiersma! Please let me know when this will go out with a new version release so I can update the dependency in the Apache Arrow repo :) |
@zeroshade I just bumped the version to v2.21.1. |
The Apache Arrow project uses this library for supporting reading Avro into Apache Arrow record batches. A dependabot alert to update to a new version fails building in the CI due to usage of
int(1 << 48)
which fails on the cross-build CI for 32-bit systems link.If we explicitly type it as an
int64
this alleviates the problem and allows this library to continue to successfully build on 32-bit systems.