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

Fix integer overflow error when building for 386 #1541

Merged
merged 6 commits into from
Oct 2, 2020
Merged

Fix integer overflow error when building for 386 #1541

merged 6 commits into from
Oct 2, 2020

Conversation

gammazero
Copy link
Contributor

@gammazero gammazero commented Sep 24, 2020

The untyped const causes conversion to int, for which the value is too large.
Use a typed const instead that is large enough to store value.


This change is Reviewable

The untyped const causes conversion to int, for which the value is too large.  Use a typed const instead that is large enough to store value.
@CLAassistant
Copy link

CLAassistant commented Sep 24, 2020

CLA assistant check
All committers have signed the CLA.

badger/cmd/backup.go Outdated Show resolved Hide resolved
badger/cmd/restore.go Outdated Show resolved Hide resolved
value.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gammazero 🎉 . This might fix the build but we've seen other cannot allocate memory errors on 386. We can handle those in a separate PR.

@NamanJain8 review please.

value.go Outdated Show resolved Hide resolved
@jarifibrahim
Copy link
Contributor

Thanks for helping with the review @damz :)

Copy link
Contributor

@NamanJain8 NamanJain8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks, @gammazero.

@NamanJain8
Copy link
Contributor

Not directly related to the PR itself, @jarifibrahim I was wondering about the use of int64 for ValueLogFileSize and uint32 for maxVlogFileSize. Maybe we need to revisit the types assigned to these.

Co-authored-by: Ibrahim Jarif <[email protected]>
@gammazero
Copy link
Contributor Author

The DeepSource and the travis-ci build failures are not related to this PR, and can/should be fixed in a separate PR.

@jarifibrahim jarifibrahim merged commit 68fb85d into hypermodeinc:master Oct 2, 2020
@jarifibrahim
Copy link
Contributor

Thanks for fixing this @gammazero

jarifibrahim pushed a commit that referenced this pull request Oct 2, 2020
The untyped const causes conversion to int, for which the value is too large.
Use a typed const instead that is large enough to store value.
@gammazero gammazero deleted the build386 branch October 4, 2020 18:27
@jsoriano
Copy link

jsoriano commented Oct 7, 2020

Hi, will this fix be backported to v2.2007?

@jsoriano
Copy link

jsoriano commented Oct 7, 2020

Hi, will this fix be backported to v2.2007?

I have created #1558 to fix this issue in v2.2007.

jarifibrahim pushed a commit that referenced this pull request Oct 12, 2020
The untyped const causes conversion to int, for which the value is too large.
Use a typed const instead that is large enough to store value.

Similar to #1541, but for v2.2007 branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants