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: ICE building issue5162.go on linux-amd64-noopt #54779

Closed
heschi opened this issue Aug 30, 2022 · 10 comments
Closed

cmd/compile: ICE building issue5162.go on linux-amd64-noopt #54779

heschi opened this issue Aug 30, 2022 · 10 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. release-blocker
Milestone

Comments

@heschi
Copy link
Contributor

heschi commented Aug 30, 2022

2022-08-23T20:24:43-723a279/linux-amd64-noopt

# go run run.go -- fixedbugs/issue5162.go
exit status 2
# command-line-arguments
../../tmp/797079598/tmp__.go:16136:27: internal compiler error: bvset: index 0 is out of bounds with length 0

cc @golang/runtime

@heschi heschi added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 30, 2022
@heschi heschi added this to the Backlog milestone Aug 30, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 30, 2022
@randall77
Copy link
Contributor

randall77 commented Aug 30, 2022

I'm not sure how this could happen. This appears to happen when compiling the main routine, which is just

func main() {
   call1()
   call2()
   ...
   callN()
}

Then out of nowhere the liveness analysis tries to add a local variable of type string to the pointer bitmap. Not sure where that variable comes from - there shouldn't be any local variables in this situation. The error is because there's no room in the bitmap for such a thing - the bitmap is 0 length.
Strange.

I can't reproduce. Not sure if there's anything to be done other than to see if it happens again.

@randall77 randall77 added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 30, 2022
@randall77 randall77 self-assigned this Aug 30, 2022
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 31, 2022
@gopherbot gopherbot removed the NeedsFix The path to resolution is known, but the work has not been done. label Aug 31, 2022
@heschi
Copy link
Contributor Author

heschi commented Sep 1, 2022

Another strange failure on noopt:

https://build.golang.org/log/ea4753ef9daf73937e1434aff8161e8cf7d600a9

# internal/profile [internal/profile.test]
panic: runtime error: index out of range [805] with length 0

goroutine 93 [running]:
panic({0x115cb00, 0xc00002dce0})
	/workdir/go/src/runtime/panic.go:987 +0x3cc fp=0xc001196940 sp=0xc001196880 pc=0x43c9ec
runtime.goPanicIndex(0x325, 0x0)
	/workdir/go/src/runtime/panic.go:113 +0x7f fp=0xc001196980 sp=0xc001196940 pc=0x43aa7f
cmd/compile/internal/ssa.AutoVar(0xc000f96030)
	/workdir/go/src/cmd/compile/internal/ssa/value.go:553 +0x34a fp=0xc001196ab8 sp=0xc001196980 pc=0xdeacea
cmd/compile/internal/liveness.affectedVar(0xc000f96030)
	/workdir/go/src/cmd/compile/internal/liveness/plive.go:323 +0x85 fp=0xc001196c08 sp=0xc001196ab8 pc=0xdfb585
cmd/compile/internal/liveness.(*liveness).valueEffects(0xc0005e6f00, 0xc000f96030)
	/workdir/go/src/cmd/compile/internal/liveness/plive.go:254 +0x65 fp=0xc001196cb8 sp=0xc001196c08 pc=0xdfb1c5
cmd/compile/internal/liveness.(*liveness).prologue(0xc0005e6f00)
	/workdir/go/src/cmd/compile/internal/liveness/plive.go:642 +0x126 fp=0xc001196dc8 sp=0xc001196cb8 pc=0xdfdd06
cmd/compile/internal/liveness.Compute(0xc00052f7c0, 0xc000093d40, 0x0, 0xc000691c00)
	/workdir/go/src/cmd/compile/internal/liveness/plive.go:1338 +0x176 fp=0xc001196ff0 sp=0xc001196dc8 pc=0xe041d6
cmd/compile/internal/ssagen.genssa(0xc000093d40, 0xc000691c00)
	/workdir/go/src/cmd/compile/internal/ssagen/ssa.go:6894 +0x158 fp=0xc001197dd0 sp=0xc001196ff0 pc=0xe4d7b8
cmd/compile/internal/ssagen.Compile(0xc00052f7c0, 0x0)
	/workdir/go/src/cmd/compile/internal/ssagen/pgen.go:197 +0x331 fp=0xc001197f48 sp=0xc001197dd0 pc=0xe10f11
cmd/compile/internal/gc.compileFunctions.func4.1(0x0)
	/workdir/go/src/cmd/compile/internal/gc/compile.go:153 +0x47 fp=0xc001197fa0 sp=0xc001197f48 pc=0x1092d87
cmd/compile/internal/gc.compileFunctions.func3.1()
	/workdir/go/src/cmd/compile/internal/gc/compile.go:140 +0x52 fp=0xc001197fe0 sp=0xc001197fa0 pc=0x1092f32
runtime.goexit()
	/workdir/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc001197fe8 sp=0xc001197fe0 pc=0x472261
created by cmd/compile/internal/gc.compileFunctions.func3
	/workdir/go/src/cmd/compile/internal/gc/compile.go:138 +0xa5

@bcmills
Copy link
Member

bcmills commented Sep 6, 2022

https://build.golang.org/log/a47c465045059703073a129d4ca97d6da963bd1e:

# net [syscall.test]
<autogenerated>:1: internal compiler error: bvset: index 0 is out of bounds with length 0


goroutine 522 [running]:
runtime/debug.Stack()
	/workdir/go/src/runtime/debug/stack.go:24 +0x7a
cmd/compile/internal/base.FatalfAt({0x1, 0x1000}, {0x11bd50f, 0x30}, {0xc0030268f0, 0x2, 0x2})
	/workdir/go/src/cmd/compile/internal/base/print.go:227 +0x22a
cmd/compile/internal/base.Fatalf({0x11bd50f, 0x30}, {0xc0030268f0, 0x2, 0x2})
	/workdir/go/src/cmd/compile/internal/base/print.go:196 +0x56
cmd/compile/internal/bitvec.BitVec.Set({0x0, {0x17782c0, 0x0, 0x0}}, 0x0)
	/workdir/go/src/cmd/compile/internal/bitvec/bv.go:81 +0x14d
cmd/compile/internal/typebits.Set(0xc000370770, 0x0, {0x0, {0x17782c0, 0x0, 0x0}})
	/workdir/go/src/cmd/compile/internal/typebits/typebits.go:38 +0x607
cmd/compile/internal/liveness.(*liveness).pointerMap(0xc00320a000, {0xc, {0xc000b6c138, 0x1, 0x1}}, {0xc003206000, 0xc, 0x10}, {0x3, {0xc000b6c174, ...}}, ...)
	/workdir/go/src/cmd/compile/internal/liveness/plive.go:433 +0x18f
cmd/compile/internal/liveness.(*liveness).emit(0xc00320a000)
	/workdir/go/src/cmd/compile/internal/liveness/plive.go:1316 +0x625
cmd/compile/internal/liveness.Compute(0xc0005e7b80, 0xc002e4c9c0, 0x0, 0xc003202000)
	/workdir/go/src/cmd/compile/internal/liveness/plive.go:1372 +0x3c5
cmd/compile/internal/ssagen.genssa(0xc002e4c9c0, 0xc003202000)
	/workdir/go/src/cmd/compile/internal/ssagen/ssa.go:6906 +0x158
cmd/compile/internal/ssagen.Compile(0xc0005e7b80, 0x1)
	/workdir/go/src/cmd/compile/internal/ssagen/pgen.go:197 +0x325
cmd/compile/internal/gc.compileFunctions.func4.1(0x1)
	/workdir/go/src/cmd/compile/internal/gc/compile.go:153 +0x47
cmd/compile/internal/gc.compileFunctions.func3.1()
	/workdir/go/src/cmd/compile/internal/gc/compile.go:140 +0x52
created by cmd/compile/internal/gc.compileFunctions.func3
	/workdir/go/src/cmd/compile/internal/gc/compile.go:138 +0xa5

FAIL	syscall [build failed]

@bcmills bcmills removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 6, 2022
@bcmills
Copy link
Member

bcmills commented Sep 6, 2022

Looks like just the two bvset errors so far... but two points makes a line, and so far that line looks to me like a Go 1.20 regression. 😞

greplogs -l -e 'internal compiler error: bvset: index 0'
2022-09-06T16:59:58-e1e88d6/linux-amd64-noopt
2022-08-23T20:24:43-723a279/linux-amd64-noopt

@bcmills bcmills modified the milestones: Backlog, Go1.20 Sep 6, 2022
@cuonglm
Copy link
Member

cuonglm commented Sep 7, 2022

@mknyszek
Copy link
Contributor

mknyszek commented Sep 7, 2022

We're currently thinking this is a runtime issue causing a compilation failure via memory corruption. It's almost certainly related to #54906 and #54907.

@mknyszek mknyszek assigned cherrymui and unassigned randall77 Sep 7, 2022
@mknyszek
Copy link
Contributor

mknyszek commented Sep 7, 2022

@mdempsky also pointed out that the compiler we're running is also noopt.

@cherrymui
Copy link
Member

cherrymui commented Sep 13, 2022

@mknyszek asked whether this is related to #54596 . I tried the experiments there to see if they help here. The answer is no, neither CL there helps, nor disabling async preemption. So it is something else. Still looking.

@prattmic
Copy link
Member

prattmic commented Sep 15, 2022

I looked through the noopt builder on the dashboard, and https://build.golang.org/log/f29160132769be9817908c039fdb7984f61846cb (at https://go.dev/cl/424904) is the earliest "random" failure I see. So the culprit CL is hopefully a nearby parent, though given the low failure rate there are lots of candidates.

@gopherbot
Copy link

gopherbot commented Sep 19, 2022

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

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. release-blocker
Projects
Status: Done
Development

No branches or pull requests

8 participants