Skip to content

runtime: doAllThreadsSyscall has an unaligned atomic load on 32-bit architectures #51776

@mknyszek

Description

@mknyszek

The 64-bit loads here and here are unaligned on 32-bit architectures (see #599).

I would just fix this, but it's unclear to me what the right fix is. This is right at the top of the m struct, so adding padding is tricky because there could be other 64-bit loads below in the struct that will become unaligned. (I think maybe fastrand? I didn't check, maybe there isn't any.) Simultaneously, making these loads not atomic seems slightly dangerous on weak memory architectures.

This might need a backport to Go 1.18? I think these lines are new in Go 1.18.

CC @prattmic @aclements

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions