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: SIGSEGV in readgstatus via goroutineProfileWithLabels because fing is nil #52821

Closed
bcmills opened this issue May 10, 2022 · 3 comments
Closed
Labels
NeedsFix release-blocker
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented May 10, 2022

--- FAIL: TestCgoTracebackGoroutineProfile (2.60s)
    testenv.go:460: [/home/gopher/build/tmp/go-build453646411/testprogcgo.exe GoroutineProfile] exit status: exit status 2
    crash_cgo_test.go:710: want OK
        , got fatal error: unexpected signal during runtime execution
        [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x148d0c]
        
        goroutine 1 [running]:
        runtime.throw({0x41e3e, 0x2a})
        	/home/gopher/build/go/src/runtime/panic.go:1028 +0x4c fp=0x43dd98 sp=0x43dd84 pc=0x1513b8
        runtime.sigpanic()
        	/home/gopher/build/go/src/runtime/signal_unix.go:807 +0x218 fp=0x43ddb0 sp=0x43dd98 pc=0x16a560
        runtime.readgstatus(...)
        	/home/gopher/build/go/src/runtime/proc.go:902
        runtime.goroutineProfileWithLabelsConcurrent({0x482000, 0xe, 0xe}, {0x448140, 0xe, 0xe})
        	/home/gopher/build/go/src/runtime/mprof.go:956 +0x1d4 fp=0x43ddf0 sp=0x43ddb4 pc=0x148d0c
        runtime.goroutineProfileWithLabels({0x482000, 0xe, 0xe}, {0x448140, 0xe, 0xe})
        	/home/gopher/build/go/src/runtime/mprof.go:858 +0x74 fp=0x43de14 sp=0x43ddf0 pc=0x148a9c
        runtime/pprof.runtime_goroutineProfileWithLabels({0x482000, 0xe, 0xe}, {0x448140, 0xe, 0xe})
        	/home/gopher/build/go/src/runtime/mprof.go:846 +0x44 fp=0x43de38 sp=0x43de14 pc=0x17f7f0
        runtime/pprof.writeRuntimeProfile({0x67cb0, 0x276f80}, 0x1, {0x394ef, 0x9}, 0x44178)
        	/home/gopher/build/go/src/runtime/pprof/pprof.go:723 +0xb8 fp=0x43de70 sp=0x43de38 pc=0x1dfedc
        runtime/pprof.writeGoroutine({0x67cb0, 0x276f80}, 0x1)
        	/home/gopher/build/go/src/runtime/pprof/pprof.go:683 +0x74 fp=0x43de94 sp=0x43de70 pc=0x1dfd00
        runtime/pprof.(*Profile).WriteTo(0x260870, {0x67cb0, 0x276f80}, 0x1)
        	/home/gopher/build/go/src/runtime/pprof/pprof.go:330 +0xdc fp=0x43df24 sp=0x43de94 pc=0x1dc798
        main.GoroutineProfile()
        	/home/gopher/build/go/src/runtime/testdata/testprogcgo/gprof.go:39 +0xb4 fp=0x43df50 sp=0x43df24 pc=0x225298
        main.main()
        	/home/gopher/build/go/src/runtime/testdata/testprogcgo/main.go:34 +0x158 fp=0x43dfc0 sp=0x43df50 pc=0x21ff10
        runtime.main()
        	/home/gopher/build/go/src/runtime/proc.go:250 +0x26c fp=0x43dfec sp=0x43dfc0 pc=0x153e68
        runtime.goexit()
        	/home/gopher/build/go/src/runtime/asm_arm.s:824 +0x4 fp=0x43dfec sp=0x43dfec pc=0x183fac

greplogs -l -e 'FAIL: TestCgoTracebackGoroutineProfile .*\n(?:\s+.*\n)*\s+runtime\.goroutineProfileWithLabels'
2022-05-09T20:57:58-3f43096/openbsd-arm-jsing

(attn @4a6f656c, @golang/openbsd; CC @golang/runtime)

@bcmills bcmills added OS-OpenBSD NeedsInvestigation arch-arm labels May 10, 2022
@bcmills bcmills added this to the Backlog milestone May 10, 2022
@mknyszek
Copy link
Contributor

@mknyszek mknyszek commented May 10, 2022

CC @rhysh

@mknyszek
Copy link
Contributor

@mknyszek mknyszek commented May 10, 2022

Looks like this failed in reading the finalizer goroutine's status. I'm guessing the finalizer goroutine just never got queued up to run (note that the finalizer goroutine is just created by the first SetFinalizer call).

I think the goroutine profile code may need to read its status and check its properties more carefully.

@mknyszek mknyszek changed the title runtime: SIGSEGV in readgstatus via goroutineProfileWithLabels on openbsd-arm-jsing runtime: SIGSEGV in readgstatus via goroutineProfileWithLabels because fing is nil May 10, 2022
@mknyszek mknyszek added NeedsFix and removed OS-OpenBSD NeedsInvestigation arch-arm labels May 10, 2022
@mknyszek mknyszek removed this from the Backlog milestone May 10, 2022
@mknyszek mknyszek added this to the Go1.19 milestone May 10, 2022
@mknyszek mknyszek self-assigned this May 10, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented May 10, 2022

Change https://go.dev/cl/405475 mentions this issue: runtime: profile finalizer G more carefully in goroutine profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants