-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: some linkname signatures do not match #58440
Comments
To add more detail:
[1] I suspect, though I haven't verified, that we are clobbering the stack slot for |
These are fixed in https://go.dev/cl/466615, which is already merged. |
@gopherbot please open a backport to 1.20 and 1.19. This bug has the opportunity to cause memory corruption in combination with other seemingly innocuous changes. We should backport for safety, as the fix is trivial. |
Backport issue(s) opened: #58441 (for 1.19), #58442 (for 1.20). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
A new instance of this bug was just introduced along with some metrics functionality. It actually changes the type of a function parameter (which is saved in the callee context), but presumably it is still compatible. I think it should be fixed either way. I've posted a patch to fix this here: https://go-review.googlesource.com/c/go/+/470915 |
Change https://go.dev/cl/470915 mentions this issue: |
This signature uses the wrong type for the passed function, which will be saved in the internal runtime map. Since the functions are likely compatible (uint64 return versus int64), this may work but should generally be fixed. This is other instance of #58440. Change-Id: Ied82e554745ef72eefeb5be540605809ffa06533 Reviewed-on: https://go-review.googlesource.com/c/go/+/470915 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Michael Pratt <mpratt@google.com>
The two affected functions are:
What version of Go are you using (
go version
)?go1.19rc2
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?N/A
What did you do?
This was identified as an error by a linkname analyzer. A patch was posted, and a suggestion was made to file a specific bug.
What did you expect to see?
I expected signatures of these functions to match. If they did not, they should at least have the same shape (i.e. they may intentionally mismatch as in the case of runtime.ifaceI2E).
What did you see instead?
They were identical except return values (or lack thereof). This could cause problems with assumptions regarding the stack layout for those calls.
The text was updated successfully, but these errors were encountered: