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 compiler error: assertion failed #60991

Closed
ALTree opened this issue Jun 25, 2023 · 1 comment
Closed

cmd/compile: internal compiler error: assertion failed #60991

ALTree opened this issue Jun 25, 2023 · 1 comment
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented Jun 25, 2023

$ gotip version
go version devel go1.21-a031f4e Sat Jun 24 05:24:25 2023 +0000 linux/amd64
package p

import "math"

func f() float64 {
	return min(0.7, 0.5, math.Sqrt(2))
}
$ gotip build crash.go 

# command-line-arguments
<unknown line number>: internal compiler error: assertion failed

goroutine 1 [running]:
runtime/debug.Stack()
	./gotip/src/runtime/debug/stack.go:24 +0x5e
cmd/compile/internal/base.FatalfAt({0xec8058?, 0x0?}, {0xd750ed, 0x10}, {0x0, 0x0, 0x0})
	./gotip/src/cmd/compile/internal/base/print.go:230 +0x1d7
cmd/compile/internal/base.Fatalf(...)
	./gotip/src/cmd/compile/internal/base/print.go:199
cmd/compile/internal/base.Assert(...)
	./gotip/src/cmd/compile/internal/base/print.go:242
cmd/compile/internal/noder.assert(...)
	./gotip/src/cmd/compile/internal/noder/stencil.go:15
cmd/compile/internal/noder.idealType({{0xec61c0, 0x139f9c0}, {0xec8058, 0xc00041b240}, 0x8})
	./gotip/src/cmd/compile/internal/noder/helpers.go:232 +0x11b
cmd/compile/internal/noder.(*writer).expr(0xc000426630, {0xec88a0?, 0xc0003df360?})
	./gotip/src/cmd/compile/internal/noder/writer.go:1657 +0x772
cmd/compile/internal/noder.(*writer).convertExpr(0xc000426630, {0xec61c0, 0x139f8c0}, {0xec88a0?, 0xc0003df360}, 0x1)
	./gotip/src/cmd/compile/internal/noder/writer.go:2136 +0x2df
cmd/compile/internal/noder.(*writer).implicitConvExpr(...)
	./gotip/src/cmd/compile/internal/noder/writer.go:2112
cmd/compile/internal/noder.(*writer).multiExpr(0xc000426630, {0xec5118, 0xc00012a930}, 0xc000424bd8, {0xc0003f3b00, 0x3, 0x413865?})
	./gotip/src/cmd/compile/internal/noder/writer.go:2104 +0x22d
cmd/compile/internal/noder.(*writer).expr(0xc000426630, {0xec85e0?, 0xc00012a930?})
	./gotip/src/cmd/compile/internal/noder/writer.go:1941 +0x1c57
cmd/compile/internal/noder.(*writer).convertExpr(0xc000426630, {0xec61c0, 0x139f8c0}, {0xec85e0?, 0xc00012a930}, 0x1)
	./gotip/src/cmd/compile/internal/noder/writer.go:2121 +0x12a
cmd/compile/internal/noder.(*writer).implicitConvExpr(...)
	./gotip/src/cmd/compile/internal/noder/writer.go:2112
cmd/compile/internal/noder.(*writer).multiExpr(0xc000426630, {0xec52f8, 0xc000039320}, 0xc000424fd8, {0xc000424fc8, 0x1, 0x411b05?})
	./gotip/src/cmd/compile/internal/noder/writer.go:2104 +0x22d
cmd/compile/internal/noder.(*writer).stmt1(0xc000426630, {0xec7548?, 0xc000039320?})
	./gotip/src/cmd/compile/internal/noder/writer.go:1296 +0x5f8
cmd/compile/internal/noder.(*writer).stmts(0xc000426630, {0xc0000366e0, 0x1, 0x0?})
	./gotip/src/cmd/compile/internal/noder/writer.go:1211 +0x65
cmd/compile/internal/noder.(*pkgWriter).bodyIdx(0xc000002780, 0xc00041b140, 0xc0003f3ac0, 0xc0001145a0)
	./gotip/src/cmd/compile/internal/noder/writer.go:1117 +0x186
cmd/compile/internal/noder.(*writer).funcExt(0xc000426160, 0xc00012acb0)
	./gotip/src/cmd/compile/internal/noder/writer.go:1055 +0x308
cmd/compile/internal/noder.(*writer).doObj(0xc0004260b0, 0xc00041c1e0?, {0xecc9c0, 0xc00012acb0?})
	./gotip/src/cmd/compile/internal/noder/writer.go:815 +0x1fc
cmd/compile/internal/noder.(*pkgWriter).objIdx(0xc000002780, {0xecc9c0, 0xc00012acb0})
	./gotip/src/cmd/compile/internal/noder/writer.go:774 +0x572
cmd/compile/internal/noder.(*pkgWriter).objInstIdx(0x13907b0?, {0xecc9c0, 0xc00012acb0}, 0x0, 0x1?)
	./gotip/src/cmd/compile/internal/noder/writer.go:715 +0xf4
cmd/compile/internal/noder.(*writer).obj(...)
	./gotip/src/cmd/compile/internal/noder/writer.go:691
cmd/compile/internal/noder.writePkgStub({0x0?, {0x0?, 0x0?}}, {0xc000050460, 0x1, 0x1})
	./gotip/src/cmd/compile/internal/noder/unified.go:231 +0x615
cmd/compile/internal/noder.unified({0x0?, {0x0?, 0x0?}}, {0xc000050460?, 0xcb9f00?, 0xc0001398f8?})
	./gotip/src/cmd/compile/internal/noder/unified.go:75 +0x85
cmd/compile/internal/noder.LoadPackage({0xc0000221f0, 0x1, 0x1})
	./gotip/src/cmd/compile/internal/noder/noder.go:77 +0x450
cmd/compile/internal/gc.Main(0xda3108)
	./gotip/src/cmd/compile/internal/gc/main.go:198 +0xc17
main.main()
	./gotip/src/cmd/compile/main.go:57 +0xf9

cc @randall77 @mdempsky

@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. compiler/runtime Issues related to the Go compiler and/or runtime. labels Jun 25, 2023
@cuonglm cuonglm self-assigned this Jun 25, 2023
@cuonglm cuonglm added this to the Go1.21 milestone Jun 25, 2023
@gopherbot
Copy link

Change https://go.dev/cl/506055 mentions this issue: types2, go/types: record final type for min/max arguments

@griesemer griesemer added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 25, 2023
bradfitz pushed a commit to tailscale/go that referenced this issue Jul 15, 2023
Fixes golang#60991

Change-Id: I6130ccecbdc209996dbb376491be9df3b8988327
Reviewed-on: https://go-review.googlesource.com/c/go/+/506055
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
awly pushed a commit to tailscale/go that referenced this issue Feb 7, 2024
Fixes golang#60991

Change-Id: I6130ccecbdc209996dbb376491be9df3b8988327
Reviewed-on: https://go-review.googlesource.com/c/go/+/506055
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
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. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants