这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@hawkw
Copy link
Owner

@hawkw hawkw commented Jul 24, 2022

There's currently a bug in the raw_mask method on
mycelium-bitfield's packing spec types. raw_mask returns self.mask
shifted over by self.shift, with the intention of returning the actual
mask used by the packing spec. But...the self.mask field is already
shifted to the correct bit position, so shifting it in the raw_mask
method results in the mask being shifted over twice as many bits as it's
supposed to be.

This caused some very weird behavior in the maitake task state
management code, where attempting to toggle a bit using its raw_mask
would accidentally clobber low bits of the ref count, resulting in a
ref-count underflow in some cases.

There's currently a bug in the `raw_mask` method on
`mycelium-bitfield`'s packing spec types. `raw_mask` returns `self.mask`
shifted over by `self.shift`, with the intention of returning the actual
mask used by the packing spec. But...the `self.mask` field is already
shifted to the correct bit position, so shifting it in the `raw_mask`
method results in the mask being shifted over twice as many bits as it's
supposed to be.

This caused some *very* weird behavior in the `maitake` task state
management code, where attempting to toggle a bit using its `raw_mask`
would accidentally clobber low bits of the ref count, resulting in a
ref-count underflow in some cases.
@hawkw hawkw enabled auto-merge (squash) July 24, 2022 20:17
@hawkw hawkw merged commit 8c34ef9 into main Jul 24, 2022
@hawkw hawkw deleted the eliza/fix-raw-mask branch July 24, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants