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

Compiling for 32 bit #953

Closed
davidsteed opened this issue Jul 31, 2019 · 3 comments · Fixed by #961
Closed

Compiling for 32 bit #953

davidsteed opened this issue Jul 31, 2019 · 3 comments · Fixed by #961

Comments

@davidsteed
Copy link

What version of Go are you using (go version)?1.12.5

$ go version

What version of Badger are you using?latest

Does this issue reproduce with the latest master?yes

What are the hardware specifications of the machine (RAM, OS, Disk)?N/A

What did you do?Compile 32 bit

What did you expect to see?

What did you see instead?

./../github.com/dgraph-io/badger/table/builder.go:134:27: constant 4294967295 overflows int
../../github.com/dgraph-io/badger/table/builder.go:186:47: constant 4294967295 overflows int
../../github.com/dgraph-io/badger/table/builder.go:204:28: constant 4294967295 overflows int
../../github.com/dgraph-io/badger/table/builder.go:272:17: constant 4294967295 overflows int
../../github.com/dgraph-io/badger/table/builder.go:304:17: constant 4294967295 overflows int

In builder.go everywhere it has math.MaxUint32 I think it should be math.MaxInt32.

I made this change locally and all is OK

martinmr added a commit that referenced this issue Aug 2, 2019
GOARCH=386 go build ./ passes with this change and fails without it due
to integer overflow.

Fixes #953
martinmr added a commit that referenced this issue Aug 6, 2019
GOARCH=386 go build ./ passes with this change and fails without it due
to integer overflow.

Fixes #953
jarifibrahim pushed a commit that referenced this issue Aug 9, 2019
GOARCH=386 go build ./ passes with this change and fails without it due
to integer overflow.

Fixes #953
@unknwon
Copy link

unknwon commented Nov 10, 2019

I'm seeing this error again with v2.0.0-rc4:

env GOOS=linux GOARCH=386 go build
# github.com/dgraph-io/badger/v2/table
../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:435:19: constant 4294967295 overflows int

env GOOS=linux GOARCH=arm go build
# github.com/dgraph-io/badger/v2/table
../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:435:19: constant 4294967295 overflows int

env GOOS=windows GOARCH=386 go build
# github.com/dgraph-io/badger/v2/table
../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:435:19: constant 4294967295 overflows int

@jarifibrahim
Copy link
Contributor

@unknwon I've raised a PR to fix this #1118

@unknwon
Copy link

unknwon commented Nov 14, 2019

Thanks @jarifibrahim!

jarifibrahim pushed a commit that referenced this issue Nov 20, 2019
`env GOOS=linux GOARCH=386` go build no longer complains about integer overflow.

See #953 (comment)
jarifibrahim pushed a commit that referenced this issue Mar 12, 2020
GOARCH=386 go build ./ passes with this change and fails without it due
to integer overflow.

Fixes #953

(cherry picked from commit 8783134)
manishrjain pushed a commit to outcaste-io/outserv that referenced this issue Jul 6, 2022
`env GOOS=linux GOARCH=386` go build no longer complains about integer overflow.

See dgraph-io/badger#953 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants