-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: nil pointer dereference #47892
Comments
I'm not able to reproduce at tip (I get a compile error, not an ICE, which is expected). |
I am still getting the error, at I will see if I can narrow it down to a smaller case. |
Not sure if it is related (but looks likely). The attached smaller self contained example gives this
|
I can confirm that the attached example above still crashes after the last round of typeparams fixes, with the same traceback. scott@pavillion 47892 % go version @randall77 are you still waiting for info? |
Change https://golang.org/cl/345229 mentions this issue: |
smaller:
|
Thanks! the CL above crashes for me on test/typeparams/mdemsky/{7,12}.go |
I upload a new patch which should fix that. |
@scott-cotton Sorry, I've tried all of your test cases, and I'm not able to reproduce it locally either. |
@mdempsky thanks much for trying. I just used gotip instead of git pull; ./all.bash and the compile seems to work ok. Not sure if it was my repo or not, but no further need to investigate IMO. Thanks all |
This issue has been fixed in https://golang.org/cl/345411 Fixes: #47892 Change-Id: I13dd3814650913da065e5f24a0c61d30adb0633a Reviewed-on: https://go-review.googlesource.com/c/go/+/345229 Reviewed-by: Dan Scales <danscales@google.com> Trust: Dan Scales <danscales@google.com> Trust: Keith Randall <khr@golang.org> Trust: Alberto Donizetti <alb.donizetti@gmail.com> Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
tried to build the package "memory" in the dev.typeparams branch of GitHub.com/go-air/pal
What did you expect to see?
not sure, either a compile error or success.
What did you see instead?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x11f197b]
goroutine 1 [running]:
cmd/compile/internal/typecheck.(*crawler).checkGenericType(0xc000bb5c70, 0x11b0b47)
/Users/scott/Dev/goroot/src/cmd/compile/internal/typecheck/crawler.go:227 +0x3b
cmd/compile/internal/typecheck.(*crawler).markInlBody.func1({0x1a5f758, 0xc000bb5c70})
/Users/scott/Dev/goroot/src/cmd/compile/internal/typecheck/crawler.go:201 +0xb2
cmd/compile/internal/ir.Visit.func1({0x1a5f758, 0xc000bb5c70})
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.(*StructKeyExpr).doChildren(0xc000bbf270, 0xc000717f38)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/node_gen.go:1264 +0x62
cmd/compile/internal/ir.DoChildren(...)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a60310, 0xc000bbf270})
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc00092ae10, 0x3, 0x11be217}, 0xc000717f38)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*CompLitExpr).doChildren(0xc0001c7880, 0xc000717f38)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/node_gen.go:392 +0x99
cmd/compile/internal/ir.DoChildren(...)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a5e560, 0xc0001c7880})
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.(*AddrExpr).doChildren(0xc000bbf2c0, 0xc000717f38)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/node_gen.go:44 +0x62
cmd/compile/internal/ir.DoChildren(...)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a5da70, 0xc000bbf2c0})
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.(*AssignStmt).doChildren(0xc000bbf360, 0xc000717f38)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/node_gen.go:152 +0x82
cmd/compile/internal/ir.DoChildren(...)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a5dd90, 0xc000bbf360})
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a5dd90, 0xc000bbf360}, 0xc000717f20)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.VisitList({0xc0001c7980, 0x7, 0xc000722b10}, 0xc00012ecb0)
/Users/scott/Dev/goroot/src/cmd/compile/internal/ir/visit.go:114 +0x65
cmd/compile/internal/typecheck.(*crawler).markInlBody(0xc000e45530, 0xc00012ecb0)
/Users/scott/Dev/goroot/src/cmd/compile/internal/typecheck/crawler.go:217 +0x22d
cmd/compile/internal/typecheck.(*crawler).markObject(0xc0000a2ed0, 0xc000bb5ad0)
/Users/scott/Dev/goroot/src/cmd/compile/internal/typecheck/crawler.go:35 +0x2f
cmd/compile/internal/typecheck.crawlExports({0xc000626e00, 0x1c, 0x10de473})
/Users/scott/Dev/goroot/src/cmd/compile/internal/typecheck/crawler.go:23 +0x9f
cmd/compile/internal/typecheck.WriteExports({0x1a456e0, 0xc000722ab0}, 0x1)
/Users/scott/Dev/goroot/src/cmd/compile/internal/typecheck/iexport.go:273 +0x65
cmd/compile/internal/noder.WriteExports(0xc000e454c0)
/Users/scott/Dev/goroot/src/cmd/compile/internal/noder/export.go:40 +0x7a
cmd/compile/internal/gc.dumpCompilerObj(0xc000e454c0)
/Users/scott/Dev/goroot/src/cmd/compile/internal/gc/obj.go:107 +0x28
cmd/compile/internal/gc.dumpobj1({0x206371401, 0x50}, 0x3)
/Users/scott/Dev/goroot/src/cmd/compile/internal/gc/obj.go:63 +0x185
cmd/compile/internal/gc.dumpobj()
/Users/scott/Dev/goroot/src/cmd/compile/internal/gc/obj.go:44 +0x36
cmd/compile/internal/gc.Main(0x1918b50)
/Users/scott/Dev/goroot/src/cmd/compile/internal/gc/main.go:322 +0x10d6
main.main()
/Users/scott/Dev/goroot/src/cmd/compile/main.go:55 +0xdd
The text was updated successfully, but these errors were encountered: