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
sync/atomic: 1.8beta2 ARM / panic: runtime error: invalid memory address or nil pointer dereference #18334
Comments
Check issue 599
…On Fri, 16 Dec 2016, 09:26 Pierre Durand ***@***.***> wrote:
What version of Go are you using (go version)?
go version go1.8beta2 linux/arm (installed from official pre-compiled
distribution)
What operating system and processor architecture are you using (go env)?
Raspberry Pi 3 with latest Archlinux ARM
GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pierre/go"
GORACE=""
GOROOT="/home/pierre/.gimme/versions/go1.8beta2.linux.arm"
GOTOOLDIR="/home/pierre/.gimme/versions/go1.8beta2.linux.arm/pkg/tool/linux_arm"
GCCGO="gccgo"
GOARM="7"
CC="gcc"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build204219494=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
go test github.com/pierrre/imageserver/cache/groupcache
What did you expect to see?
Test should pass
What did you see instead?
--- FAIL: TestServer (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x11c0c]
goroutine 3 [running]:
testing.tRunner.func1(0x10768400)
/home/pierre/.gimme/versions/go1.8beta2.linux.arm/src/testing/testing.go:621 +0x238
panic(0x261e10, 0x3df9a0)
/home/pierre/.gimme/versions/go1.8beta2.linux.arm/src/runtime/panic.go:489 +0x288
sync/atomic.addUint64(0x107a60ac, 0x1, 0x0, 0x1, 0x107a6018)
/home/pierre/.gimme/versions/go1.8beta2.linux.arm/src/sync/atomic/64bit_arm.go:31 +0x4cgithub.com/golang/groupcache.(*AtomicInt).Add(0x107a60ac, 0x1, 0x0)
/home/pierre/go/src/github.com/golang/groupcache/groupcache.go:470 +0x2cgithub.com/golang/groupcache.(*Group).Get(0x107a6000, 0x242e70, 0x1076e218, 0x295a1e, 0x4, 0x3bde38, 0x10772880, 0x8, 0x3bc101)
/home/pierre/go/src/github.com/golang/groupcache/groupcache.go:207 +0x58github.com/pierrre/imageserver/cache/groupcache.(*Server).Get(0x10780150, 0x10772840, 0x107277b0, 0x1079e5e8, 0x0)
/home/pierre/go/src/github.com/pierrre/imageserver/cache/groupcache/groupcache.go:36 +0xf8github.com/pierrre/imageserver/cache/groupcache.TestServer(0x10768400)
/home/pierre/go/src/github.com/pierrre/imageserver/cache/groupcache/groupcache_test.go:33 +0xfc
testing.tRunner(0x10768400, 0x2a7ae0)
/home/pierre/.gimme/versions/go1.8beta2.linux.arm/src/testing/testing.go:656 +0x88
created by testing.(*T).Run
/home/pierre/.gimme/versions/go1.8beta2.linux.arm/src/testing/testing.go:693 +0x244
FAIL github.com/pierrre/imageserver/cache/groupcache 0.049s
I works perfectly on my Linux amd64 laptop.
I think it's not an issue in my code.
Maybe in groupcache, but I'm not sure...
Most probably in atomic/sync.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18334>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAcAyHfuBHl6iwrq6kiGsIjiXA5-yJjks5rIb6WgaJpZM4LOpB0>
.
|
Indeed, this looks like #599. 0x107a60ac is not 8-byte aligned. Go 1.8 is stricter about this than Go 1.7, even thought it was always a bug. We just let you get lucky sometimes in the past. Looks like this is a bug in groupcache. Group.Stats is not aligned on 32-bit. Fix coming. |
@pierrre, update your groupcache. Should now be fixed by golang/groupcache@d092608 I didn't verify on ARM, though. |
@bradfitz thank you, the problem is fixed ! 😄 |
Yes. At this time if you use atomic you must manually ensure alignment. |
OK thank you |
What version of Go are you using (
go version
)?go version go1.8beta2 linux/arm
(installed from official pre-compiled distribution)What operating system and processor architecture are you using (
go env
)?Raspberry Pi 3 with latest Archlinux ARM
What did you do?
go test github.com/pierrre/imageserver/cache/groupcache
What did you expect to see?
Test should pass
What did you see instead?
I works perfectly on my Linux amd64 laptop.
I think it's not an issue in my code.
Maybe in groupcache, but I'm not sure...
Most probably in
atomic/sync
.The text was updated successfully, but these errors were encountered: