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: "runtime: unknown pc" from fatal async signal in VDSO #47537

Open
prattmic opened this issue Aug 4, 2021 · 1 comment
Open

runtime: "runtime: unknown pc" from fatal async signal in VDSO #47537

prattmic opened this issue Aug 4, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@prattmic
Copy link
Member

@prattmic prattmic commented Aug 4, 2021

In fixing #47522, I've made runtime TestSegv more strict and uncovered another crash:

--- FAIL: TestSegv (0.00s)
    --- FAIL: TestSegv/SegvInCgo (0.01s)
        crash_test.go:104: /tmp/go-build112932942/testprogcgo.exe SegvInCgo exit status: exit status 2
        crash_cgo_test.go:606: failure incorrectly contains "runtime: ". output:
            SIGSEGV: segmentation violation
            PC=0x7fff5b2e1698 m=0 sigcode=0
            
            goroutine 6 [running]:
            runtime: unknown pc 0x7fff5b2e1698
            stack: frame={sp:0x7fff5b2492f0, fp:0x0} stack=[0xc000052000,0xc000052800)
            
            runtime: unknown pc 0x7fff5b2e1698
            stack: frame={sp:0x7fff5b2492f0, fp:0x0} stack=[0xc000052000,0xc000052800)
            
            created by main.SegvInCgo
                /usr/local/google/home/mpratt/src/go/src/runtime/testdata/testprogcgo/segv.go:43 +0x6f
            
            goroutine 1 [sleep]:
            time.Sleep(0x3b9aca00)
                /usr/local/google/home/mpratt/src/go/src/runtime/time.go:193 +0x12e
            main.SegvInCgo()
                /usr/local/google/home/mpratt/src/go/src/runtime/testdata/testprogcgo/segv.go:55 +0xbd
            main.main()
                /usr/local/google/home/mpratt/src/go/src/runtime/testdata/testprogcgo/main.go:37 +0x188

The signal was delivered while we were in the VDSO. sigprof has special handling for this, but the standard signal handler does not.

I have most of a fix, just need to double-check the resulting stack trace.

cc @cherrymui @ianlancetaylor

@prattmic prattmic added this to the Backlog milestone Aug 4, 2021
@prattmic prattmic self-assigned this Aug 4, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 4, 2021

Change https://golang.org/cl/339990 mentions this issue: runtime: handle async fatal signals in VDSO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants