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

internal/bytealg: SIGILL on s390x [1.15 backport] #41595

Closed
gopherbot opened this issue Sep 23, 2020 · 3 comments
Closed

internal/bytealg: SIGILL on s390x [1.15 backport] #41595

gopherbot opened this issue Sep 23, 2020 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@mundaym requested issue #41552 to be considered for backport to the next 1.15 minor release.

@gopherbot Please create backport issue for Go 1.15. This bug means that bytes.IndexAny and bytes.LastIndexAny cause an illegal instruction exception on s390x machines without the vector facility. There is no workaround.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Sep 23, 2020
@gopherbot gopherbot added this to the Go1.15.3 milestone Sep 23, 2020
@gopherbot
Copy link
Author

Change https://golang.org/cl/256921 mentions this issue: [release-branch.go1.15] bytes, internal/bytealg: fix incorrect IndexString usage

@cagedmantis
Copy link
Contributor

Approved because this is a serious issue without a workaround.

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Sep 24, 2020
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Sep 24, 2020
@gopherbot
Copy link
Author

Closed by merging af06e65 to release-branch.go1.15.

gopherbot pushed a commit that referenced this issue Oct 7, 2020
…tring usage

The IndexString implementation in the bytealg package requires that
the string passed into it be in the range '2 <= len(s) <= MaxLen'
where MaxLen may be any value (including 0).

CL 156998 added calls to bytealg.IndexString where MaxLen was not
first checked. This led to an illegal instruction on s390x with
the vector facility disabled.

This CL guards the calls to bytealg.IndexString with a MaxLen check.
If the check fails then the code now falls back to the pre CL 156998
implementation (a loop over the runes in the string).

Since the MaxLen check is now in place the generic implementation is
no longer called so I have returned it to its original unimplemented
state.

In future we may want to drop MaxLen to prevent this kind of
confusion.

Fixes #41595.

Change-Id: I81d88cf8c5ae143a8f5f460d18f8269cb6c0f28c
Reviewed-on: https://go-review.googlesource.com/c/go/+/256921
Trust: Michael Munday <mike.munday@ibm.com>
Run-TryBot: Michael Munday <mike.munday@ibm.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
claucece pushed a commit to claucece/go that referenced this issue Oct 22, 2020
…tring usage

The IndexString implementation in the bytealg package requires that
the string passed into it be in the range '2 <= len(s) <= MaxLen'
where MaxLen may be any value (including 0).

CL 156998 added calls to bytealg.IndexString where MaxLen was not
first checked. This led to an illegal instruction on s390x with
the vector facility disabled.

This CL guards the calls to bytealg.IndexString with a MaxLen check.
If the check fails then the code now falls back to the pre CL 156998
implementation (a loop over the runes in the string).

Since the MaxLen check is now in place the generic implementation is
no longer called so I have returned it to its original unimplemented
state.

In future we may want to drop MaxLen to prevent this kind of
confusion.

Fixes golang#41595.

Change-Id: I81d88cf8c5ae143a8f5f460d18f8269cb6c0f28c
Reviewed-on: https://go-review.googlesource.com/c/go/+/256921
Trust: Michael Munday <mike.munday@ibm.com>
Run-TryBot: Michael Munday <mike.munday@ibm.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

2 participants