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: unknown pc during parallel benchmarks #28541

mediocregopher opened this issue Nov 2, 2018 · 5 comments

runtime: unknown pc during parallel benchmarks #28541

mediocregopher opened this issue Nov 2, 2018 · 5 comments


Copy link

@mediocregopher mediocregopher commented Nov 2, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.11.1 linux/arm64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

I'm using archlinux installed into a chroot on a chromebook, which is arm64.

What did you do?

This error is quite easy for me to reproduce, but difficult to pin down a small test-case for it.

The following will cause the error, but requires a redis server to be running in order to do so:

curl > panic_test.go
go get -u
go test -v -run xxx -bench Panic -benchmem

What did you expect to see?

Both the panicking and not-panicking benchmarks to complete successfully.

What did you see instead?

If I run that with CGO_ENABLED=1 the runtime panics with an unknown pc error:

If I run it with CGO_ENABLED=0 it panics with an unexpected fault address: without_cgo.txt

Either way it seems the panicking is happening within the benchmark package, not my own, though I'm not able to find a reproducible test case without using my own code.

Copy link

@agnivade agnivade commented Nov 2, 2018

Your gist doesn't seem to have a panicking benchmark.

Copy link

@mediocregopher mediocregopher commented Nov 2, 2018

Wow that was a stupid mistake, sorry >_<

curl > panic_test.go
go get -u
go test -v -run xxx -bench Panic -benchmem

should actually panic.

@dmitshur dmitshur added this to the Go1.12 milestone Nov 4, 2018
Copy link

@mengzhuo mengzhuo commented Nov 13, 2018

I can't reproduce the panic 1.11.1 nor 1.11

~ go version
go version go1.11.1 linux/arm64
~ go test -v -run xxx -bench Panic -benchmem
goos: linux
goarch: arm64
BenchmarkPanic/not-panicking-8           1000000              1003 ns/op               0 B/op          0 allocs/op
BenchmarkPanic/panicking-8                100000             14668 ns/op              32 B/op          1 allocs/op
ok      _/root  2.671s
Linux hikey970 4.9.78-g6daba8c09 #1 SMP PREEMPT Tue Sep 11 23:25:44 CST 2018 aarch64 aarch64 aarch64 GNU/Linux
CPU: Hisilicon Kirin 970

Copy link

@odeke-em odeke-em commented Feb 4, 2019

Thank you for the report @mediocregopher and others for chiming in!

@mediocregopher currently on Go tip (Go1.12+) I get a compilation error

$ GO111MODULE=off go get -u
../../../../../go/src/ use of internal package not allowed

Please fix that to aid in reproduction, but also since we are at the very end of the Go1.12 cycle, I shall punt this issue to Go1.13.

@odeke-em odeke-em removed this from the Go1.12 milestone Feb 4, 2019
@odeke-em odeke-em added this to the Go1.13 milestone Feb 4, 2019
Copy link

@mediocregopher mediocregopher commented Feb 4, 2019

The radix project has undergone some changes, including moving to a new repo and using the new module stuff. I updated the test case to reflect that, and in doing so simplified it a bit. It seems now all that is required to get it to crash is to change the parallelism of the benchmark.

curl > panic_test.go
go mod init panicker
go get
go test -v -run xxx -bench . -benchmem

Interestingly this doesn't always cause it to panic, but it does so fairly frequently. Here is the new output when it does: with_cgo2.txt. And here's the output without cgo enabled: without_cgo2.txt.

This is all on go1.11.4 linux/arm64.

Thanks for looking into this!

@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants