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

x/arch/x86/x86asm: race when Decode called concurrently #33532

Closed
jeady opened this issue Aug 7, 2019 · 2 comments
Closed

x/arch/x86/x86asm: race when Decode called concurrently #33532

jeady opened this issue Aug 7, 2019 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jeady
Copy link

jeady commented Aug 7, 2019

What version of Go are you using (go version)?

go version go1.12.5 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

linux amd64

What did you do?

If x86asm.Decode is called in parallel from multiple threads, there is a data race on the "decoderCover" variable. This race can be detected with gotsan. The decoderCover variable appears to be for testing introspection only - the Decode function writes to it without locking and then the test can later examine it. There's a TODO to put it behind a flag, which is probably all that needs to happen. I can probably send a pull request, although I'm not very familiar with writing go.

What did you expect to see?

no tsan issues

What did you see instead?

a data race

@ianlancetaylor ianlancetaylor changed the title gotsan issue in x86asm.Decode x/arch/x86/x86asm: race when Decode called concurrently Aug 7, 2019
@gopherbot gopherbot added this to the Unreleased milestone Aug 7, 2019
@ianlancetaylor ianlancetaylor added help-wanted NeedsFix The path to resolution is known, but the work has not been done. labels Aug 7, 2019
@ianlancetaylor
Copy link
Contributor

Note that it's possible that we could just document that we don't support calling x86asm.Decode concurrently. But if a fix is straightforward that is fine too.

@gopherbot
Copy link

Change https://golang.org/cl/189919 mentions this issue: x/arch/x86/x86asm: Make x86asm.Decode thread-safe

@golang golang locked and limited conversation to collaborators Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants