Skip to content

runtime/cgo: SIGSEGV: segmentation violation #6051

Closed
@davecheney

Description

@davecheney
What steps will reproduce the problem?

Somewhere between a5eb738ff649 and 58c839988402 a cgo breakage was committed. Possibly
even
https://code.google.com/p/go/source/detail?r=a5eb738ff6490af23ebf7906dd2af0f4bbc19a3e.

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

# ../misc/cgo/test
SIGSEGV: segmentation violation
PC=0x7e7e0

_/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test.Add(0x1)
    /export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test/cthread.go:29 +0x84
sync/atomic.AddUint32(0x163a8, 0x16440, 0x38356c)
    /usr/local/go/src/pkg/sync/atomic/asm_linux_arm.s:69 +0x1c
runtime: unexpected return pc for runtime.cgocallbackg1 called from 0x1
runtime.cgocallbackg1()
    /usr/local/go/src/pkg/runtime/cgocall.c:298 +0x9c

goroutine 4 [running]:
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1332 fp=0xb6d80fd0

goroutine 1 [chan receive]:
testing.RunTests(0x1a2aa4, 0x3804a8, 0x23, 0x23, 0x145101)
    /usr/local/go/src/pkg/testing/testing.go:441 +0x6e4
testing.Main(0x1a2aa4, 0x3804a8, 0x23, 0x23, 0x37d380, ...)
    /usr/local/go/src/pkg/testing/testing.go:372 +0x6c
main.main()
    _/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test/_test/_testmain.go:117 +0x98

goroutine 3 [syscall]:
os/signal.loop()
    /usr/local/go/src/pkg/os/signal/signal_unix.go:21 +0x24
created by os/signal.init·1
    /usr/local/go/src/pkg/os/signal/signal_unix.go:27 +0x48

goroutine 36 [syscall]:
_/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test._Cfunc_usleep(0x2710,
0x0)
    _/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test/_test/_cgo_defun.c:552 +0x34
created by
_/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test.lockOSThreadCallback
    /export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test/issue3775.go:35 +0x4c

goroutine 37 [syscall]:
_/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test._Cfunc_doAdd(0xa,
0x6)
    _/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test/_test/_cgo_defun.c:300 +0x34
_/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test.testCthread(0x10655d20)
    /export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test/cthread.go:33 +0x40
_/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test.TestCthread(0x10655d20)
    /export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test/cgo_test.go:38 +0x2c
testing.tRunner(0x10655d20, 0x3805e0)
    /usr/local/go/src/pkg/testing/testing.go:360 +0xc4
created by testing.RunTests
    /usr/local/go/src/pkg/testing/testing.go:440 +0x6c4

goroutine 38 [runnable]:
runtime.exitsyscall()
    /usr/local/go/src/pkg/runtime/proc.c:1517 +0xb0
runtime.cgocallbackg()
    /usr/local/go/src/pkg/runtime/cgocall.c:267 +0x60
runtime.cgocallback_gofunc(0x0, 0x0, 0x0)
    /usr/local/go/src/pkg/runtime/asm_arm.s:488 +0x60
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1332

trap    0xe
error   0x817
oldmask 0x0
r0      0x0
r1      0x2
r2      0x0
r3      0x0
r4      0x3885c0
r5      0x0
r6      0x18
r7      0x0
r8      0x1068b820
r9      0x10610400
r10     0x106015a0
fp      0x3885c8
ip      0x0
sp      0xb6d80f70
lr      0x10eafc
pc      0x7e7e0
cpsr    0x60000010
fault   0x0
exit status 2
FAIL    _/export/builder/workspace/linux-arm-arm5-1bac09ef43f0/go/misc/cgo/test 1.471s

Please use labels and text to provide additional information.

http://build.golang.org/log/81dad176c42bb81f76b959accd7145c0380265fe
http://build.golang.org/log/22672192ce6c8e298ee3508dae19bba1e3c58269

Activity

randall77

randall77 commented on Aug 6, 2013

@randall77
Contributor

Comment 1:

This issue was closed by revision 034d5fc.

Status changed to Fixed.

added this to the Go1.2 milestone on Apr 14, 2015
locked and limited conversation to collaborators on Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @davecheney@rsc@randall77@gopherbot

        Issue actions

          runtime/cgo: SIGSEGV: segmentation violation · Issue #6051 · golang/go