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: "runtime: bad pointer in frame" in riscv64 with complier optimizations [1.16 backport] #51198

gopherbot opened this issue Feb 14, 2022 · 2 comments


Copy link

@gopherbot gopherbot commented Feb 14, 2022

@cherrymui requested issue #51101 to be considered for backport to the next 1.16 minor release.

@gopherbot please backport this to previous releases. This can cause runtime crashes.

@gopherbot gopherbot added the CherryPickCandidate label Feb 14, 2022
@gopherbot gopherbot added this to the Go1.16.15 milestone Feb 14, 2022
@dmitshur dmitshur added CherryPickApproved and removed CherryPickCandidate labels Feb 16, 2022
Copy link

@gopherbot gopherbot commented Feb 17, 2022

Change mentions this issue: [release-branch.go1.16] cmd/compile: correct type of pointer difference on RISCV64

Copy link

@gopherbot gopherbot commented Feb 18, 2022

Closed by merging a222963 to release-branch.go1.16.

gopherbot pushed a commit that referenced this issue Feb 18, 2022
…ce on RISCV64

Pointer comparison is lowered to the following on RISCV64

(EqPtr x y) => (SEQZ (SUB <x.Type> x y))

The difference of two pointers (the SUB) should not be pointer
type. Otherwise it can cause the GC to find a bad pointer.

Updates #51101.
Fixes #51198.

Change-Id: I7e73c2155c36ff403c032981a9aa9cccbfdf0f64
Trust: Cherry Mui <>
Run-TryBot: Cherry Mui <>
Reviewed-by: Keith Randall <>
TryBot-Result: Gopher Robot <>
(cherry picked from commit 1ed30ca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants