Skip to content

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Aug 25, 2025

On 32 bit machines, for an atomic of size 9 to 11 bytes, the result fits in the 16 byte pool, but only with a maximum write of 12 bytes (there is 1 byte reserved for the success plus 4 for the type tag, leaving 11 bytes for the data). This was accidentally doing a 16 byte write instead, which could smash the type tag field (usually will NULL) of the next object. Not sure how to test, since just noticed this while reading the code.

…byte pointer

On 32 bit machines, for an atomic of size 9 to 12 bytes, the result fits
in the 16 byte pool, but only with a maximum write of 12 bytes. This was
accidentally doing a 16 byte write instead, which could smash the type
tag field (usually will NULL) of the next object. Not sure how to test,
since just noticed this while reading the code.
@vtjnash vtjnash changed the title atomics: correctly implement padding write of 12 byte atomics with 4 byte pointer atomics: correctly implement padding write of 11 byte atomics with 4 byte pointer Aug 25, 2025
@vtjnash vtjnash added backport 1.12 Change should be backported to release-1.12 merge me PR is reviewed. Merge when all tests are passing atomics labels Aug 25, 2025
@vtjnash vtjnash merged commit bbd491a into master Aug 26, 2025
14 checks passed
@vtjnash vtjnash deleted the jn/atomic16-pad-32 branch August 26, 2025 14:53
@IanButterworth IanButterworth removed the merge me PR is reviewed. Merge when all tests are passing label Aug 26, 2025
KristofferC pushed a commit that referenced this pull request Sep 1, 2025
…byte pointer (#59395)

On 32 bit machines, for an atomic of size 9 to 11 bytes, the result fits
in the 16 byte pool, but only with a maximum write of 12 bytes (there is
1 byte reserved for the `success` plus 4 for the type tag, leaving 11
bytes for the data). This was accidentally doing a 16 byte write
instead, which could smash the type tag field (usually will NULL) of the
next object. Not sure how to test, since just noticed this while reading
the code.

(cherry picked from commit bbd491a)
KristofferC pushed a commit that referenced this pull request Sep 2, 2025
…byte pointer (#59395)

On 32 bit machines, for an atomic of size 9 to 11 bytes, the result fits
in the 16 byte pool, but only with a maximum write of 12 bytes (there is
1 byte reserved for the `success` plus 4 for the type tag, leaving 11
bytes for the data). This was accidentally doing a 16 byte write
instead, which could smash the type tag field (usually will NULL) of the
next object. Not sure how to test, since just noticed this while reading
the code.

(cherry picked from commit bbd491a)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Sep 11, 2025
KristofferC pushed a commit that referenced this pull request Sep 15, 2025
…byte pointer (#59395)

On 32 bit machines, for an atomic of size 9 to 11 bytes, the result fits
in the 16 byte pool, but only with a maximum write of 12 bytes (there is
1 byte reserved for the `success` plus 4 for the type tag, leaving 11
bytes for the data). This was accidentally doing a 16 byte write
instead, which could smash the type tag field (usually will NULL) of the
next object. Not sure how to test, since just noticed this while reading
the code.

(cherry picked from commit bbd491a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants