php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46160 SPL - Memory leak when exception is thrown in offsetSet method
Submitted: 2008-09-23 11:40 UTC Modified: 2008-09-25 00:24 UTC
From: felipe@php.net Assigned: colder (profile)
Status: Closed Package: SPL related
PHP Version: 5.3CVS-2008-09-23 (CVS) OS:
Private report: No CVE-ID: None
 [2008-09-23 11:40 UTC] felipe@php.net
Description:
------------
A simple detail, see the patch:
http://felipe.ath.cx/diff/spl-offsetset.diff

Reproduce code:
---------------
<?php

try {
	$x = new splqueue;
	$x->offsetSet(0, 0);
} catch (Exception $e) { }


Actual result:
--------------
==25461== 20 bytes in 1 blocks are definitely lost in loss record 2 of 4
==25461==    at 0x4021620: malloc (vg_replace_malloc.c:149)
==25461==    by 0x83B9AD8: ZEND_SEND_VAL_SPEC_CONST_HANDLER (zend_vm_execute.h:1691)
==25461==    by 0x83B764B: execute (zend_vm_execute.h:104)
==25461==    by 0x8397166: zend_execute_scripts (zend.c:1197)
==25461==    by 0x8345947: php_execute_script (main.c:2080)
==25461==    by 0x841F6A2: main (php_cli.c:1130)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-23 12:06 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC