Skip to content

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

@jeady

Description

@jeady

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions