Actions
Bug #21172
closedRace condition in `register_fstring`
Bug #21172:
Race condition in `register_fstring`
Description
This is a rare bug with very low criticality, but it can cause occasional CI failures. I leave it to branch maintainers to decide if it's worth backporting or not.
Timeline¶
- A
"foo" oid=1string is interned. "foo" oid=1is no longer referenced and will be swept in the future.- Another
"foo" oid=2string is interned. register_fstringfinds"foo" oid=1, but since it is about to be swept, removes it fromfstring_tableand insert"foo" oid=2instead."foo" oid=1is swept, since it has theRSTRING_FSTRflag, ast_deleteis issued infstring_tablewhich removes"foo" oid=2.
Unfortunately, I couldn't come up with a minimal reproduction for this, but it did reproduce consistently with a large amount of tests and a very specific seed.
Consequence¶
This has little to no consequence on real world code. It just breaks a few ruby tests that is attempting to ensure some strings were interned.
Example:
Actions