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

runtime: TestCgoExecSignalMask failures due to apparent deadlock on *BSD #42093

Open
bcmills opened this issue Oct 20, 2020 · 2 comments
Open

runtime: TestCgoExecSignalMask failures due to apparent deadlock on *BSD #42093

bcmills opened this issue Oct 20, 2020 · 2 comments

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Oct 20, 2020

--- FAIL: TestCgoExecSignalMask (60.56s)
    crash_test.go:105: /tmp/workdir/tmp/go-build689039578/testprogcgo.exe CgoExecSignalMask exit status: exit status 2
    crash_cgo_test.go:160: expected "OK\n", got SIGQUIT: quit
        PC=0x46de03 m=8 sigcode=0
        
        goroutine 0 [idle]:
        runtime.lwp_park(0x3, 0x0, 0x0, 0xc000180340, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000182180, ...)
        	/tmp/workdir/go/src/runtime/sys_netbsd_amd64.s:95 +0x23
        runtime.semasleep(0xffffffffffffffff, 0x0)
        	/tmp/workdir/go/src/runtime/os_netbsd.go:167 +0xb4
        runtime.notesleep(0xc000180150)
        	/tmp/workdir/go/src/runtime/lock_sema.go:181 +0xca
        runtime.stopm()
        	/tmp/workdir/go/src/runtime/proc.go:1948 +0xac
        runtime.findrunnable(0xc000027800, 0x0)
        	/tmp/workdir/go/src/runtime/proc.go:2509 +0xa7f
        runtime.schedule()
        	/tmp/workdir/go/src/runtime/proc.go:2712 +0x2d7
        runtime.mstart1()
        	/tmp/workdir/go/src/runtime/proc.go:1209 +0x93
        runtime.mstart()
        	/tmp/workdir/go/src/runtime/proc.go:1167 +0x6e
        
        goroutine 1 [semacquire]:
        sync.runtime_Semacquire(0xc000018318)
        	/tmp/workdir/go/src/runtime/sema.go:56 +0x45
        sync.(*WaitGroup).Wait(0xc000018310)
        	/tmp/workdir/go/src/sync/waitgroup.go:130 +0x65
        main.CgoExecSignalMask()
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:95 +0x15a
        main.main()
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/main.go:34 +0x1da
        
        goroutine 7 [syscall]:
        os/signal.signal_recv(0x58c820)
        	/tmp/workdir/go/src/runtime/sigqueue.go:147 +0x9d
        os/signal.loop()
        	/tmp/workdir/go/src/os/signal/signal_unix.go:23 +0x25
        created by os/signal.Notify.func1.1
        	/tmp/workdir/go/src/os/signal/signal.go:151 +0x45
        
        goroutine 8 [chan receive]:
        main.CgoExecSignalMask.func1(0xc00005a180)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:57 +0x47
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:56 +0xe7
        
        goroutine 9 [chan send]:
        os/signal.signal_enable(0xdcc5c2d10000001e)
        	/tmp/workdir/go/src/runtime/sigqueue.go:216 +0x72
        os/signal.enableSignal(...)
        	/tmp/workdir/go/src/os/signal/signal_unix.go:49
        os/signal.Notify.func1(0x1e)
        	/tmp/workdir/go/src/os/signal/signal.go:145 +0x88
        os/signal.Notify(0xc00008e060, 0xc000031fa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:165 +0x162
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 10 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a480, 0xc00002a7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 11 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a540, 0xc00002afa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 12 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a600, 0xc00002b7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 13 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a6c0, 0xc00002bfa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 14 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a780, 0xc00002c7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 15 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a840, 0xc00002cfa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 16 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a900, 0xc00002d7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 18 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a9c0, 0xc00002dfa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 19 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0x1, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Stop(0xc00005a240)
        	/tmp/workdir/go/src/os/signal/signal.go:216 +0x375
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:91 +0x139
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        rax    0x4
        rbx    0x0
        rcx    0x46de03
        rdx    0x0
        rdi    0x3
        rsi    0x0
        rbp    0x788302dffd60
        rsp    0x788302dffd08
        r8     0xc000180340
        r9     0xc000180340
        r10    0x0
        r11    0x202
        r12    0x3
        r13    0xc000182180
        r14    0x788304cde000
        r15    0x7883043fb000
        rip    0x46de03
        rflags 0x203
        cs     0x47
        fs     0x0
        gs     0x0
FAIL
FAIL	runtime	118.004s

2020-10-20T08:08:15-55b2d47/netbsd-amd64-9_0
2020-09-23T11:49:55-4d7abd7/freebsd-arm64-dmgk
2020-09-22T22:47:43-7f71846/freebsd-arm64-dmgk
2020-07-10T11:32:36-3a43226/netbsd-amd64-9_0
2020-05-01T05:25:54-e1d1684/freebsd-arm64-dmgk
2020-04-29T20:33:31-197a2a3/netbsd-amd64-9_0

Compare #38333.

CC @ianlancetaylor @cherrymui @aclements

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 20, 2020

Change https://golang.org/cl/264018 mentions this issue: runtime: use GOTRACEBACK=system for TestCgoExecSignalMask

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 20, 2020

Looks like the goroutine started by ensureSigM is not responding, but I don't see how that could be. Send https://golang.org/cl/264018 to get a bit more information the next time this occurs.

gopherbot pushed a commit that referenced this issue Oct 20, 2020
Try to get a bit more information to understand #42093.

For #42093

Change-Id: I818feb08d7561151d52eba3e88c418b55b9f9c1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/264018
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.