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

cmd/compile/internal/SSA: panic in Compile on linux-amd64-noopt #54906

Closed
bcmills opened this issue Sep 6, 2022 · 8 comments
Closed

cmd/compile/internal/SSA: panic in Compile on linux-amd64-noopt #54906

bcmills opened this issue Sep 6, 2022 · 8 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Sep 6, 2022

greplogs -l -e 'goroutine \d+ \[running\]:\nruntime\.throw(?:.+\n\t.+\n)*cmd/compile/internal/ssa\.Compile' --since=2022-01-01
2022-08-19T19:39:48-9a1d3b0/linux-amd64-noopt

goroutine 1 [running]:
runtime.throw({0x11a6896?, 0x10?})
	/workdir/go/src/runtime/panic.go:1047 +0x5d fp=0xc00048cf68 sp=0xc00048cf38 pc=0x43cd7d
runtime.sigpanic()
	/workdir/go/src/runtime/signal_unix.go:844 +0x1ca fp=0xc00048cf98 sp=0xc00048cf68 pc=0x453faa
math/rand.(*Rand).Int63(0xc00074e660)
	/workdir/go/src/math/rand/rand.go:84 +0x38 fp=0xc00048cfc0 sp=0xc00048cf98 pc=0x5ea1b8
math/rand.(*Rand).Int31(0xc00074e660)
	/workdir/go/src/math/rand/rand.go:98 +0x2b fp=0xc00048cfe8 sp=0xc00048cfc0 pc=0x5ea32b
math/rand.(*Rand).Int31n(0xc00074e660, 0x2f)
	/workdir/go/src/math/rand/rand.go:133 +0x93 fp=0xc00048d018 sp=0xc00048cfe8 pc=0x5ea5b3
math/rand.(*Rand).Intn(0xc00074e660, 0x2f)
	/workdir/go/src/math/rand/rand.go:171 +0x53 fp=0xc00048d050 sp=0xc00048d018 pc=0x5ea7b3
cmd/compile/internal/ssa.Compile(0xc000583520)
	/workdir/go/src/cmd/compile/internal/ssa/compile.go:91 +0x14f0 fp=0xc000490fd8 sp=0xc00048d050 pc=0x8acdb0
cmd/compile/internal/ssagen.buildssa(0xc000567cc0, 0x0)
	/workdir/go/src/cmd/compile/internal/ssagen/ssa.go:573 +0x224a fp=0xc0004917b0 sp=0xc000490fd8 pc=0xe2f5aa
cmd/compile/internal/ssagen.Compile(0xc000567cc0, 0x0)
	/workdir/go/src/cmd/compile/internal/ssagen/pgen.go:183 +0x3e fp=0xc000491928 sp=0xc0004917b0 pc=0xe2513e
cmd/compile/internal/gc.compileFunctions.func4.1(0x0)
	/workdir/go/src/cmd/compile/internal/gc/compile.go:153 +0x47 fp=0xc000491980 sp=0xc000491928 pc=0x10aad87
cmd/compile/internal/gc.compileFunctions.func2(0xc00074c0a0)
	/workdir/go/src/cmd/compile/internal/gc/compile.go:125 +0x23 fp=0xc000491998 sp=0xc000491980 pc=0x10b0ce3
cmd/compile/internal/gc.compileFunctions.func4({0xc0000f9e00, 0x37, 0x40})
	/workdir/go/src/cmd/compile/internal/gc/compile.go:152 +0x17b fp=0xc000491a18 sp=0xc000491998 pc=0x10aacdb
cmd/compile/internal/gc.compileFunctions()
	/workdir/go/src/cmd/compile/internal/gc/compile.go:163 +0x1f2 fp=0xc000491a90 sp=0xc000491a18 pc=0x10aaa52
cmd/compile/internal/gc.Main(0x11dd308)
	/workdir/go/src/cmd/compile/internal/gc/main.go:301 +0x178c fp=0xc000491ed8 sp=0xc000491a90 pc=0x10ad1cc
main.main()
	/workdir/go/src/cmd/compile/main.go:57 +0x171 fp=0xc000491f80 sp=0xc000491ed8 pc=0x10e5911
runtime.main()
	/workdir/go/src/runtime/proc.go:250 +0x1d3 fp=0xc000491fe0 sp=0xc000491f80 pc=0x43f4d3
runtime.goexit()
	/workdir/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000491fe8 sp=0xc000491fe0 pc=0x472061

(attn @golang/compiler)

@bcmills
Copy link
Contributor Author

bcmills commented Sep 6, 2022

Needs a broader regexp:
greplogs -l -e 'goroutine \d+ \[running\]:\n(?:panic|runtime\.throw)(?:.+\n\t.+\n)*cmd/compile/internal/ssa\.Compile' --since=2022-01-01
2022-08-22T15:01:45-fc34fdb/linux-amd64-noopt
2022-08-19T19:39:48-9a1d3b0/linux-amd64-noopt

Looks like a possible Go 1.20 regression.

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker compiler/runtime Issues related to the Go compiler and/or runtime. labels Sep 6, 2022
@bcmills bcmills added this to the Go1.20 milestone Sep 6, 2022
@mdempsky
Copy link
Contributor

mdempsky commented Sep 7, 2022

I think the problem is the compiler itself has been miscompiled, or the runtime version its using is buggy.

The first one (involving math/rand) is in debugging code that's only enabled by -d=ssa/check/on or similar, and it failed in a test case that doesn't use that flag.

The second one appears to be sigpanicking on a time.Now() call.

@aclements
Copy link
Member

Possibly the same as #54779?

@cherrymui
Copy link
Member

test/run.go adds -d=ssa/check/on for errorcheck tests https://cs.opensource.google/go/go/+/master:test/run.go;l=682
So at least the checkEnabled boolean condition is correct. It is still weird that it panics in math/rand though...

@bcmills
Copy link
Contributor Author

bcmills commented Sep 14, 2022

greplogs -l -e 'goroutine \d+ \[running\]:\n(?:panic|runtime\.throw)(?:.+\n\t.+\n)*cmd/compile/internal/ssa\.Compile' --since=2022-08-23
2022-09-08T21:16:39-a9a3982/linux-amd64-noopt
2022-09-08T10:48:29-2960431/linux-amd64-noopt
2022-09-07T06:18:03-e2d8ed2/linux-amd64-noopt

@bcmills
Copy link
Contributor Author

bcmills commented Sep 14, 2022

While we investigate this, is there something we can do to stabilize this build configuration? (Perhaps a change that can be reverted, or an optimization that can be disabled or re-enabled for the noopt flags?)

@cherrymui
Copy link
Member

I haven't been able to identify a commit or the reason that causes the issue. The failure rate is quite low. Still looking.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/431919 mentions this issue: runtime: make mSpanStateBox accessors nosplit

@golang golang locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants