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: cgoCheckUnknownPointer triggering incorrectly #54558

Closed
rolandshoemaker opened this issue Aug 19, 2022 · 4 comments
Closed

runtime: cgoCheckUnknownPointer triggering incorrectly #54558

rolandshoemaker opened this issue Aug 19, 2022 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rolandshoemaker
Copy link
Member

A flakey test in x/crypto seems to be surfacing an issue with runtime.cgoCheckUnknownPointer, e.g. https://build.golang.org/log/d95a3c5e412f55ba2574530a147983e1546cf6eb.

The call to _goboringcrypto_HMAC_Init is triggering the runtime.cgoCheckUnknownPointer check on unsafe.Pointer(base(h.key)). This reproduces inconsistently, it seems like in the failure cases the span element size does not match the array size, but beyond that this is deeper in the runtime than I can particularly understand 🤷.

Git bisect suggests https://go.dev/cl/422634 introduced this issue.

cc @rsc @randall77

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 19, 2022
@mdempsky mdempsky added this to the Go1.20 milestone Aug 19, 2022
@mdempsky mdempsky added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 19, 2022
@ianlancetaylor
Copy link
Contributor

See the approach used by https://go.dev/cl/404295. The approach used there might fix the problem here.

@gopherbot
Copy link

Change https://go.dev/cl/425092 mentions this issue: crypto/internal/boring: avoid cgoCheckPointer false positive

@gopherbot
Copy link

Change https://go.dev/cl/425175 mentions this issue: runtime: check that a span is noscan before scanning memory

@gopherbot
Copy link

Change https://go.dev/cl/425194 mentions this issue: runtime: initialize pointer bits of noscan spans

@golang golang locked and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants