[php-src] Issue #8185: pear install: error in malloc_consolidate
| From: | arnaud-lb | Date: | Mon, 18 Apr 2022 11:52:16 +0000 |
| Subject: | [php-src] Issue #8185: pear install: error in malloc_consolidate | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241054@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8185
Comment Author: arnaud-lb
Thank you, I can reproduce the issue now :)
Running the command with
USE_ZEND_ALLOC=0 valgrind ... gives the following hint:
```
==957== Invalid read of size 1
==957== at 0x8A0E8C: UnknownInlinedFun (zend_string.h:329)
==957== by 0x8A0E8C: free_ini_entry (zend_ini.c:78)
==957== by 0x832E3C: zend_hash_destroy (zend_hash.c:1591)
==957== by 0x8A13DC: zend_ini_dtor (zend_ini.c:111)
==957== by 0x81D073: executor_globals_dtor (zend.c:808)
==957== by 0x7A2846: ts_free_id (TSRM.c:541)
==957== by 0x81F2CD: zend_shutdown (zend.c:1138)
==957== by 0x7A6158: UnknownInlinedFun (main.c:2413)
==957== by 0x7A6158: php_module_shutdown (main.c:2390)
==957== by 0x64310D: main (php_cli.c:1382)
==957== Address 0x65c12c4 is 4 bytes inside a block of size 48 free'd
==957== at 0x48378E9: free (vg_replace_malloc.c:538)
==957== by 0x832E3C: zend_hash_destroy (zend_hash.c:1591)
==957== by 0x7A50C5: php_request_shutdown (main.c:1871)
==957== by 0x9256ED: do_cli (php_cli.c:1135)
==957== by 0x6430EB: main (php_cli.c:1367)
==957== Block was alloc'd at
==957== at 0x4836751: malloc (vg_replace_malloc.c:307)
==957== by 0x7E4BFC: __zend_malloc (zend_alloc.c:3056)
==957== by 0x8B7403: UnknownInlinedFun (zend_string.h:150)
==957== by 0x8B7403: UnknownInlinedFun (zend_string.h:172)
==957== by 0x8B7403: zend_string_init_interned_request (zend_string.c:313)
==957== by 0x8A1751: zend_register_ini_entries (zend_ini.c:219)
==957== by 0x6668860: ???
==957== by 0x824399: UnknownInlinedFun (zend_API.c:2199)
==957== by 0x824399: zend_startup_module_ex (zend_API.c:2152)
==957== by 0x7314A7: php_load_extension (dl.c:225)
==957== by 0x73167E: php_dl (dl.c:268)
==957== by 0x731729: zif_dl (dl.c:61)
==957== by 0x89928E: UnknownInlinedFun (zend_vm_execute.h:1297)
==957== by 0x89928E: execute_ex (zend_vm_execute.h:55404)
==957== by 0x89F85E: zend_execute (zend_vm_execute.h:59771)
==957== by 0x81FB1A: zend_execute_scripts (zend.c:1792)
```
The extension in zif_dl is zlib.so
php_request_shutdown (main.c:1871) is this line: https://github.com/php/php-src/blob/php-8.1.5/main/main.c#L1871
The crash does not happen with GC disabled.