[Patches] [ python-Patches-1158052 ] fix for a deadlock in the logging module

SourceForge.net noreply at sourceforge.net
Mon Mar 7 04:28:50 CET 2005


Patches item #1158052, was opened at 2005-03-07 04:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1158052&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Sebastian Prause (sprause)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix for a deadlock in the logging module

Initial Comment:
there is a deadlock in the logging package, that can be
triggered with a custom class importer:

(1) create a custom class importer and put it in
sys.meta_path (this importer must log a message via the
logging package)
(2) raise an exception somewhere and log it
(3) when the formatter tries to format the exception,
it imports the traceback module (in the formatException
method)
(4) this import will be redirected to the above
installed class importer
(5) the class importer tries to log a message
(6) trying to acquire the lock for the new log message
in Handler.acquire results in a deadlock

the fix is to move the traceback import from the method
to the module, so it gets imported when no lock is
held. the attached patch does this

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1158052&group_id=5470


More information about the Patches mailing list