This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: -Wi causes a fatal Python error
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: arigo Nosy List: arigo, brett.cannon, tim.peters
Priority: release blocker Keywords:

Created on 2006-06-09 03:20 by brett.cannon, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg28752 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-06-09 03:20
PYTHONPATH=/Users/drifty/Code/Compiled/lib/python2.5   \
        ./python.exe -Wi -tt
/Users/drifty/Code/Compiled/lib/python2.5/compileall.py \
        -d /Users/drifty/Code/Compiled/lib/python2.5 -f \
        -x 'bad_coding|badsyntax|site-packages'
/Users/drifty/Code/Compiled/lib/python2.5
Fatal Python error: PyThreadState_Get: no current thread
make: *** [libinstall] Abort trap

Works if I remove ``-Wi -tt`` from the command.
msg28753 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-06-09 16:59
Logged In: YES 
user_id=357491

Forgot to try this with just one of the two flags; will do
that soon.
msg28754 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-06-10 01:42
Logged In: YES 
user_id=357491

OK, so -Wi is causing the failure.
msg28755 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2006-06-10 02:19
Logged In: YES 
user_id=31435

Removed "on OS X" from the Summary line, since this is
trivial to reproduce on Windows too:

$ python_d -Wi
Fatal Python error: PyThreadState_Get: no current thread

Note that I used a debug build there; the error doesn't
occur if I use a release build instead.

As a matter of fact, Armin recently added a comment to
dictobject.c pointing out this very failure mode:

/* We can arrive here with a NULL tstate during
   initialization:  try running "python -Wi" for
   an example related to string interning.  Let's
   just hope that no exception occurs then... */

For that matter, it could be that Armin _created_ this
failure mode too ;-)
msg28756 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-06-10 02:54
Logged In: YES 
user_id=357491

Ah-ha!  I checked svn blame on PyThreadState_Get() and
PyThreadState_GET(), but not on PyDict_GetItem().

Assigning to Armin since he caused this ruckus.  =)
msg28757 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2006-06-10 10:59
Logged In: YES 
user_id=4771

Ah, PyThreadState_GET() complains if tstate is NULL, but only
in debug mode.  My code was prepared to handle a NULL
return value; I didn't expect this extra check :-)

Let's read _PyThreadState_Current directly then, as I
don't see another way to get at it with no check.  Checked in
as r46818.

Command-line arguments are not too much stressed by
the test suite...
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43476
2006-06-09 03:20:43brett.cannoncreate