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

uintptr test fails on armhf #99

Closed
sergiodj opened this issue Jul 7, 2021 · 1 comment · Fixed by #100
Closed

uintptr test fails on armhf #99

sergiodj opened this issue Jul 7, 2021 · 1 comment · Fixed by #100

Comments

@sergiodj
Copy link

sergiodj commented Jul 7, 2021

Hi,

The latest release introduced a new test for uintptr (05e06dc). This test is now failing on armhf with:

github.com/uber-go/atomic/internal/gen-atomicint
	cd obj-arm-linux-gnueabihf && go test -vet=off -v -p 4 github.com/uber-go/atomic github.com/uber-go/atomic/internal/gen-atomicint github.com/uber-go/atomic/internal/gen-atomicwrapper
# github.com/uber-go/atomic [github.com/uber-go/atomic.test]
src/github.com/uber-go/atomic/uintptr_test.go:72:29: constant 18446744073709551615 overflows uintptr

If you want to see the full log, you can check this URL:

https://autopkgtest.ubuntu.com/results/autopkgtest-impish/impish/armhf/g/golang-github-uber-go-atomic/20210707_150811_90a21@/log.gz

@sergiodj
Copy link
Author

sergiodj commented Jul 7, 2021

Just a note: this is on Ubuntu Impish (the development version), using Golang 1.16.

sergiodj pushed a commit to sergiodj/atomic that referenced this issue Jul 7, 2021
The new uintptr test is failing on 32-bit architectures (like armhf)
because of:

  src/github.com/uber-go/atomic/uintptr_test.go:72:29: constant 18446744073709551615 overflows uintptr

This is known problem and the workaround is to cast the math.MaxUint64
constant to "uint64".

Closes uber-go#99

Signed-off-by: Sergio Durigan Junior <sergiodj@debian.org>
prashantv added a commit that referenced this issue Jul 9, 2021
Fixes #99

The current uintptr test assumes that pointers are 64-bit, so the test
fails to compile on architectures with 32-bit pointers. Instead, cast
-1 to uintptr, which matches math.MaxUint64 on 64-bit architectures, and
math.MaxUint32 on 32-bit architectures.

Verified by using GOARCH=386
prashantv added a commit that referenced this issue Jul 9, 2021
Fixes #99

The current uintptr test assumes that pointers are 64-bit, so the test
fails to compile on architectures with 32-bit pointers. Instead, cast
-1 to uintptr, which matches math.MaxUint64 on 64-bit architectures, and
math.MaxUint32 on 32-bit architectures.

Verified by using GOARCH=386
prashantv added a commit that referenced this issue Jul 9, 2021
Fixes #99

The current uintptr test assumes that pointers are 64-bit, so the test
fails to compile on architectures with 32-bit pointers. Instead, cast
-1 to uintptr, which matches math.MaxUint64 on 64-bit architectures, and
math.MaxUint32 on 32-bit architectures.

Verified by using GOARCH=386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant