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/pprof: SIGPROF crashes process on netbsd/amd64 #10166

Closed
bsiegert opened this issue Mar 14, 2015 · 2 comments
Closed

runtime/pprof: SIGPROF crashes process on netbsd/amd64 #10166

bsiegert opened this issue Mar 14, 2015 · 2 comments

Comments

@bsiegert
Copy link
Contributor

This is on

$ uname -a
NetBSD edamame.mirbsd.org 7.0_BETA NetBSD 7.0_BETA (GENERIC.201501181820Z) amd64
$ go version
go version devel +3b1d692 Sat Mar 14 10:47:19 2015 +0000 netbsd/amd64

At tip, the runtime/pprof test fails, which also makes all.bash fail:

=== RUN TestMemoryProfiler
--- PASS: TestMemoryProfiler (0.02s)
=== RUN TestCPUProfile
exit status 255
FAIL    runtime/pprof   0.038s

Looking at ktrace output, it looks like the SIGPROF is what kills the process:

 16246      3 pprof.test RET   compat_60__lwp_park -1 errno 4
Interrupted system call
 16246      3 pprof.test PSIG  SIGPROF caught handler=0x456980
mask=(): code=SI_TIMER sent by pid=0, uid=0 with sigval 0x2)
 16246      3 pprof.test CALL  setcontext(0x40)
 16246      3 pprof.test RET   setcontext -1 errno 14 Bad address
 16246      3 pprof.test CALL  exit(0xffffffffffffffff)

According to Minux:

has NetBSD changed kernel signal handler ABI?
or there might some stack/register corruption in runtime.sigtramp. The implicit
setcontext(2) is picking up a wrong address for ucontext. Should we preserve
callee-saved registers in runtime.sigtramp? I'd start by setting a break on
runtime.sigtramp, and then disassemble the function it should return to and try
understand where does 0x40 come from.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@gopherbot
Copy link

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

gopherbot pushed a commit that referenced this issue Jun 28, 2017
Updates #20836
Updates #19339
Updates #19652
Updates #20835
Updates #16511
Updates #10166
Updates #8574

Change-Id: If9a7f560489f1a8d628dafab227925bd8989326e
Reviewed-on: https://go-review.googlesource.com/47036
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@bradfitz
Copy link
Contributor

Fixed by requiring NetBSD 8+ for Go 1.10.

Documentation bug is #22911

@golang golang locked and limited conversation to collaborators Nov 28, 2018
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

5 participants