php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75683 Memory leak in zend_register_functions() in ZTS mode
Submitted: 2017-12-14 05:38 UTC Modified: -
From: aharvey@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 7.2Git-2017-12-14 (Git) OS: Linux x86-64
Private report: No CVE-ID: None
 [2017-12-14 05:38 UTC] aharvey@php.net
Description:
------------
With ZTS enabled, valgrind reports a series of memory leaks in zend_register_functions(), specifically the section related to the new code in PHP 7.2 that converts type hint names into zend_string pointers.

Compiled with --enable-maintainer-zts --disable-all, I get this:

aharvey@ububox:~/trees/php-src/7.2-leak$ valgrind --leak-check=full ./sapi/cli/php -m
==27591== Memcheck, a memory error detector
==27591== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==27591== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==27591== Command: ./sapi/cli/php -m
==27591== 
[PHP Modules]
Core
date
pcre
Reflection
SPL
standard

[Zend Modules]

==27591== 
==27591== HEAP SUMMARY:
==27591==     in use at exit: 2,592 bytes in 35 blocks
==27591==   total heap usage: 9,624 allocs, 9,589 frees, 1,548,120 bytes allocated
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 1 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x26F269: zm_startup_reflection (php_reflection.c:6739)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591==    by 0x1E5995: main (php_cli.c:1371)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 2 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x26FDAD: zm_startup_reflection (php_reflection.c:6777)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591==    by 0x1E5995: main (php_cli.c:1371)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 3 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x278E16: spl_register_std_class (spl_functions.c:46)
==27591==    by 0x282FCE: zm_startup_spl_iterators (spl_iterators.c:3714)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 4 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x28302A: zm_startup_spl_iterators (spl_iterators.c:3718)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 5 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x283056: zm_startup_spl_iterators (spl_iterators.c:3721)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 6 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x283102: zm_startup_spl_iterators (spl_iterators.c:3730)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 7 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x2832D2: zm_startup_spl_iterators (spl_iterators.c:3751)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 8 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x2832FA: zm_startup_spl_iterators (spl_iterators.c:3753)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 9 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x28333C: zm_startup_spl_iterators (spl_iterators.c:3757)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 48 bytes in 1 blocks are definitely lost in loss record 10 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x278C11: spl_register_interface (spl_functions.c:36)
==27591==    by 0x29415D: zm_startup_spl_observer (spl_observer.c:1244)
==27591==    by 0x2784CD: zm_startup_spl (php_spl.c:985)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591== 
==27591== 72 bytes in 1 blocks are definitely lost in loss record 11 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x26ED3A: zm_startup_reflection (php_reflection.c:6726)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591==    by 0x1E5995: main (php_cli.c:1371)
==27591== 
==27591== 72 bytes in 1 blocks are definitely lost in loss record 12 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x26FB15: zm_startup_reflection (php_reflection.c:6764)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591==    by 0x1E5995: main (php_cli.c:1371)
==27591== 
==27591== 72 bytes in 1 blocks are definitely lost in loss record 13 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x283098: zm_startup_spl_iterators (spl_iterators.c:3724)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 72 bytes in 1 blocks are definitely lost in loss record 14 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x2830C0: zm_startup_spl_iterators (spl_iterators.c:3726)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 72 bytes in 1 blocks are definitely lost in loss record 15 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x283186: zm_startup_spl_iterators (spl_iterators.c:3737)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 72 bytes in 1 blocks are definitely lost in loss record 16 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x283290: zm_startup_spl_iterators (spl_iterators.c:3748)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 96 bytes in 1 blocks are definitely lost in loss record 17 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x1EB93E: date_register_classes (php_date.c:2094)
==27591==    by 0x1EC7D3: zm_startup_date (php_date.c:856)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591== 
==27591== 96 bytes in 1 blocks are definitely lost in loss record 18 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x1EBC06: date_register_classes (php_date.c:2106)
==27591==    by 0x1EC7D3: zm_startup_date (php_date.c:856)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591== 
==27591== 96 bytes in 1 blocks are definitely lost in loss record 19 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x278E16: spl_register_std_class (spl_functions.c:46)
==27591==    by 0x282CB8: zm_startup_spl_iterators (spl_iterators.c:3685)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591== 
==27591== 96 bytes in 1 blocks are definitely lost in loss record 20 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x28315E: zm_startup_spl_iterators (spl_iterators.c:3735)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 96 bytes in 2 blocks are definitely lost in loss record 21 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x278C11: spl_register_interface (spl_functions.c:36)
==27591==    by 0x294177: zm_startup_spl_observer (spl_observer.c:1245)
==27591==    by 0x2784CD: zm_startup_spl (php_spl.c:985)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591== 
==27591== 120 bytes in 1 blocks are definitely lost in loss record 22 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x2834E6: zm_startup_spl_iterators (spl_iterators.c:3778)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 144 bytes in 1 blocks are definitely lost in loss record 23 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x283364: zm_startup_spl_iterators (spl_iterators.c:3759)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 144 bytes in 1 blocks are definitely lost in loss record 24 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x3A3D5E: zend_register_internal_class (zend_API.c:2764)
==27591==    by 0x3A3D5E: zend_register_internal_class_ex (zend_API.c:2736)
==27591==    by 0x279035: spl_register_sub_class (spl_functions.c:61)
==27591==    by 0x28346E: zm_startup_spl_iterators (spl_iterators.c:3768)
==27591==    by 0x278497: zm_startup_spl (php_spl.c:979)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591== 
==27591== 168 bytes in 3 blocks are definitely lost in loss record 25 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A386D: do_register_internal_class (zend_API.c:2716)
==27591==    by 0x278E16: spl_register_std_class (spl_functions.c:46)
==27591==    by 0x29434D: zm_startup_spl_observer (spl_observer.c:1263)
==27591==    by 0x2784CD: zm_startup_spl (php_spl.c:985)
==27591==    by 0x39E25B: zend_startup_module_ex.part.7 (zend_API.c:1873)
==27591==    by 0x39E348: zend_startup_module_ex (zend_API.c:1885)
==27591==    by 0x39E348: zend_startup_module_zval (zend_API.c:1888)
==27591==    by 0x3AF699: zend_hash_apply (zend_hash.c:1506)
==27591==    by 0x3A1A5D: zend_startup_modules (zend_API.c:1999)
==27591==    by 0x32BA6A: php_module_startup (main.c:2309)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591== 
==27591== 624 bytes in 7 blocks are definitely lost in loss record 26 of 26
==27591==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27591==    by 0x3A29F2: zend_register_functions (zend_API.c:2306)
==27591==    by 0x3A35CF: zend_register_module_ex (zend_API.c:2061)
==27591==    by 0x32B214: php_register_extensions (main.c:2021)
==27591==    by 0x32BA2A: php_module_startup (main.c:2293)
==27591==    by 0x45660C: php_cli_startup (php_cli.c:431)
==27591==    by 0x1E5995: main (php_cli.c:1371)
==27591== 
==27591== LEAK SUMMARY:
==27591==    definitely lost: 2,592 bytes in 35 blocks
==27591==    indirectly lost: 0 bytes in 0 blocks
==27591==      possibly lost: 0 bytes in 0 blocks
==27591==    still reachable: 0 bytes in 0 blocks
==27591==         suppressed: 0 bytes in 0 blocks
==27591== 
==27591== For counts of detected and suppressed errors, rerun with: -v
==27591== ERROR SUMMARY: 26 errors from 26 contexts (suppressed: 0 from 0)

In a non-ZTS build, there is no leak.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-12 08:08 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b3f91d16dd902d94bc77bead01196af5dbf31c16
Log: Fixed bug #75683 (Memory leak in zend_register_functions() in ZTS mode)
 [2018-03-12 08:08 UTC] dmitry@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC