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 allocNeedsZero on darwin #58715

Open
bcmills opened this issue Feb 24, 2023 · 4 comments
Open

runtime: SIGSEGV in allocNeedsZero on darwin #58715

bcmills opened this issue Feb 24, 2023 · 4 comments
Assignees
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. OS-Darwin
Milestone

Comments

@bcmills
Copy link
Member

bcmills commented Feb 24, 2023

#!watchflakes
post <- goos == "darwin" && log ~ `runtime\.\(\*mheap\)\.allocNeedsZero` && log ~ `SIGSEGV`

(Pulled out from #55167 (comment).)

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 24, 2023
@gopherbot
Copy link

Found new dashboard test flakes for:

#!watchflakes
post <- goos == "darwin" && log ~ `runtime\.\(\*mheap\)\.allocNeedsZero` && log ~ `SIGSEGV`
2023-01-17 01:51 darwin-amd64-11_0 tools@8e949673 go@145dd384 TestGoplsSourceDoesNotCallTokenFileMethods (log)
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10263f1]

runtime stack:
runtime.throw({0x12a17c8?, 0x2031?})
	/tmp/buildlet/go/src/runtime/panic.go:1047 +0x5d fp=0x7000077b5598 sp=0x7000077b5568 pc=0x1034f1d
runtime.sigpanic()
	/tmp/buildlet/go/src/runtime/signal_unix.go:821 +0x3e9 fp=0x7000077b55f8 sp=0x7000077b5598 pc=0x104bb49
runtime.(*mheap).allocNeedsZero(0xc004000000?, 0x7000077b5640?, 0x102b539?)
	/tmp/buildlet/go/src/runtime/mheap.go:1021 +0x71 fp=0x7000077b5618 sp=0x7000077b55f8 pc=0x10263f1
...
	/tmp/buildlet/go/src/runtime/sema.go:62 +0x27 fp=0xc0000d7878 sp=0xc0000d7840 pc=0x10655a7
sync.(*WaitGroup).Wait(0xc000107a58?)
	/tmp/buildlet/go/src/sync/waitgroup.go:116 +0x4b fp=0xc0000d78a0 sp=0xc0000d7878 pc=0x107152b
golang.org/x/tools/go/packages.(*loader).refine(0xc0001b4000, 0xc0001ba050)
	/tmp/buildlet/gopath/src/golang.org/x/tools/go/packages/packages.go:778 +0xdd7 fp=0xc0000d7b98 sp=0xc0000d78a0 pc=0x1229d77
golang.org/x/tools/go/packages.Load(0x12ef1e8?, {0xc000198080, 0x2, 0x2})
	/tmp/buildlet/gopath/src/golang.org/x/tools/go/packages/packages.go:266 +0x9c fp=0xc0000d7bd0 sp=0xc0000d7b98 pc=0x12280bc
golang.org/x/tools/gopls/internal/lsp/safetoken_test.TestGoplsSourceDoesNotCallTokenFileMethods(0xc000082ea0)
	/tmp/buildlet/gopath/src/golang.org/x/tools/gopls/internal/lsp/safetoken/safetoken_test.go:76 +0xc8 fp=0xc0000d7f70 sp=0xc0000d7bd0 pc=0x1230088
testing.tRunner(0xc000082ea0, 0x12a7a98)
2023-02-16 18:10 darwin-amd64-12_0 tools@ad4fc28a go@518889b3 x/tools/gopls/internal/regtest/diagnostics.TestIssue37978 (log)
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x100027f51]

runtime stack:
runtime.throw({0x100b341e9?, 0x1001155bd?})
	/tmp/buildlet/go/src/runtime/panic.go:1075 +0x5c fp=0x70000a7f5d98 sp=0x70000a7f5d68 pc=0x100036b5c
runtime.sigpanic()
	/tmp/buildlet/go/src/runtime/signal_unix.go:821 +0x3e9 fp=0x70000a7f5df8 sp=0x70000a7f5d98 pc=0x10004d3a9
runtime.(*mheap).allocNeedsZero(0xf7?, 0x10115de88?, 0xc002000000?)
	/tmp/buildlet/go/src/runtime/mheap.go:1021 +0x71 fp=0x70000a7f5e18 sp=0x70000a7f5df8 pc=0x100027f51
...
	/tmp/buildlet/go/src/runtime/chan.go:442 +0x12 fp=0xc0033a5d68 sp=0xc0033a5d40 pc=0x100006c92
testing.(*T).Run(0xc00349cd00, {0x100ae9102?, 0x27?}, 0xc002588690)
	/tmp/buildlet/go/src/testing/testing.go:1630 +0x405 fp=0xc0033a5e28 sp=0xc0033a5d68 pc=0x100127425
golang.org/x/tools/gopls/internal/lsp/regtest.(*Runner).Run(0xc000336d20, 0xc00349cd00, {0x100b4efc9, 0x7c}, 0x100c60f48, {0x0, 0x0, 0x10008dcaf?})
	/tmp/buildlet/gopath/src/golang.org/x/tools/gopls/internal/lsp/regtest/runner.go:171 +0x3f0 fp=0xc0033a5f20 sp=0xc0033a5e28 pc=0x1008f5d30
golang.org/x/tools/gopls/internal/lsp/regtest.Run(...)
	/tmp/buildlet/gopath/src/golang.org/x/tools/gopls/internal/lsp/regtest/regtest.go:55
golang.org/x/tools/gopls/internal/regtest/diagnostics.TestIssue37978(0xc0016dca80?)
	/tmp/buildlet/gopath/src/golang.org/x/tools/gopls/internal/regtest/diagnostics/diagnostics_test.go:163 +0x3d fp=0xc0033a5f70 sp=0xc0033a5f20 pc=0x1008fe0dd
testing.tRunner(0xc00349cd00, 0x100c60f50)
2023-02-16 19:20 darwin-amd64-nocgo tools@e5b99481 go@031401a7 TestLSP (log)
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1026e71]

runtime stack:
runtime.throw({0x198e00d?, 0xc000054638?})
	/tmp/buildlet/go/src/runtime/panic.go:1075 +0x5c fp=0x700008bf0db8 sp=0x700008bf0d88 pc=0x1035a7c
runtime.sigpanic()
	/tmp/buildlet/go/src/runtime/signal_unix.go:821 +0x3e9 fp=0x700008bf0e18 sp=0x700008bf0db8 pc=0x104c2c9
runtime.(*mheap).allocNeedsZero(0x1f?, 0x1ff?, 0xc008002000?)
	/tmp/buildlet/go/src/runtime/mheap.go:1021 +0x71 fp=0x700008bf0e38 sp=0x700008bf0e18 pc=0x1026e71
...
	/tmp/buildlet/go/src/runtime/chan.go:583 +0x44e fp=0xc000080db8 sp=0xc000080d28 pc=0x10060ae
runtime.chanrecv1(0x208d1e0?, 0x181e1e0?)
	/tmp/buildlet/go/src/runtime/chan.go:442 +0x12 fp=0xc000080de0 sp=0xc000080db8 pc=0x1005c32
testing.(*T).Run(0xc000288340, {0x194b50d?, 0x599?}, 0xc00028c090)
	/tmp/buildlet/go/src/testing/testing.go:1630 +0x405 fp=0xc000080ea0 sp=0xc000080de0 pc=0x11253e5
golang.org/x/tools/gopls/internal/lsp/tests.RunTests(0xc000288340, {0x194f0ce, 0x8}, 0x1, 0x1a9d040)
	/tmp/buildlet/gopath/src/golang.org/x/tools/gopls/internal/lsp/tests/tests.go:297 +0x12a fp=0xc000080f38 sp=0xc000080ea0 pc=0x17530aa
golang.org/x/tools/gopls/internal/lsp.TestLSP(0xc000288000?)
	/tmp/buildlet/gopath/src/golang.org/x/tools/gopls/internal/lsp/lsp_test.go:51 +0x2b fp=0xc000080f70 sp=0xc000080f38 pc=0x179b5cb
testing.tRunner(0xc000288340, 0x1a9d020)

watchflakes

@bcmills bcmills added OS-Darwin NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Feb 25, 2023
@mknyszek
Copy link
Contributor

mknyszek commented Mar 1, 2023

The stack trace implies loading a nil heapArena struct. I'm not sure how this could happen (for instance due to a race). I'll look into it.

@mknyszek mknyszek self-assigned this Mar 1, 2023
@mknyszek mknyszek added this to the Backlog milestone Mar 1, 2023
@mknyszek
Copy link
Contributor

mknyszek commented Mar 1, 2023

I want to look into whether this is actually only happening on Darwin.

@prattmic
Copy link
Member

prattmic commented Mar 1, 2023

I see it once on freebsd in 2021:

2021-10-13T18:15:48-40f82f8/freebsd-386-12_2

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. OS-Darwin
Projects
Status: Todo
Status: No status
Development

No branches or pull requests

4 participants