[ python-Bugs-1176893 ] Readline segfault
SourceForge.net
noreply at sourceforge.net
Mon Apr 18 10:50:44 CEST 2005
Bugs item #1176893, was opened at 2005-04-05 09:50
Message generated for change (Comment added) made by mwh
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1176893&group_id=5470
Category: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
>Assigned to: Michael Hudson (mwh)
Summary: Readline segfault
Initial Comment:
The latest change to the readline module has broken tab
completion:
./python
Python 2.5a0 (#1, Apr 5 2005, 01:14:33)
[GCC 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3,
pie-8.7.7.1)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import readline, rlcompleter
[25913 refs]
>>> readline.parse_and_bind("tab: complete")
[25913 refs]
>>> Segmentation fault
[Press tab after the parse_and_bind() call]
----------------------------------------------------------------------
>Comment By: Michael Hudson (mwh)
Date: 2005-04-18 09:50
Message:
Logged In: YES
user_id=6656
Fixed in
Python/pystate.c revision 2.40
Misc/NEWS revision 1.1285
If Mark is actually listening and has any comments, I'd still be interested
to hear them.
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2005-04-07 16:15
Message:
Logged In: YES
user_id=31435
Sorry, can't make time for this. Reassigned to Mark in case
he can.
----------------------------------------------------------------------
Comment By: Michael Hudson (mwh)
Date: 2005-04-05 11:27
Message:
Logged In: YES
user_id=6656
Or maybe this one line patch is the answer (it certainly
fixes this case).
Tim, can you spare a minute to think about this? The patch
simply adds a check to PyEval_ReleaseThread that doesn't
call PyThread_release_lock if the GIL hasn't been allocated.
----------------------------------------------------------------------
Comment By: Michael Hudson (mwh)
Date: 2005-04-05 11:18
Message:
Logged In: YES
user_id=6656
I'm going to go out on a limb and suggest this is a bug in
the PyGilState_ functions.
The problem burrows down to calling
PyThread_release_lock(interpreter_lock) when
interpreter_lock is NULL, i.e. PyEval_InitThreads hasn't
been called. (if you start a thread before running the
crashing code, it doesn't crash, because the GIL has been
allocated).
Not sure what the solution is, or who to bug (time to read
cvs log, I guess).
A silly workaround is to put PyEval_InitThreads in initreadline.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1176893&group_id=5470
More information about the Python-bugs-list
mailing list