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

Fix Key interning race. (#12152) #12160

Merged
merged 2 commits into from
Jun 2, 2021

Conversation

jsirois
Copy link
Contributor

@jsirois jsirois commented Jun 1, 2021

Previously a Key could be observed before it was added to the
reverse_keys mapping leading to a panic in key_get. That panic used
a debug format on the problematic key and the Debug impl for Key
indirectly uses key_get. This results in a panic while handling a
panic.

Fix the root cause of the panic, ensuring the panic can never happen
as was intended. Also fix the recursive use of key_get in the panic
for sanity sake.

Fixes #11926

(cherry picked from commit a59be85)

[ci skip-build-wheels]

@jsirois
Copy link
Contributor Author

jsirois commented Jun 1, 2021

N.B.: Not a clean cherry-pick. The rust upgrade in #11940 led to s/FNV/Fnv/.

@jsirois jsirois requested review from Eric-Arellano and tdyas June 1, 2021 19:00
Previously a `Key` could be observed before it was added to the
`reverse_keys` mapping leading to a panic in `key_get`. That panic used
a debug format on the problematic key and the `Debug` impl for `Key`
indirectly uses `key_get`. This results in a panic while handling a
panic.

Fix the root cause of the panic, ensuring the panic can never happen
as was intended. Also fix the recursive use of `key_get` in the panic
for sanity sake.

Fixes pantsbuild#11926

(cherry picked from commit a59be85)

[ci skip-build-wheels]
@jsirois jsirois force-pushed the pr/12152/cherry-pick/2.3.x branch from 31bd58a to d261d2f Compare June 1, 2021 23:30
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@jsirois jsirois merged commit cdf0bc1 into pantsbuild:2.3.x Jun 2, 2021
@jsirois jsirois deleted the pr/12152/cherry-pick/2.3.x branch June 2, 2021 00:11
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