cpython/Python
T. Wouters 500a419a7a
[3.6] bpo-32591: fix abort in _PyErr_WarnUnawaitedCoroutine during shutdown (GH-5337) (#6536)
When an unawaited coroutine is collected very late in shutdown --
like, during the final GC at the end of PyImport_Cleanup -- then it
was triggering an interpreter abort, because we'd try to look up the
"warnings" module and not only was it missing (we were prepared for
that), but the entire module system was missing (which we were not
prepared for).

I've tried to fix this at the source, by making the utility function
get_warnings_attr robust against this in general. Note that it already
has the convention that it can return NULL without setting an error,
which is how it signals that the attribute it was asked to fetch is
missing, and that all callers already check for NULL returns.

There's a similar check for being late in shutdown at the top of
warn_explicit, which might be unnecessary after this fix, but I'm not
sure so I'm going to leave it..
(cherry picked from commit dba976b8a2)

Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
2018-05-31 12:20:46 +02:00
..
clinic [3.6] bpo-29526: Add reference to help('FORMATTING') in format() builtin (GH-166). (#3491) 2017-09-11 09:26:15 +03:00
Python-ast.c bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196) (GH-7269) 2018-05-31 09:10:28 +03:00
README
_warnings.c [3.6] bpo-32591: fix abort in _PyErr_WarnUnawaitedCoroutine during shutdown (GH-5337) (#6536) 2018-05-31 12:20:46 +02:00
asdl.c replace PY_SIZE_MAX with SIZE_MAX 2016-09-07 09:26:18 -07:00
ast.c Don't hide unexpected errors in PyErr_WarnExplicitObject(). (GH-4585) (#4662) 2017-12-01 09:21:45 +02:00
bltinmodule.c bpo-32674: Improve the docstring for __import__ (GH-5339) (GH-5489) 2018-02-02 08:32:19 -05:00
ceval.c [3.6] bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (GH-6400) 2018-04-06 18:15:34 -04:00
ceval_gil.h replace Py_(u)intptr_t with the c99 standard types 2016-09-06 13:47:26 -07:00
codecs.c bpo-33231: Fix potential leak in normalizestring() (GH-6386) 2018-04-06 00:37:03 -07:00
compile.c [3.6] bpo-33132: Fix reference counting issues in the compiler. (GH-6209). (GH-6321) 2018-03-31 23:54:13 +03:00
condvar.h Issue #27895: Spelling fixes (Contributed by Ville Skyttä). 2016-09-07 12:03:06 +00:00
dtoa.c [3.6] bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0 (#3518) 2017-09-12 16:09:44 -07:00
dup2.c
dynamic_annotations.c
dynload_aix.c PEP 489: Multi-phase extension module initialization 2015-05-23 22:24:10 +10:00
dynload_dl.c Issue #24268: Fix import naming when loading extension modules. Patch by Petr Viktorin. 2015-05-23 14:13:41 -07:00
dynload_hpux.c Issue #24268: Fix import naming when loading extension modules. Patch by Petr Viktorin. 2015-05-23 14:13:41 -07:00
dynload_next.c Issue #24268: Fix import naming when loading extension modules. Patch by Petr Viktorin. 2015-05-23 14:13:41 -07:00
dynload_shlib.c PEP 489: Multi-phase extension module initialization 2015-05-23 22:24:10 +10:00
dynload_stub.c
dynload_win.c [3.6] bpo-13617: Reject embedded null characters in wchar* strings. (GH-2302) (#2462) 2017-06-28 09:27:35 +03:00
errors.c [3.6] bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327). (#4135) 2017-10-26 17:48:48 +02:00
fileutils.c bpo-32869: Fix incorrect dst buffer size for MultiByteToWideChar (GH-5739) 2018-02-18 10:58:09 -08:00
formatter_unicode.c [3.6] bpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174) (#5192) 2018-01-15 23:23:47 +01:00
frozen.c Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. 2016-05-24 09:15:14 +03:00
frozenmain.c Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failure 2015-11-30 03:18:29 +00:00
future.c Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize 2016-11-20 09:13:07 +02:00
getargs.c [3.6] bpo-32746: Fix multiple typos (GH-5144) (GH-5522) 2018-02-03 21:00:24 -05:00
getcompiler.c [3.6] remove tabs from getcompiler.c (GH-3892) (#3893) 2017-10-05 08:41:06 -07:00
getcopyright.c advance copyright years to 2018 (GH-5094) (#5104) 2018-01-05 23:12:14 -08:00
getopt.c
getplatform.c
getversion.c
graminit.c Issue #28008: Implement PEP 530 -- asynchronous comprehensions. 2016-09-09 10:36:01 -07:00
import.c [3.6] bpo-33330: Improve error handling in PyImport_Cleanup(). (GH-6564). (GH-6604) 2018-04-26 03:27:51 +03:00
importdl.c [3.6] bpo-31315: Fix an assertion failure in imp.create_dynamic(), when spec.name is not a string. (GH-3257) (#3653) 2017-09-19 15:51:19 +03:00
importdl.h PEP 489: Multi-phase extension module initialization 2015-05-23 22:24:10 +10:00
importlib.h Revert "[3.6] bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5504)" (#5911) 2018-02-26 11:23:24 -08:00
importlib_external.h Revert "[3.6] bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5504)" (#5911) 2018-02-26 11:23:24 -08:00
makeopcodetargets.py makeopcodetargets.py: we need to import Lib/opcode.py 2016-03-26 01:04:37 +01:00
marshal.c bpo-32011: Revert "Issue GH-15480: Remove the deprecated and unused TYPE_INT64 code from marshal." (GH-4381) (#4405) 2017-11-15 18:05:58 +02:00
modsupport.c va_end() all va_copy()ed va_lists. 2016-09-21 11:37:27 +02:00
mysnprintf.c
mystrtoul.c Issue #25923: Added the const qualifier to static constant arrays. 2015-12-25 19:53:18 +02:00
opcode_targets.h Issue #28257: Improved error message when pass a non-iterable as 2016-10-02 10:33:46 +03:00
peephole.c [3.6] bpo-30416: Protect the optimizer during constant folding. (#4865) 2017-12-15 14:12:14 +02:00
pyarena.c
pyctype.c
pyfpe.c Removed unintentional trailing spaces in non-external and non-generated C files. 2015-03-18 21:53:15 +02:00
pyhash.c bpo-28055: Fix unaligned accesses in siphash24(). (GH-6123) 2018-05-13 04:40:03 -07:00
pylifecycle.c bpo-32329: Fix sys.flags.hash_randomization (#4875) 2017-12-15 01:39:48 +01:00
pymath.c Issue 24366: Indent code (thanks to li4ick for reporting). 2015-06-02 18:53:46 -04:00
pystate.c bpo-20891: Fix PyGILState_Ensure() (#4650) (#4655) 2017-11-30 23:36:49 +01:00
pystrcmp.c
pystrhex.c Silence a gcc "may be used uninitialized" compiler warning. Not true. 2015-04-25 23:51:39 -07:00
pystrtod.c Issue #26331: Implement the parsing part of PEP 515. 2016-09-09 14:57:09 -07:00
pythonrun.c [3.6] bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160). (#4379) 2017-11-12 17:33:16 +01:00
pytime.c [3.6] bpo-31786: Make functions in the select module blocking when timeout is a small negative value. (GH-4003). (#4022) 2017-10-18 11:12:47 +03:00
random.c [3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160) 2018-03-20 20:40:18 +01:00
sigcheck.c
strdup.c
structmember.c Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize 2016-11-20 09:13:07 +02:00
symtable.c Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString. 2016-11-16 10:19:20 +02:00
sysmodule.c [3.6] bpo-30567: Fix refleak in sys.getwindowsversion (GH-1940) (#1970) 2017-06-06 19:23:02 +03:00
thread.c Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5 2015-11-02 04:04:57 +00:00
thread_foobar.h
thread_nt.h Fix typo in thread_nt.h code comment (GH-5211) (GH-5226) 2018-01-17 16:40:33 -08:00
thread_pthread.h [3.6] bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (GH-2403) (#2418) 2017-06-26 21:57:28 +02:00
traceback.c [3.6] bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (GH-4289) (#4406) 2017-11-15 18:04:46 +02:00
wordcode_helpers.h [3.6] bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0 (#3518) 2017-09-12 16:09:44 -07:00

README

Miscellaneous source files for the main Python shared library