classification
Title: _lsprof: clear() should call flush_unmatched()
Type: Stage:
Components: Versions: Python 3.0, Python 2.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: haypo
Priority: normal Keywords: patch

Created on 2008-09-24 01:22 by haypo, last changed 2008-12-11 23:13 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
_lsprof_clear.patch haypo, 2008-09-24 01:22 profiler_clear() calls flush_unmatched()
Messages (2)
msg73689 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2008-09-24 01:22
Example to reproduce the bug (using Python trunk):
---
from gc import collect
import _lsprof

def callMethod(obj):
    obj.clear()
    collect()

obj = _lsprof.Profiler()
obj.enable()
callMethod(obj)
obj.enable()

del obj
collect()
---

The problem is that the profiler is still running when exiting 
callMethod() and so it tries to use callMethod context which was 
free'd just before by profiler_clear().
msg77640 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2008-12-11 23:13
I'm unable to reproduce my issue with Python trunk, so close it.
History
Date User Action Args
2008-12-11 23:13:52hayposetstatus: open -> closed
messages: + msg77640
2008-09-24 01:22:08haypocreate