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

Open
mediocregopher opened this issue Nov 2, 2018 · 5 comments
Open

runtime: unknown pc during parallel benchmarks #28541

mediocregopher opened this issue Nov 2, 2018 · 5 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mediocregopher
Copy link

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?

yes

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 https://gist.githubusercontent.com/mediocregopher/5b365a3dfedb58dfff5e7dc973dee480/raw/761d04ae1ebd44f2d806aa33bad16dde38d8e401/panic_test.go > panic_test.go
go get -u github.com/mediocregopher/radix.v3
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:
with_cgo.txt

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.

@agnivade
Copy link
Contributor

agnivade commented Nov 2, 2018

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

@mediocregopher
Copy link
Author

Wow that was a stupid mistake, sorry >_<

curl https://gist.githubusercontent.com/mediocregopher/5b365a3dfedb58dfff5e7dc973dee480/raw/71d923f7fef25ea401396b3db01cae5dc3610d50/panic_test.go > panic_test.go
go get -u github.com/mediocregopher/radix.v3
go test -v -run xxx -bench Panic -benchmem

should actually panic.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 4, 2018
@dmitshur dmitshur added this to the Go1.12 milestone Nov 4, 2018
@mengzhuo
Copy link
Contributor

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
PASS
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

@odeke-em
Copy link
Member

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 github.com/mediocregopher/radix.v3
../../../../../go/src/github.com/mediocregopher/radix.v3/stream.go:13:2: use of internal package github.com/mediocregopher/radix/internal/bytesutil 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 modified the milestones: Go1.12, Go1.13 Feb 4, 2019
@mediocregopher
Copy link
Author

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 https://gist.githubusercontent.com/mediocregopher/5b365a3dfedb58dfff5e7dc973dee480/raw/71d923f7fef25ea401396b3db01cae5dc3610d50/panic_test.go > panic_test.go
go mod init panicker
go get github.com/mediocregopher/radix/v3
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 modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Triage Backlog
Development

No branches or pull requests

8 participants