-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: unexpected nil pointer dereferences since map dynamic entry changes #31782
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
Comments
Yes, this is a dup of #31777. I'll close this one, but the test case should be very useful. |
Sounds like the proposed fix to #31777 may not handle this. Reopening until we have confirmed that this is fixed and has a test. |
@randall77 @josharian the problem seems to be this line in OMAPLIT order:
The old code requires a temp, so that mapassign1 can have addressable key, elem:
How can we archive the same behavior for order? |
Hmmm, order.go should allocate those temporaries, the |
Change https://golang.org/cl/174837 mentions this issue: |
Not yet fully minimized, but here's some progress:
This used to print |
Standalone test file:
Used to print |
More minimal:
Should print |
That's about as far as I think I have time to dig into this at the moment. @randall77 or @cuonglm , do you mind investigating further? |
@mdempsky /me will take a look shortly. Sounds like it dues changes in isStaticCompositeLiteral. |
Just slightly more reduced: package main
type foo struct {
i interface{}
_, _ interface{}
}
func main() {
z := foo{i: 42}.i
println(z.(int))
} Playing with the other fields in |
@mdempsky @mark-rushakoff I'm running dist test before submit the patch. I think my assumption is right. The |
@mark-rushakoff with newest patch in CL, I can run the test and both examples run without panic. |
Confirmed that the behavior is fixed on tip. Thank you! |
I wasn't sure if this belonged in runtime, cmd/go, or somewhere else -- please retitle as appropriate.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This does not reproduce with
go version go1.12.3 darwin/amd64
.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran the tests for github.com/influxdata/flux:
What did you expect to see?
Tests passing like with go 1.12.3.
What did you see instead?
A panic:
I bisected go to 85387aa as the first build where this panics. Using its parent commit, 70b890c, the tests pass.
Then I noticed #31777, a separate issue filed related to that bisected commit. I tried checking out master of go (b098c0f) and locally applying the change in https://golang.org/cl/174777, but the panic still occurred.
Unfortunately I do not have time right now to come up with a more minimal repro case.
/cc @randall77
The text was updated successfully, but these errors were encountered: