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: for range loop reading past slice end [1.13 backport] #40500

Closed
gopherbot opened this issue Jul 30, 2020 · 10 comments
Closed

cmd/compile: for range loop reading past slice end [1.13 backport] #40500

gopherbot opened this issue Jul 30, 2020 · 10 comments
Labels
CherryPickApproved FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 30, 2020

@randall77 requested issue #40367 to be considered for backport to the next 1.13 minor release.

@gopherbot, please open backport issues for 1.14 and 1.13.

@gopherbot gopherbot added the CherryPickCandidate label Jul 30, 2020
@gopherbot gopherbot added this to the Go1.13.15 milestone Jul 30, 2020
@randall77
Copy link
Contributor

@randall77 randall77 commented Jul 30, 2020

This is a rare but serious miscompilation, where loop end conditions aren't respected.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jul 30, 2020

Change https://golang.org/cl/245957 mentions this issue: [release-branch.go1.13] cmd/compile: don't addLocalInductiveFacts if there is no direct edge from if block to phi block

@cagedmantis cagedmantis added the CherryPickApproved label Jul 30, 2020
@gopherbot gopherbot removed the CherryPickCandidate label Jul 30, 2020
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jul 30, 2020

This has been approved since it is a serious issue without any known workarounds.

@BLasan
Copy link

@BLasan BLasan commented Aug 1, 2020

Is this still opened ? @gopherbot

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Aug 1, 2020

@BLasan This issue is still open because the change has not been submitted.

@BLasan
Copy link

@BLasan BLasan commented Aug 2, 2020

@ianlancetaylor /assign me

@BLasan
Copy link

@BLasan BLasan commented Aug 2, 2020

@BLasan This issue is still open because the change has not been submitted.

Can I work on this?

@randall77
Copy link
Contributor

@randall77 randall77 commented Aug 2, 2020

@BLasan Sorry, there's nothing left to do on this particular issue. All that needs to happen is to merge CL 245957 into the release branch. Whoever packages up the next 1.13 point release will do that.

The actual work for making inductive variable detection better is #40502 . There's already one CL for that, but if you're interested in the prove code there might be other improvements to be had. Or look at other prove improvement issues.

@BLasan
Copy link

@BLasan BLasan commented Aug 2, 2020

@BLasan Sorry, there's nothing left to do on this particular issue. All that needs to happen is to merge CL 245957 into the release branch. Whoever packages up the next 1.13 point release will do that.

The actual work for making inductive variable detection better is #40502 . There's already one CL for that, but if you're interested in the prove code there might be other improvements to be had. Or look at other prove improvement issues.

Thanks for the update. I'll pickup a issue from the link you provide

gopherbot pushed a commit that referenced this issue Aug 3, 2020
…there is no direct edge from if block to phi block

Currently in addLocalInductiveFacts, we only check whether
direct edge from if block to phi block exists. If not, the
following logic will treat the phi block as the first successor,
which is wrong.

This patch makes prove pass more conservative, so we disable
some cases in test/prove.go. We will do some optimization in
the following CL and enable these cases then.

Fixes #40500.

Change-Id: I27cf0248f3a82312a6f7dabe11c79a1a34cf5412
Reviewed-on: https://go-review.googlesource.com/c/go/+/244579
Reviewed-by: Zach Jones <zachj1@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/245957
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Aug 3, 2020

Closed by merging 5ebdfd9 to release-branch.go1.13.

@toothrot toothrot removed this from the Go1.13.15 milestone Aug 6, 2020
@toothrot toothrot added this to the Go1.13.16 milestone Aug 6, 2020
@golang golang locked and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

6 participants