cpython/Python
Gregory P. Smith d868be8805 Adds a sanity check to avoid a *very rare* infinite loop due to a corrupt tls
key list data structure in the thread startup path.

This change is a companion to r60148 which already successfully dealt with a
similar issue on thread shutdown.

In particular this loop has been observed happening from this call path:
 #0  in find_key ()
 #1  in PyThread_set_key_value ()
 #2  in _PyGILState_NoteThreadState ()
 #3  in PyThreadState_New ()
 #4  in t_bootstrap ()
 #5  in pthread_start_thread ()

I don't know how this happens but it does, *very* rarely.  On more than
one hardware platform.  I have not been able to reproduce it manually.
(A flaky mutex implementation on the system in question is one hypothesis).

As with r60148, the spinning we managed to observe in the wild was due to a
single list element pointing back upon itself.
2008-08-04 07:33:37 +00:00
..
Python-ast.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
_warnings.c #3342: In tracebacks, printed source lines were not indented since r62555. 2008-07-11 21:45:06 +00:00
asdl.c Merge in release25-maint r60793: 2008-06-11 07:41:16 +00:00
ast.c Issue #3360: Fix incorrect parsing of "020000000000.0". 2008-07-16 09:40:03 +00:00
atof.c
bltinmodule.c #3479: unichr(2**32) used to return u'\x00'. 2008-07-31 21:28:03 +00:00
ceval.c Raymond's patch for #1819: speedup function calls with named parameters 2008-07-25 22:13:52 +00:00
codecs.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
compile.c Merge in release25-maint r60793: 2008-06-11 07:41:16 +00:00
dup2.c
dynload_aix.c
dynload_atheos.c
dynload_beos.c
dynload_dl.c
dynload_hpux.c
dynload_next.c
dynload_os2.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
errors.c #2542: now that issubclass() may call arbitrary code, 2008-07-31 00:42:16 +00:00
formatter_string.c Refactor and clean up str.format() code (and helpers) in advance of optimizations. 2008-05-30 18:10:04 +00:00
formatter_unicode.c Refactor and clean up str.format() code (and helpers) in advance of optimizations. 2008-05-30 18:10:04 +00:00
frozen.c
frozenmain.c
future.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
getargs.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
getcompiler.c
getcopyright.c
getcwd.c
getmtime.c
getopt.c
getplatform.c
getversion.c
graminit.c
import.c Fix issue 3221 by emitting a RuntimeWarning instead of raising SystemError when the parent module can't be found during an absolute import (likely due to non-PEP 361 aware code which sets a module level __package__ attribute) 2008-07-13 14:52:36 +00:00
importdl.c
importdl.h
mactoolboxglue.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
marshal.c Issue 3116: fix quadratic behavior in marshal.dumps(). 2008-06-16 01:42:40 +00:00
modsupport.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
mysnprintf.c Fix issue2588: Do not execute str[size-1] = '\0' when a 0 size is 2008-05-26 22:07:28 +00:00
mystrtoul.c
peephole.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
pyarena.c
pyfpe.c
pymath.c
pystate.c Adds a sanity check to avoid a *very rare* infinite loop due to a corrupt tls 2008-08-04 07:33:37 +00:00
pystrcmp.c
pystrtod.c Fix issue 3411: default float format spec fails on negative numbers. 2008-07-19 00:24:05 +00:00
pythonrun.c #3378: in case of no memory, don't leak even more memory. :) 2008-07-19 10:08:55 +00:00
sigcheck.c
strdup.c
strtod.c
structmember.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
symtable.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
sysmodule.c Added garbage collector overhead and optional default return value to 2008-07-10 17:13:55 +00:00
thread.c Adds a sanity check to avoid a *very rare* infinite loop due to a corrupt tls 2008-08-04 07:33:37 +00:00
thread_atheos.h
thread_beos.h
thread_cthread.h
thread_foobar.h
thread_lwp.h
thread_nt.h
thread_os2.h
thread_pth.h
thread_pthread.h
thread_sgi.h
thread_solaris.h
thread_wince.h
traceback.c #3342: In tracebacks, printed source lines were not indented since r62555. 2008-07-11 21:45:06 +00:00