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: spurious SEGV in package initializer (darwin/amd64) #71453

Open
gopherbot opened this issue Jan 27, 2025 · 3 comments
Open

runtime: spurious SEGV in package initializer (darwin/amd64) #71453

gopherbot opened this issue Jan 27, 2025 · 3 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. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "golang.org/x/tools/go/analysis/passes/loopclosure" && test == ""

Issue created automatically to collect these failures.

Example (log):

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x4d0537d]

goroutine 1 [running]:
go/types.init.2()
	/Users/swarming/.swarming/w/ir/x/w/goroot/src/go/types/universe.go:282 +0x1dd
FAIL	golang.org/x/tools/go/analysis/passes/loopclosure	0.030s

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 27, 2025
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/analysis/passes/loopclosure" && test == ""
2025-01-27 04:28 x_tools-go1.24-darwin-amd64_14 tools@edafbe5d release-branch.go1.24@8a4c24f9 x/tools/go/analysis/passes/loopclosure (log)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x4d0537d]

goroutine 1 [running]:
go/types.init.2()
	/Users/swarming/.swarming/w/ir/x/w/goroot/src/go/types/universe.go:282 +0x1dd
FAIL	golang.org/x/tools/go/analysis/passes/loopclosure	0.030s

watchflakes

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jan 27, 2025
@gopherbot gopherbot added this to the Unreleased milestone Jan 27, 2025
@adonovan
Copy link
Member

adonovan commented Jan 27, 2025

Building the same text with the same toolchain, stack shows only this line in the package initializer for go/types:

  universe.go:282       0x1227373               b904000000              MOVL $0x4, CX                                       
  universe.go:282       0x1227378               e82307feff              CALL go/types.(*Scope).Lookup(SB)                       
  universe.go:282       0x122737d               488b5050                MOVQ 0x50(AX), DX    <--- return pc here                                          

Not sure what conclusion to draw from the lack of a frame for Lookup in the backtrace.

In any case, this early-stage initializer failure looks like a compiler or runtime issue.

@adonovan adonovan added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jan 27, 2025
@adonovan adonovan changed the title x/tools/go/analysis/passes/loopclosure: unrecognized failures runtime: spurious SEGV in package initializer (darwin/amd64) Jan 27, 2025
@cherrymui
Copy link
Member

Not sure what conclusion to draw from the lack of a frame for Lookup in the backtrace.

It is probably that this is actually the fault PC, not a return PC. The faulting address is 0x50, and this instruction is loading from 0x50(AX), which suggests AX is 0, i.e. Lookup returns 0.

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. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
Status: No status
Status: No status
Development

No branches or pull requests

3 participants