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: CPU profiling crashes on NetBSD #13914

Closed
rillig opened this issue Jan 11, 2016 · 4 comments

Comments

@rillig
Copy link
Contributor

commented Jan 11, 2016

  • go version go1.5.2 netbsd/amd64
  • NetBSD 7.0 amd64

The following program crashes after less than a second.

package main

import (
        "os"
        "runtime/pprof"
)

func main() {
        f, _ := os.Create("demo.pprof")
        pprof.StartCPUProfile(f)
        for {
        }
}

The crash only happens in profiling mode.

When run under the eyes of ktruss -t A -R, the program does this:

thread | relative time | syscall
...
2   0.000011454   __nanosleep50   = 0
2   0.000035199   __clock_gettime50(0, 0xc820037ee8) = 0
2   0.000033803   __clock_gettime50(0, 0xc820037ed0) = 0
3   -1.979777508  stop kernel
3   0.020298198   resume kernel
3   0.000010895   compat_60__lwp_park Err#4 EINTR
3   0.000015364   SIGPROF caught handler=0x455aa0 mask=0x0 code=0x0
3   0.000084925   setcontext(0x40) Err#14 EFAULT
3   0.000009499   exit(0xffffffffffffffff)
2   -1.999839927  stop kernel
2   0.000196948   resume kernel
2   0.000006984   __nanosleep50   Err#4 EINTR
3   -1.999966198  stop kernel
3   0.000063973   resume kernel
3   0.000009777   stop kernel
3   0.000053079   resume kernel
@bradfitz bradfitz changed the title runtime/pprof crashes on NetBSD runtime/pprof: CPU profiling crashes on NetBSD Jan 12, 2016
@bradfitz bradfitz added the OS-NetBSD label Jan 12, 2016
@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 12, 2016

Can you try this with master? (which is soon to become Go 1.6) The Go 1.5.x. tree is frozen except for critical problems and security things, and this is neither.

@bradfitz bradfitz added this to the Unplanned milestone Jan 12, 2016
@rillig

This comment has been minimized.

Copy link
Contributor Author

commented Jan 14, 2016

I tried to reproduce this issue using master 66a7097, but building the master failed, as detailed in #13945.

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jan 17, 2016
Changes since 5.3:

* disabled CPU profiling on NetBSD, since it crashes without any output;
  see golang/go#13914
@rillig

This comment has been minimized.

Copy link
Contributor Author

commented Jan 23, 2016

Now that #13945 is fixed, I tried again with master 7d8c8c0, and it works perfectly.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 23, 2016

Great! Closing this, then.

@bradfitz bradfitz closed this Jan 23, 2016
@golang golang locked and limited conversation to collaborators Jan 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.