msg73700 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2008-09-24 10:02 |
Using Fusil the fuzzer, I found a "minor" bug in _hotshot module: it doesn't check correctly the errors in hotshot_logreader(). On error, an exception is raised (eg. by eof_error()) but the result is a pointer to a new allocated object instead of NULL. Here is a patch to delete the new created object (using Py_DECREF) and return NULL. It uses an ugly goto, but goto is sometimes useful to avoid code duplication on error handling (eg. see Linux source code). Example to reproduce the bug: --- import _hotshot, gc _hotshot.logreader(".") gc.collect() --- |
|
|
msg73701 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2008-09-24 10:10 |
Oops, my previous patch always raise an error even on valid file :-p Here is a new patch with *an unit test* (yeah!). |
|
|
msg73704 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-09-24 11:13 |
The patch is good to me. gotos are perfectly allowed for this purpose. (to python committers: Should this kind of "minor" issues be fixed after 2.6rc2? This could as well wait until 2.6.1) |
|
|
msg73726 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-09-24 16:25 |
Looks fine. Since it is minor, why not commit it now? |
|
|
msg73727 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2008-09-24 16:26 |
@georg: give me a svn access and i will commit it ;-) |
|
|
msg73729 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-09-24 16:30 |
Regardless of the smiley, I certainly wouldn't object if you requested permissions on python-dev... |
|
|
msg77641 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2008-12-11 23:16 |
> Regardless of the smiley, I certainly wouldn't object if you > requested permissions on python-dev... I still don't have an account and the issue is still open. 2.6(.1) and 3.0 are released. The patch has been reviewed by amaury.forgeotdarc, so can the patch be applied? The issue is still valid with python trunk: $ ./python Python 2.7a0 (trunk:67710M, Dec 11 2008, 23:57:18) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 >>> import _hotshot, gc >>> _hotshot.logreader(".") <_hotshot.LogReaderType object at 0xb7d936e0> >>> gc.collect() Exception EOFError: 'end of file with incomplete profile record' in 'garbage collection' ignored Fatal Python error: unexpected exception during garbage collection Abandon (core dumped) |
|
|
msg77882 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-12-15 22:17 |
Fixed in r67797 (trunk) and r67801 (2.6) hotshot was removed from py3k. |
|
|