[Python-bugs-list] [ python-Bugs-729622 ] line tracing hook errors

SourceForge.net noreply@sourceforge.net
Tue, 29 Apr 2003 08:42:51 -0700


Bugs item #729622, was opened at 2003-04-29 15:19
Message generated for change (Comment added) made by arigo
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=729622&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Armin Rigo (arigo)
Assigned to: Michael Hudson (mwh)
Summary: line tracing hook errors

Initial Comment:
The new line tracing hook in ceval.c:822 doesn't
correctly handle errors raised by the hook functions.
Mea culpa, the error was in a patch I submitted.

The problem is that when maybe_call_line_trace()
returns an error, f->f_stacktop is not correctly reset
to NULL. Then the stack is emptied by the usual
exception mecanisms below, but f->f_stacktop still
points somewhere in the stack. This makes the frame
destructor and GC visitors crash.

The equivalent code in 2.2.2 resets f->f_stacktop to
NULL in all cases. The attached patch for 2.3b1 does
the same.

The code is very slightly different than what we have
in 2.2.2 to allow programs like Psyco to work around
the bug in a manner that works with all 2.3 versions --
both with and without the patch. Still, the patch is
necessary : any line hook function in Python that
raises an exception can crash the interpreter.


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

>Comment By: Armin Rigo (arigo)
Date: 2003-04-29 15:42

Message:
Logged In: YES 
user_id=4771

yes, here is one (it segfaults the interpreter).

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

Comment By: Michael Hudson (mwh)
Date: 2003-04-29 15:24

Message:
Logged In: YES 
user_id=6656

is this possible to write a test case for?

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

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