[ python-Bugs-900092 ] hotshot.stats.load
SourceForge.net
noreply at sourceforge.net
Sat Feb 10 02:48:43 CET 2007
Bugs item #900092, was opened at 2004-02-19 00:05
Message generated for change (Comment added) made by bcannon
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=900092&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Simon Dahlbacka (sdahlbac)
Assigned to: Nobody/Anonymous (nobody)
Summary: hotshot.stats.load
Initial Comment:
trying to do a
hotshot.stats.load("myprofiling_file.prof")
fails with assertionerror
assert not self._stack
python 2.3.2 on WinXP
----------------------------------------------------------------------
>Comment By: Brett Cannon (bcannon)
Date: 2007-02-09 17:48
Message:
Logged In: YES
user_id=357491
Originator: NO
Attaching the file George made.
File Added: bug.prof
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2007-02-09 10:15
Message:
Logged In: YES
user_id=357491
Originator: NO
I think only OPs and project members can upload. Email it to me, George
(brett at python.org), mention the bug # and I will upload it.
----------------------------------------------------------------------
Comment By: George Sakkis (gsakkis)
Date: 2007-02-08 16:08
Message:
Logged In: YES
user_id=1065136
Originator: NO
Ok, I reduced the prof file to 38K. Can I upload an attachment here ? I
don't see how.
----------------------------------------------------------------------
Comment By: George Sakkis (gsakkis)
Date: 2007-02-08 15:37
Message:
Logged In: YES
user_id=1065136
Originator: NO
Has this ever been reported again since it was closed ? I just got it
today (python 2.5). The prof file is 11MB, I'll see if I can reproduce the
bug with a smaller one.
----------------------------------------------------------------------
Comment By: Barry A. Warsaw (bwarsaw)
Date: 2005-08-15 11:14
Message:
Logged In: YES
user_id=12800
Patches applied for Python 2.4.2 and 2.5a1
----------------------------------------------------------------------
Comment By: Barry A. Warsaw (bwarsaw)
Date: 2005-07-08 08:02
Message:
Logged In: YES
user_id=12800
900092-patch-2.txt fixes the test suite for the extra return
event.
----------------------------------------------------------------------
Comment By: Barry A. Warsaw (bwarsaw)
Date: 2005-07-07 16:26
Message:
Logged In: YES
user_id=12800
See 900092-patch.txt for a candidate patch against Python
2.4.1. Props to Justin Campbell for most of the heavily
lifting (but you can blame me for any problems ;).
This fix restore the tracing of a 'return' event for
exceptions that cause a function to exit.
----------------------------------------------------------------------
Comment By: Greg Chapman (glchapman)
Date: 2004-11-08 15:54
Message:
Logged In: YES
user_id=86307
Well, the superficial fix doesn't work (sorry for posting
too soon). It turns out that PyTrace_EXCEPTION is sent for
any exception, not just one causing the function to exit.
So I guess the best fix may be to have hotshot always
install its profiler_callback to handle CALLS and RETURNS,
and then optionally install the tracer_callback to handle
only LINEs. Anyway, that works for the one test case I've
been using (a runcall of a function which simply does
"import pickle").
By the way, I'm testing with 2.4b1.
----------------------------------------------------------------------
Comment By: Greg Chapman (glchapman)
Date: 2004-11-08 15:32
Message:
Logged In: YES
user_id=86307
I ran into this today, so I decided to look into it. It
looks to me like the problem only happens if you profile
with lineevents enabled. In that case, hotshot uses the
tracer_callback function (in _hotshot.c) to dispatch trace
events. This function explicitly ignores exception returns
(PyTrace_EXCEPTION), which can lead to an unbalanced stack
of calls/returns when the log is loaded (if an profiled
function exits with an exception).
It seems on the surface that tracer_callback ought to handle
exceptions the same way as normal returns. This would be
consistent with what happens when profiler_callback is used,
since PyEval_EvalFrame dispatches sends a Py_RETURN to
c_profilefunc when exiting because of an exception.
----------------------------------------------------------------------
Comment By: Barry A. Warsaw (bwarsaw)
Date: 2004-09-27 07:41
Message:
Logged In: YES
user_id=12800
Could this be related to 1019882?
----------------------------------------------------------------------
Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-09-24 15:00
Message:
Logged In: YES
user_id=469548
Hmm, the file was too big, even though it was compressed.
I've uploaded it to
http://home.student.uva.nl/johannes.gijsbers/roundup.prof.bz2
now.
----------------------------------------------------------------------
Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-09-24 14:58
Message:
Logged In: YES
user_id=469548
While the original report isn't very useful, I've ran into
this problem multiple times as well. I can reproduce it
using the attached profile file (compressed because of the
large size) and the following console session:
Python 2.3.4 (#2, Jul 5 2004, 09:15:05)
[GCC 3.3.4 (Debian 1:3.3.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import hotshot.stats
>>> stats = hotshot.stats.load('roundup.prof')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.3/hotshot/stats.py", line 12, in load
return StatsLoader(filename).load()
File "/usr/lib/python2.3/hotshot/stats.py", line 51, in load
assert not self._stack
AssertionError
>>>
I'm not sure who's baby hotshot really is, so I'm leaving
this unassigned.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=900092&group_id=5470
More information about the Python-bugs-list
mailing list