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

sync/atomic: armCompareAndSwap backtraces fail on arm systems #7338

Closed
davecheney opened this issue Feb 16, 2014 · 7 comments
Closed

sync/atomic: armCompareAndSwap backtraces fail on arm systems #7338

davecheney opened this issue Feb 16, 2014 · 7 comments
Milestone

Comments

@davecheney
Copy link
Contributor

What steps will reproduce the problem?

package main

import "sync/atomic"

func main() {
        atomic.CompareAndSwapUint32(nil, 0, 0)
}

What is the expected output? What do you see instead?

Expected:

panda(~/src) % go run nil.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x31980]

goroutine 16 [running]:
runtime.panic(0x34578, 0x65120)
    /home/dfc/go/src/pkg/runtime/panic.c:250 +0x138
sync/atomic.CompareAndSwapUint32(0x0, 0x0, 0x0)
    ?:0 +0x8
main.main()
    /home/dfc/src/nil.go:6 +0x3c
exit status 2

Got:

runtime: unexpected return pc for runtime.main called from 0xffffffff
fatal error: unknown caller pc

runtime stack:
runtime.throw(0x6cf49)
        /usr/home/dfc/go/src/pkg/runtime/panic.c:464 +0x5c
runtime.gentraceback(0x1cd90, 0x5026dec0, 0x0, 0x3016c0a0, 0x0, ...)
        /usr/home/dfc/go/src/pkg/runtime/traceback_arm.c:105 +0x2f0
addstackroots(0x3016c0a0, 0xbfffea04)
        /usr/home/dfc/go/src/pkg/runtime/mgc0.c:1645 +0x184
markroot(0x30190000, 0x5)
        /usr/home/dfc/go/src/pkg/runtime/mgc0.c:1342 +0xf8
runtime.parfordo(0x30190000)
        /usr/home/dfc/go/src/pkg/runtime/parfor.c:105 +0xc0
gc(0x5026dedc)
        /usr/home/dfc/go/src/pkg/runtime/mgc0.c:2335 +0x1cc
mgc(0x3016c0a0)
        /usr/home/dfc/go/src/pkg/runtime/mgc0.c:2281 +0x30
runtime.mcall(0x6f86c)
        /usr/home/dfc/go/src/pkg/runtime/asm_arm.s:163 +0x3c

goroutine 16 [garbage collection]:
runtime.gc(0x0)
        /usr/home/dfc/go/src/pkg/runtime/mgc0.c:2250 +0x1b8 fp=0x5026dee4
runtime.mallocgc(0x20, 0x0, 0x0)
        /usr/home/dfc/go/src/pkg/runtime/malloc.goc:213 +0x18c fp=0x5026df24
runtime.mal(0x14)
        /usr/home/dfc/go/src/pkg/runtime/malloc.goc:833 +0x38 fp=0x5026df34
runtime.panic(0x39668, 0x6cb28)
        /usr/home/dfc/go/src/pkg/runtime/panic.c:217 +0x2c fp=0x5026df54
runtime.panicstring(0x6cb28)
        /usr/home/dfc/go/src/pkg/runtime/panic.c:482 +0xac fp=0x5026df68
runtime.sigpanic()
        /usr/home/dfc/go/src/pkg/runtime/os_freebsd.c:193 +0x108 fp=0x5026df74
sync/atomic.armCompareAndSwapUint32(0x0, 0x0, 0x0)
        /usr/home/dfc/go/src/pkg/sync/atomic/asm_arm.s:14 +0x4 fp=0x5026df78
runtime.main()
        /usr/home/dfc/go/src/pkg/runtime/proc.c:231 +0xf8 fp=0x5026dfac
runtime: unexpected return pc for runtime.main called from 0xffffffff
runtime.main()
        /usr/home/dfc/go/src/pkg/runtime/proc.c:231 +0xf8 fp=0x5026dfe0
created by _rt0_go
        /usr/home/dfc/go/src/pkg/runtime/asm_arm.s:72 +0xb0

goroutine 17 [runnable]:
runtime.MHeap_Scavenger()
        /usr/home/dfc/go/src/pkg/runtime/mheap.c:507
runtime.goexit()
        /usr/home/dfc/go/src/pkg/runtime/proc.c:1438
exit status 2

Please use labels and text to provide additional information.

http://build.golang.org/log/4d58a23a098e04703e8a487ca572ddecf3b6bd0a
http://build.golang.org/log/8c3d576a9e243aa1f7ddf53fdcb8e12c11eb85aa
@minux
Copy link
Member

minux commented Feb 16, 2014

Comment 1:

I'm on it.

@davecheney
Copy link
Contributor Author

Comment 2:

Labels changed: removed os-freebsd, os-netbsd.

@davecheney
Copy link
Contributor Author

Comment 3:

This issue was updated by revision 5b456c7.

The nil deref tests are currently failing on the *bsd/arm platforms. In an effort to
avoid the build deteriorating further I would like to skip these tests on freebsd/arm
and netbsd/arm.
LGTM=bradfitz, minux.ma
R=golang-codereviews, bradfitz, minux.ma
CC=golang-codereviews
https://golang.org/cl/69870045

@gopherbot
Copy link

Comment 5:

CL https://golang.org/cl/88550043 mentions this issue.

@rsc
Copy link
Contributor

rsc commented Apr 16, 2014

Comment 6:

This issue was closed by revision cc08d92.

Status changed to Fixed.

@crawshaw
Copy link
Member

crawshaw commented Mar 8, 2015

A test is still disabled on freebsd/arm and netbsd/arm referencing this issue: https://github.com/golang/go/blob/master/src/sync/atomic/atomic_test.go#L1407

With golang.org/cl/7072 I am seeing the same error on the test for darwin/arm. I'm not sure yet whether this is a new bug introduced by that CL or if the original bug still exists.

@crawshaw crawshaw reopened this Mar 8, 2015
crawshaw added a commit that referenced this issue Mar 9, 2015
Updates #7338.

Change-Id: I859a73543352dbdd13ec05efb23a95aecbcc628a
Reviewed-on: https://go-review.googlesource.com/7164
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@rsc rsc removed the arch-arm label Apr 10, 2015
@rsc rsc added this to the Go1.5Maybe milestone Apr 10, 2015
@rsc
Copy link
Contributor

rsc commented Jul 30, 2015

I reenabled the test and got darwin/arm64 working. darwin/arm seemed ok already. The others have no builder, so they must be working fine!

@rsc rsc closed this as completed Jul 30, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jul 31, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants