cpython/Python
Miss Islington (bot) dcff50a3e9
gh-96387: take_gil() resets drop request before exit (GH-96869) (GH-96941)
At Python exit, sometimes a thread holding the GIL can wait forever
for a thread (usually a daemon thread) which requested to drop the
GIL, whereas the thread already exited. To fix the race condition,
the thread which requested the GIL drop now resets its request before
exiting.

take_gil() now calls RESET_GIL_DROP_REQUEST() before
PyThread_exit_thread() if it called SET_GIL_DROP_REQUEST to fix a
race condition with drop_gil().

Issue discovered and analyzed by Mingliang ZHAO.

(cherry picked from commit 04f4977f50)
(cherry picked from commit 6ff54716f1)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-09-19 17:36:26 -07:00
..
clinic [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501) 2022-09-02 09:51:49 -07:00
_warnings.c bpo-43268: Pass interp rather than tstate to internal functions (GH-24580) 2021-02-19 15:10:45 +01:00
asdl.c bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933) 2021-03-23 20:47:40 +01:00
ast.c [3.10] bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator (GH-27432) (GH-27435) 2021-07-28 18:02:14 -07:00
ast_opt.c bpo-43892: Validate the first term of complex literal value patterns (GH-25735) 2021-04-29 17:19:28 -07:00
ast_unparse.c bpo-43892: Make match patterns explicit in the AST (GH-25585) 2021-04-28 22:58:44 -07:00
bltinmodule.c bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194) (GH-28199) 2021-09-07 12:43:33 +01:00
bootstrap_hash.c [3.10] Remove trailing spaces (GH-28709) 2021-10-03 20:03:49 +03:00
ceval.c [3.10] gh-94510: Raise on re-entrant calls to sys.setprofile and syssettrace (GH-94511) (#94579) 2022-07-05 19:52:33 +01:00
ceval_gil.h gh-96387: take_gil() resets drop request before exit (GH-96869) (GH-96941) 2022-09-19 17:36:26 -07:00
codecs.c
compile.c [3.10] GH-94329: Don't raise on excessive stack consumption (GH-94421) (#94448) 2022-07-11 13:21:17 +01:00
condvar.h bpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) (GH-27380) 2021-07-27 00:34:32 +02:00
context.c bpo-43268: Pass interp rather than tstate to internal functions (GH-24580) 2021-02-19 15:10:45 +01:00
dtoa.c Revert "bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821)" (GH-24964) 2021-03-22 11:58:59 +01:00
dup2.c
dynamic_annotations.c
dynload_hpux.c bpo-44959: Add fallback to extension modules with '.sl' suffix on HP-UX (GH-27857) (GH-29152) 2021-11-18 17:19:19 +01:00
dynload_shlib.c
dynload_stub.c
dynload_win.c
errors.c [3.10] bpo-45848: Allow the parser to get error lines from encoded files (GH-29646) (GH-29661) 2021-11-20 16:34:56 +01:00
fileutils.c bpo-47260: Fix os.closerange() potentially being a no-op in a seccomp sandbox (GH-32418) 2022-04-08 11:10:38 -07:00
formatter_unicode.c bpo-28146: Fix a confusing error message in str.format() (GH-24213) 2021-05-13 14:24:49 -07:00
frozen.c bpo-43372: Use _freeze_importlib for regen-frozen. (GH-24759) 2021-03-06 13:34:03 -08:00
frozen_hello.h bpo-42739: Don't use sentinels to mark end of line table. (GH-25657) 2021-04-29 13:12:51 +01:00
frozenmain.c
future.c bpo-38605: Revert making 'from __future__ import annotations' the default (GH-25490) 2021-04-21 12:41:19 +01:00
getargs.c [3.10] gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999) (GH-95354) 2022-07-28 09:52:00 +03:00
getcompiler.c closes bpo-43278: remove unnecessary leading '\n' from COMPILER when build with GCC/Clang (GH-24606) 2021-02-25 20:24:21 -08:00
getcopyright.c [3.10] Update copyright year to 2022. (GH-30335) (GH-30336) 2022-01-02 13:13:04 -08:00
getopt.c
getplatform.c
getversion.c
hamt.c gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066) (GH-93146) 2022-05-24 10:52:29 +02:00
hashtable.c
import.c [3.11] gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742) (GH-93792) 2022-06-16 00:19:29 -07:00
importdl.c Fix format string in _PyImport_LoadDynamicModuleWithSpec() (GH-28863) 2021-10-12 10:10:59 -07:00
importdl.h
importlib.h [3.10] bpo-46724: Use JUMP_ABSOLUTE for all backward jumps. (GH-31326) (GH-31354) 2022-02-16 11:26:02 +00:00
importlib_external.h [3.10] bpo-46724: Use JUMP_ABSOLUTE for all backward jumps. (GH-31326) (GH-31354) 2022-02-16 11:26:02 +00:00
importlib_zipimport.h [3.10] bpo-46724: Use JUMP_ABSOLUTE for all backward jumps. (GH-31326) (GH-31354) 2022-02-16 11:26:02 +00:00
initconfig.c [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501) 2022-09-02 09:51:49 -07:00
makeopcodetargets.py
marshal.c bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26970) 2021-06-30 18:52:25 +01:00
modsupport.c
mysnprintf.c
mystrtoul.c
opcode_targets.h bpo-43754: Eliminate bindings for partial pattern matches (GH-25229) 2021-05-02 13:02:10 -07:00
pathconfig.c [3.10] Fix typos in the Python directory (GH-28767) (GH-28799) 2021-10-07 17:30:08 +02:00
preconfig.c bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481) 2021-03-29 12:28:14 +09:00
pyarena.c bpo-43244: Remove the pyarena.h header (GH-25007) 2021-03-24 02:23:01 +01:00
pyctype.c
pyfpe.c
pyhash.c bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493) 2021-04-22 08:34:57 -07:00
pylifecycle.c bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065) 2021-08-06 04:32:37 -07:00
pymath.c
pystate.c bpo-42540: reallocation of id_mutex should not force default allocator (GH-29564) 2021-11-17 13:16:01 -08:00
pystrcmp.c
pystrhex.c
pystrtod.c bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586) 2020-12-01 09:56:42 +01:00
Python-ast.c bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467) 2022-01-07 14:30:18 -08:00
pythonrun.c bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) (GH-29826) 2021-11-29 10:07:24 +00:00
pytime.c
README
stdlib_module_names.h [3.10] bpo-45688: Add _scproxy to sys.stdlib_module_names (GH-29358) (GH-29361) 2021-11-02 12:32:36 +01:00
structmember.c bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199) (GH-27201) 2021-07-17 01:01:53 +01:00
suggestions.c [3.10] bpo-45826: Fix a crash in suggestions.c by checking for traceback is None (GH-29590) (GH-29602) 2021-11-18 01:28:04 +01:00
symtable.c bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059) (GH-30064) 2021-12-12 01:24:12 +00:00
sysmodule.c [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501) 2022-09-02 09:51:49 -07:00
thread.c bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065) 2021-08-06 04:32:37 -07:00
thread_nt.h bpo-41299: Reduce lag in Windows threading timeouts by using a higher precision time source (GH-26568) (GH-26580) 2021-06-20 21:12:27 +01:00
thread_pthread.h bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28671) 2021-10-01 18:22:49 +02:00
traceback.c bpo-45831: _Py_DumpASCII() uses a single write() call if possible (GH-29596) (GH-29598) 2021-11-17 22:59:19 +01:00
wordcode_helpers.h

Miscellaneous source files for the main Python shared library