Commit 4342e59
committed
gh-157194: Read the opcode atomically in the specializer
set_opcode() writes instr->op.code with an atomic compare-exchange and
unspecialize() reads it with FT_ATOMIC_LOAD_UINT8_RELAXED, but two reads
added later compare it directly. In a free-threaded build with -X tlbc=0
the bytecode is shared between threads, so those plain reads race with
the atomic write, as ThreadSanitizer reported on the CI job for
test_thread_local_bytecode.1 parent f37e8ff commit 4342e59
2 files changed
Lines changed: 7 additions & 2 deletions
File tree
- Misc/NEWS.d/next/Core_and_Builtins
- Python
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2348 | 2348 | | |
2349 | 2349 | | |
2350 | 2350 | | |
2351 | | - | |
| 2351 | + | |
2352 | 2352 | | |
2353 | 2353 | | |
2354 | 2354 | | |
| |||
2954 | 2954 | | |
2955 | 2955 | | |
2956 | 2956 | | |
2957 | | - | |
| 2957 | + | |
| 2958 | + | |
2958 | 2959 | | |
2959 | 2960 | | |
2960 | 2961 | | |
| |||
0 commit comments