Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process · Issue #84058 · python/cpython (original) (raw)

BPO 39877
Nosy @ncoghlan, @vstinner, @ericsnowcurrently, @pablogsal, @nanjekyejoannah
PRs bpo-39877: Fix PyEval_RestoreThread() for daemon threads #18808bpo-39877: Fix PyEval_RestoreThread() for daemon threads #18811bpo-39877: _PyRuntimeState.finalizing becomes atomic #18816bpo-19466: Py_Finalize() clears daemon threads earlier #18848bpo-39877: take_gil() now exits the thread if finalizing #18854bpo-39877: Remove useless PyEval_InitThreads() calls #18883bpo-39877: Py_Initialize() pass tstate to PyEval_InitThreads() #18884bpo-39877: Refactor take_gil() function #18885bpo-39877: take_gil() checks tstate_must_exit() twice #18888bpo-39877: take_gil() checks tstate_must_exit() twice #18890bpo-39877: PyGILState_Ensure() don't call PyEval_InitThreads() #18891bpo-39877: Deprecate PyEval_InitThreads() #18892bpo-39877: Fix take_gil() for daemon threads #19054bpo-39877: 4th take_gil() fix for daemon threads #19080
Files daemon_threads_exit.pyslow_exit.patch

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None closed_at = <Date 2020-03-11.23:14:10.705> created_at = <Date 2020-03-06.14:22:28.647> labels = ['interpreter-core', '3.9'] title = 'Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process' updated_at = <Date 2020-03-19.18:48:34.523> user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2020-03-19.18:48:34.523> actor = 'vstinner' assignee = 'none' closed = True closed_date = <Date 2020-03-11.23:14:10.705> closer = 'vstinner' components = ['Interpreter Core'] creation = <Date 2020-03-06.14:22:28.647> creator = 'vstinner' dependencies = [] files = ['48958', '48959'] hgrepos = [] issue_num = 39877 keywords = ['patch'] message_count = 20.0 messages = ['363512', '363517', '363519', '363520', '363566', '363649', '363653', '363667', '363764', '363767', '363773', '363776', '363790', '363791', '363792', '363795', '363981', '363983', '364496', '364629'] nosy_count = 5.0 nosy_names = ['ncoghlan', 'vstinner', 'eric.snow', 'pablogsal', 'nanjekyejoannah'] pr_nums = ['18808', '18811', '18816', '18848', '18854', '18883', '18884', '18885', '18888', '18890', '18891', '18892', '19054', '19080'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue39877' versions = ['Python 3.9']