-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
atexit.unregister() can call the user __eq__() when it searches the callback(s) to remove. If __eq__() returns true, the callback is removed by index. But __eq__() can call arbitrary code, it can release the GIL, and atexit.unregister() can be called in other thread. If it removes the callback at the current index or before current index, the current index will no point to the compared callable, and the following deletion will delete wrong callable.
This issue is similar to #112127, but causes different symptoms.
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error