Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7282] RLocks leak references when used in raw threads

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 7, 2009, 4:00 PM

Post #1 of 3 (338 views)
Permalink
[issue7282] RLocks leak references when used in raw threads

New submission from Antoine Pitrou <pitrou [at] free>:

When you use an RLock from a thread which wasn't created through the
high-level `threading` API (but, for example, using
thread.start_new_thread()), the RLock creates a DummyThread object by
calling current_thread(), and that DummyThread is immortal (as well as
its attributes etc.). This implementation wart can easily lead to
reference leaks for unsuspecting users.

One simple solution is not to call current_thread() in RLock, but use
get_ident() instead. Patch attached.

----------
components: Library (Lib)
files: rlock_leak.patch
keywords: patch
messages: 95029
nosy: pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: RLocks leak references when used in raw threads
type: resource usage
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15287/rlock_leak.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7282>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 9, 2009, 3:59 AM

Post #2 of 3 (311 views)
Permalink
[issue7282] RLocks leak references when used in raw threads [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

An updated patch with test.

----------
Added file: http://bugs.python.org/file15298/rlock_leak2.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7282>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 9, 2009, 8:54 AM

Post #3 of 3 (301 views)
Permalink
[issue7282] RLocks leak references when used in raw threads [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Committed in r76172-r76175.

----------
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7282>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.