php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78446 Memory leak in sapi/cli/php
Submitted: 2019-08-22 21:19 UTC Modified: 2019-08-23 05:29 UTC
From: wang8330 at umn dot edu Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.4Git-2019-08-22 (Git) OS: Ubuntu 18.10
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wang8330 at umn dot edu
New email:
PHP Version: OS:

 

 [2019-08-22 21:19 UTC] wang8330 at umn dot edu
Description:
------------
This bug is found in git commit: f51421c62924f8b20595c70d7a1072fe567684e5

To build php:
./buildconf --force
./configure
make 

To trigger the bug:
cat test.input | valgrind --leak-check=full --show-leak-kinds=all ./php -r 'unserialize(file_get_contents("php://stdin"));'

Expected result:
----------------
Output of Valgrind:
==12858== Memcheck, a memory error detector
==12858== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==12858== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==12858== Command: ./php -r unserialize(file_get_contents("php://stdin"));
==12858== Parent PID: 20690
==12858== 
==12858== 
==12858== HEAP SUMMARY:
==12858==     in use at exit: 1,094 bytes in 20 blocks
==12858==   total heap usage: 11,288 allocs, 11,268 frees, 1,698,043 bytes allocated
==12858== 
==12858== 5 bytes in 1 blocks are still reachable in loss record 1 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 6 bytes in 1 blocks are still reachable in loss record 2 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61709: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858== 
==12858== 6 bytes in 1 blocks are still reachable in loss record 3 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61799: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858== 
==12858== 7 bytes in 1 blocks are still reachable in loss record 4 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61765: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858== 
==12858== 9 bytes in 1 blocks are still reachable in loss record 5 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61723: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858== 
==12858== 9 bytes in 1 blocks are still reachable in loss record 6 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61744: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858== 
==12858== 9 bytes in 1 blocks are still reachable in loss record 7 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A617B3: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858== 
==12858== 11 bytes in 1 blocks are still reachable in loss record 8 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFE20E: xmlStrdup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A614EF: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A6177F: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858== 
==12858== 40 bytes in 1 blocks are still reachable in loss record 9 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFA58A: xmlNewMutex (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4AF97E8: xmlInitGlobals (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A88889: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 40 bytes in 1 blocks are still reachable in loss record 10 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFA58A: xmlNewMutex (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4AA1D19: xmlInitMemory (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888AA: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 11 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61709: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 12 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61723: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 13 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61744: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 14 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61765: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 15 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A6177F: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 16 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A61799: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 17 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A617B3: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858== 
==12858== 56 bytes in 1 blocks are still reachable in loss record 18 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A6150B: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858==    by 0x33CDFA: main (php_cli.c:1319)
==12858== 
==12858== 104 bytes in 1 blocks are still reachable in loss record 19 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4AFA64A: xmlNewRMutex (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4B5DA5C: __xmlInitializeDict (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4EE40C6: __pthread_once_slow (pthread_once.c:116)
==12858==    by 0x4AFA91A: xmlIsMainThread (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4AF9F28: __xmlGenericError (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A8888E: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858== 
==12858== 400 bytes in 1 blocks are still reachable in loss record 20 of 20
==12858==    at 0x483774F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12858==    by 0x4A617F1: xmlInitCharEncodingHandlers (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x4A888B4: xmlInitParser (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:751)
==12858==    by 0x36C7E8: php_libxml_initialize (libxml.c:747)
==12858==    by 0x36C852: zm_startup_libxml (libxml.c:790)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1708)
==12858==    by 0x58C81C: zend_startup_module_ex (zend_API.c:1661)
==12858==    by 0x58C8AB: zend_startup_module_zval (zend_API.c:1723)
==12858==    by 0x599701: zend_hash_apply (zend_hash.c:1815)
==12858==    by 0x58CB89: zend_startup_modules (zend_API.c:1834)
==12858==    by 0x52BAB2: php_module_startup (main.c:2298)
==12858==    by 0x60E16C: php_cli_startup (php_cli.c:408)
==12858==    by 0x33CDFA: main (php_cli.c:1319)
==12858== 
==12858== LEAK SUMMARY:
==12858==    definitely lost: 0 bytes in 0 blocks
==12858==    indirectly lost: 0 bytes in 0 blocks
==12858==      possibly lost: 0 bytes in 0 blocks
==12858==    still reachable: 1,094 bytes in 20 blocks
==12858==         suppressed: 0 bytes in 0 blocks
==12858== 
==12858== For counts of detected and suppressed errors, rerun with: -v
==12858== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-23 05:29 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2019-08-23 05:29 UTC] krakjoe@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

These are not accidental, notice that valgrind reports the memory as "reachable", that means it will be freed when the process is closed.

The libxml leak was purposely introduced as a fix for possible shutdown crashes in 8742276eb3905eb97a585417000c7b8df85006d4
 [2019-08-23 05:35 UTC] wang8330 at umn dot edu
Ok, thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC