We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Running as shown in the example (i.e., defer profile.Start().Stop()) causes a data race:
defer profile.Start().Stop()
eric@archbox /tmp $ cat main.go package main import ( "time" "github.com/pkg/profile" ) func main() { defer profile.Start().Stop() time.Sleep(5 * time.Second) } eric@archbox /tmp $ go build -race main.go eric@archbox /tmp $ ./main 2016/03/14 14:53:07 profile: cpu profiling enabled, /tmp/profile342323605/cpu.pprof ^C2016/03/14 14:53:08 profile: caught interrupt, stopping profiles ================== WARNING: DATA RACE Read by goroutine 8: github.com/pkg/profile.(*profile).Stop() /home/eric/gopath/src/github.com/pkg/profile/profile.go:93 +0x37 github.com/pkg/profile.Start.func5() /home/eric/gopath/src/github.com/pkg/profile/profile.go:181 +0x20c Previous write by main goroutine: github.com/pkg/profile.Start() /home/eric/gopath/src/github.com/pkg/profile/profile.go:187 +0xb22 main.main() /tmp/main.go:10 +0x39 Goroutine 8 (running) created at: github.com/pkg/profile.Start() /home/eric/gopath/src/github.com/pkg/profile/profile.go:184 +0xa14 main.main() /tmp/main.go:10 +0x39 ================== ================== WARNING: DATA RACE Read by goroutine 8: github.com/pkg/profile.(*profile).Stop() /home/eric/gopath/src/github.com/pkg/profile/profile.go:93 +0x84 github.com/pkg/profile.Start.func5() /home/eric/gopath/src/github.com/pkg/profile/profile.go:181 +0x20c Previous write by main goroutine: github.com/pkg/profile.Start() /home/eric/gopath/src/github.com/pkg/profile/profile.go:189 +0xae3 main.main() /tmp/main.go:10 +0x39 Goroutine 8 (running) created at: github.com/pkg/profile.Start() /home/eric/gopath/src/github.com/pkg/profile/profile.go:184 +0xa14 main.main() /tmp/main.go:10 +0x39 ================== Found 2 data race(s)
The text was updated successfully, but these errors were encountered:
You may need to set export GORACE="history_size=7" to see the writing goroutine.
export GORACE="history_size=7"
Sorry, something went wrong.
Thanks. That looks like an easy fix.
On Tue, Mar 15, 2016 at 8:54 AM, Eric Lagergren notifications@github.com wrote:
You may need to set export GORACE="history_size=7" to see the writing goroutine. — Reply to this email directly or view it on GitHub #17 (comment).
— Reply to this email directly or view it on GitHub #17 (comment).
No problem!
19396ec
No branches or pull requests
Running as shown in the example (i.e.,
defer profile.Start().Stop()
) causes a data race:The text was updated successfully, but these errors were encountered: