Uh oh!
There was an error while loading. Please reload this page.
gh-153297: Fix data race on assigning __name__ and __qualname__ to functions on FT builds - #153335
gh-153297: Fix data race on assigning __name__ and __qualname__ to functions on FT builds#153335sobolevn wants to merge 6 commits into
__name__ and __qualname__ to functions on FT builds#153335Conversation
…e__` to functions on FT builds
sobolevn
commented
Jul 8, 2026
kumaraditya303
commented
Jul 11, 2026
I think there are places where these are read without critical section so it doesn't fix all the cases. |
sobolevn
commented
Jul 11, 2026
Yes, like here :( // Objects/genobject.cassert(func->func_name!=NULL);
gen->gi_name=Py_NewRef(func->func_name);It now uses a critical section on But, |
This PR adds critical sections to importsys, threading, timeassertnotsys._is_gil_enabled()
classM: passdeftarget(): passtarget.__defaults__= (M(),)
stop=Falsedefchurn():
whilenotstop:
target.__defaults__= (M(),)
defread():
whilenotstop:
d=target.__defaults__; deldts= [threading.Thread(target=churn) for_inrange(4)]
ts+= [threading.Thread(target=read) for_inrange(8)]
fortints: t.start()
time.sleep(5); stop=Truefortints: t.join()Debug FT: ETA: Investigation and draft by Claude Code (Opus 4.8). |
kumaraditya303
commented
Jul 28, 2026
I created #154826 to fix this properly, it uses stop the world pause and changes the attribute and clears the version atomically which is important and missing from this PR. |
func_set_qualnameunder free-threading #153297