[Python-Dev] Need traceback expert to review patch 954922

Brett C. bac at OCF.Berkeley.EDU
Mon May 31 15:54:29 EDT 2004


Any chance someone can take a look at this before 2.4a1 goes out the door?

Brett C. wrote:

> Back in February, I tried to fix an issue of threads executed using 
> 'threading' that did not shut themselves down before the interpreter 
> started tearing down globals, the thread triggering an exception, and 
> then a new exception being raised while trying to report the exception 
> raised in the thread by accessing globals (see 
> http://mail.python.org/pipermail/python-dev/2004-February/042457.html 
> for the previous discussion).  An initial fix was devised, but since 
> there was no way to trigger the issue every time I was not sure if the 
> fix was thorough enough.
> 
> Well, someone finally has an app that causes the error consistently and 
> the previous fix did not go far enough.  But with the help of the app 
> (mnet, specifically) I was finally able to get rid of all global 
> accesses while reporting exceptions so that the original exception 
> caught in the thread can get printed.  The patch is at 
> http://python.org/sf/954922 while the bug report is at 
> http://python.org/sf/754449 .
> 
> Trouble is that I had to basically fake traceback.format_exc() in the 
> patch to a reasonable level since the 'traceback' module bounces around 
> between its various functions too much to just store a local copy of the 
> function and have it still work after globals are set to None.  So I 
> need someone to just look over the code to make sure that the code is 
> not doing something stupid when this code is called (default way is 
> still used when 'sys' is defined and thus the interpreter is not being 
> torn down).
> 
> And the reason I bring this up now is just in case there is any desire 
> to put this in 2.3.4 .  I obviously know that I missed rc1, but I didn't 
> get the details of triggering the problem soon enough and people running 
> 2.3.x are the ones bringing this up since this apparently did not happen 
> under 2.2 for some reason.  I doubt Anthony wants to risk mucking with 
> 'threading' this late (although the patch is fairly self-contained but 
> would require applying the previous patch to attempt to fix this as 
> well), but I thought I would at least put it out there.
> 
> -Brett



More information about the Python-Dev mailing list