classification
Title: Assertion error on RLock._acquire_restore
Type: Stage:
Components: Library (Lib) Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: haypo, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2011-01-25 12:44 by haypo, last changed 2011-04-24 21:45 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
bug2.py haypo, 2011-01-25 12:44
rlock_release_save.patch haypo, 2011-04-12 22:20 review
Messages (6)
msg127004 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-01-25 12:44
Attached script (bug2.py) ends with:

$ ~/prog/SVN/py3k/python bug2.py                                                                                                         
python: ./Modules/_threadmodule.c:399: rlock_acquire_restore: Assertion `self->rlock_count == 0' failed.
Abandon

It should raise a classic Python exception, instead of stopping with a fatal assertion error.
msg133607 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-04-12 22:20
Here is a patch: Antoine, would you like to review it?
msg133900 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-04-16 18:00
> Here is a patch: Antoine, would you like to review it?
> 
> ----------
> keywords: +patch
> nosy: +pitrou
> Added file: http://bugs.python.org/file21636/rlock_release_save.patch

Well, it looks ok to me. Is the assert still needed?
msg134348 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-04-24 21:43
> Is the assert still needed?

The assertion is in RLock()._acquire_restore(), not in RLock._release_save(). I prefer to keep it, it doesn't hurt.

 close this issue because I commited my fix.
msg134349 - (view) Author: Roundup Robot (python-dev) Date: 2011-04-24 21:45
New changeset 996b9c9dc10a by Victor Stinner in branch 'default':
Issue #11005, issue #11915: fix issue number of commit 2c0da1c4f063.
http://hg.python.org/cpython/rev/996b9c9dc10a
msg134350 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-04-24 21:45
The commit:

New changeset 2c0da1c4f063 by Victor Stinner in branch 'default':
Issue #11915: threading.RLock()._release_save() raises a RuntimeError if the
http://hg.python.org/cpython/rev/2c0da1c4f063
History
Date User Action Args
2011-04-24 21:45:49hayposetmessages: + msg134350
2011-04-24 21:45:28python-devsetnosy: + python-dev
messages: + msg134349
2011-04-24 21:43:40hayposetstatus: open -> closed
resolution: fixed
messages: + msg134348
2011-04-16 18:00:51pitrousetmessages: + msg133900
2011-04-12 22:20:57hayposetfiles: + rlock_release_save.patch

nosy: + pitrou
messages: + msg133607

keywords: + patch
2011-01-25 12:44:27haypocreate