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: unexpected nil dereference on s390x [1.14 backport] #38443

Closed
gopherbot opened this issue Apr 14, 2020 · 6 comments
Closed

cmd/compile: unexpected nil dereference on s390x [1.14 backport] #38443

gopherbot opened this issue Apr 14, 2020 · 6 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 14, 2020

@mundaym requested issue #38195 to be considered for backport to the next 1.14 minor release.

@gopherbot please consider this for a backport

This is a bug in the register allocator that results in the compiled program behaving incorrectly. There is currently no workaround and it results in very hard to debug issues. It has only been seen to cause problems on s390x but theoretically it affects all platforms.

@andybons
Copy link
Member

@andybons andybons commented Apr 27, 2020

@mundaym which CLs from the parent issue would you like to see backported?

@randall77 do you consider this a serious issue with no workaround as described above?

@randall77
Copy link
Contributor

@randall77 randall77 commented Apr 27, 2020

I believe only CL 228061 is required. Michael, please confirm.

Yes, we should backport. This is a rare issue but is serious. It can lead to arbitrary bad execution.

@andybons
Copy link
Member

@andybons andybons commented Apr 27, 2020

@randall77 thanks, Keith. Approved. Feel free to create the backport CLs for 1.14 and 1.13 per https://golang.org/wiki/MinorReleases.

@mundaym
Copy link
Member

@mundaym mundaym commented Apr 27, 2020

I believe only CL 228061 is required. Michael, please confirm.

Yes, that is correct. The other CL is just an extra check to avoid a regression in future releases.

Feel free to create the backport CLs for 1.14 and 1.13 per https://golang.org/wiki/MinorReleases.

Thanks Andy and Keith. I'll do that now.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Apr 27, 2020

Change https://golang.org/cl/230357 mentions this issue: [release-branch.go1.14] cmd/compile: fix deallocation of live value copies in regalloc

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Apr 28, 2020

Closed by merging c4b9269 to release-branch.go1.14.

@gopherbot gopherbot closed this Apr 28, 2020
gopherbot pushed a commit that referenced this issue Apr 28, 2020
…opies in regalloc

When deallocating the input register to a phi so that the phi
itself could be allocated to that register the code was also
deallocating all copies of that phi input value. Those copies
of the value could still be live and if they were the register
allocator could reuse them incorrectly to hold speculative
copies of other phi inputs. This causes strange bugs.

No test because this is a very obscure scenario that is hard
to replicate but CL 228060 adds an assertion to the compiler
that does trigger when running the std tests on linux/s390x
without this CL applied. Hopefully that assertion will prevent
future regressions.

Fixes #38443.

Change-Id: Id975dadedd731c7bb21933b9ea6b17daaa5c9e1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/228061
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 382fe3e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/230357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.