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

runtime: unexpected fault address 0 [1.22 backport] #67258

Closed
gopherbot opened this issue May 8, 2024 · 3 comments
Closed

runtime: unexpected fault address 0 [1.22 backport] #67258

gopherbot opened this issue May 8, 2024 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link

@randall77 requested issue #67255 to be considered for backport to the next 1.22 minor release.

@gopherbot please open a backport issue for 1.22.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label May 8, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 8, 2024
@gopherbot gopherbot added this to the Go1.22.4 milestone May 8, 2024
@randall77
Copy link
Contributor

This causes a serious runtime crash in certain instances of append(s, make([]T, n)...) where n is 0.

A workaround by adding n!=0 checks is possible, but it would be difficult to find all such cases.

@gopherbot
Copy link
Author

Change https://go.dev/cl/584315 mentions this issue: [release-branch.go1.22] cmd/compile: avoid past-the-end pointer when zeroing

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels May 15, 2024
gopherbot pushed a commit that referenced this issue May 15, 2024
…zeroing

When we optimize append(s, make([]T, n)...), we have to be careful
not to pass &s[0] + len(s)*sizeof(T) as the argument to memclr, as that
pointer might be past-the-end. This can only happen if n is zero, so
just special-case n==0 in the generated code.

Fixes #67258

Change-Id: Ic680711bb8c38440eba5e759363ef65f5945658b
Reviewed-on: https://go-review.googlesource.com/c/go/+/584116
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
(cherry picked from commit 93e3696)
Reviewed-on: https://go-review.googlesource.com/c/go/+/584315
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
@gopherbot
Copy link
Author

Closed by merging 3a84293 to release-branch.go1.22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

3 participants