#46110 [NEW]: XMLWriter - openmemory() and openuri() mem. leaks
| From: | felipe@php.net | Date: | Wed, 17 Sep 2008 18:07:37 +0000 |
| Subject: | #46110 [NEW]: XMLWriter - openmemory() and openuri() mem. leaks | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-129067@lists.php.net to get a copy of this message | ||
From: felipe@php.net
Operating system:
PHP version: 5.3CVS-2008-09-17 (CVS)
PHP Bug Type: XML Writer
Bug description: XMLWriter - openmemory() and openuri() mem. leaks
Description:
------------
The mem. leak happens when calling two or more times the openuri() and
openmemory(). See below.
Reproduce code:
---------------
<?php
$x = new xmlwriter;
$x->openuri(1);
$x->openuri(1);
$x->openmemory();
$x->openmemory();
Actual result:
--------------
==19574== 18 bytes in 6 blocks are indirectly lost in loss record 2 of 14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x51CFE65: xmlStrndup (in /usr/lib/libxml2.so.2.6.27)
==19574== by 0x51D000B: xmlStrdup (in /usr/lib/libxml2.so.2.6.27)
==19574== by 0x5225BE9: xmlNewTextWriter (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x52260D1: xmlNewTextWriterFilename (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8357E54: zif_xmlwriter_open_uri (php_xmlwriter.c:1833)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574== 8,450 (8 direct, 8,442 indirect) bytes in 1 blocks are
definitely lost in loss record 12 of 14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x8357C71: zif_xmlwriter_open_memory
(php_xmlwriter.c:1890)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== 64 bytes in 4 blocks are indirectly lost in loss record 5 of 14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x517C151: xmlBufferCreate (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x5185786: xmlAllocOutputBuffer (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x518585A: xmlOutputBufferCreateIO (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x51858BB: xmlOutputBufferCreateBuffer (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x522602C: xmlNewTextWriterMemory (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8357C5F: zif_xmlwriter_open_memory
(php_xmlwriter.c:1884)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574==
==19574== 72 bytes in 6 blocks are indirectly lost in loss record 6 of 14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x5184C0B: xmlListCreate (in /usr/lib/libxml2.so.2.6.27)
==19574== by 0x5225BB0: xmlNewTextWriter (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x522603A: xmlNewTextWriterMemory (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8357C5F: zif_xmlwriter_open_memory
(php_xmlwriter.c:1884)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574==
==19574== 72 bytes in 6 blocks are indirectly lost in loss record 7 of 14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x5184BE8: xmlListCreate (in /usr/lib/libxml2.so.2.6.27)
==19574== by 0x5225BB0: xmlNewTextWriter (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x52260D1: xmlNewTextWriterFilename (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8357E54: zif_xmlwriter_open_uri (php_xmlwriter.c:1833)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574==
==19574== 96 bytes in 3 blocks are indirectly lost in loss record 8 of 14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x5185768: xmlAllocOutputBuffer (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8072B24: php_libxml_output_buffer_create_filename
(libxml.c:413)
==19574== by 0x518848F: xmlOutputBufferCreateFilename (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x52260C3: xmlNewTextWriterFilename (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8357E54: zif_xmlwriter_open_uri (php_xmlwriter.c:1833)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574==
==19574== 132 bytes in 3 blocks are indirectly lost in loss record 9 of
14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x5225B82: xmlNewTextWriter (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x522603A: xmlNewTextWriterMemory (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8357C5F: zif_xmlwriter_open_memory
(php_xmlwriter.c:1884)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574==
==19574== 264 bytes in 3 blocks are indirectly lost in loss record 10 of
14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x517D843: xmlNewDoc (in /usr/lib/libxml2.so.2.6.27)
==19574== by 0x5225C00: xmlNewTextWriter (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x522603A: xmlNewTextWriterMemory (in
/usr/lib/libxml2.so.2.6.27)
==19574== by 0x8357C5F: zif_xmlwriter_open_memory
(php_xmlwriter.c:1884)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574==
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
==19574==
==19574==
==19574== 8,676 (16 direct, 8,660 indirect) bytes in 2 blocks are
definitely lost in loss record 13 of 14
==19574== at 0x4021620: malloc (vg_replace_malloc.c:149)
==19574== by 0x8357E6A: zif_xmlwriter_open_uri (php_xmlwriter.c:1840)
==19574== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==19574== by 0x83E9602: execute (zend_vm_execute.h:104)
==19574== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==19574== by 0x836916C: php_execute_script (main.c:2080)
==19574== by 0x845B734: main (php_cli.c:1130)
--
Edit bug report at http://bugs.php.net/?id=46110&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46110&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46110&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46110&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46110&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=46110&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46110&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46110&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46110&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46110&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46110&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46110&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46110&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46110&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46110&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46110&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46110&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46110&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46110&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46110&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46110&r=mysqlcfg