php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80092 ZTS + preload = segfault on shutdown
Submitted: 2020-09-11 13:53 UTC Modified: 2020-09-17 10:31 UTC
From: dktapps at pmmp dot io Assigned:
Status: Closed Package: opcache
PHP Version: 7.4Git-2020-09-11 (Git) OS: Linux
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
27 - 25 = ?
Subscribe to this entry?

 
 [2020-09-11 13:53 UTC] dktapps at pmmp dot io
Description:
------------
When preloading any class in ZTS, a segfault occurs on shutdown.
Version is 7.4.10 @ 81e31eff0bc570155070183bd857b3f238ad3af6
 compiled from source on Ubuntu 20.04, compiled with

`./configure --disable-all --enable-cli --enable-maintainer-zts --enable-opcache --enable-debug`

Ran with
`valgrind sapi/cli/php -dzend_extension=$(pwd)/modules/opcache.so -dopcache.enable_cli=1 -dopcache.preload=preload.php -v`

Test script:
---------------
preload.php:
<?php

class SomeClass{}

Expected result:
----------------
The version output should be produced, without any segfault, something like the following:


PHP 7.4.10-dev (cli) (built: Sep 11 2020 14:35:58) ( ZTS DEBUG )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.10-dev, Copyright (c), by Zend Technologies

Actual result:
--------------
==136195== Memcheck, a memory error detector
==136195== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==136195== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==136195== Command: sapi/cli/php -dzend_extension=/home/user/php-src/modules/opcache.so -dopcache.enable_cli=1 -dopcache.preload=preload.php -v
==136195== 
PHP 7.4.10-dev (cli) (built: Sep 11 2020 14:50:20) ( ZTS DEBUG )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.10-dev, Copyright (c), by Zend Technologies
==136195== Invalid read of size 4
==136195==    at 0x5FFADFF: preload_shutdown (ZendAccelerator.c:3193)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf0f98 is 24 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x666FEF: zend_post_startup (zend.c:1024)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669B9: zend_startup (zend.c:892)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 8
==136195==    at 0x5FFAE09: preload_shutdown (ZendAccelerator.c:3193)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf0f90 is 16 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x666FEF: zend_post_startup (zend.c:1024)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669B9: zend_startup (zend.c:892)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 4
==136195==    at 0x5FFAE1F: preload_shutdown (ZendAccelerator.c:3193)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf0f98 is 24 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x666FEF: zend_post_startup (zend.c:1024)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669B9: zend_startup (zend.c:892)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid write of size 4
==136195==    at 0x5FFAF5E: preload_shutdown (ZendAccelerator.c:3198)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf0f98 is 24 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x666FEF: zend_post_startup (zend.c:1024)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669B9: zend_startup (zend.c:892)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 4
==136195==    at 0x5FFAFC0: preload_shutdown (ZendAccelerator.c:3202)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf1018 is 24 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 8
==136195==    at 0x5FFAFCA: preload_shutdown (ZendAccelerator.c:3202)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf1010 is 16 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 4
==136195==    at 0x5FFAFE0: preload_shutdown (ZendAccelerator.c:3202)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf1018 is 24 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 4
==136195==    at 0x5FFB03B: preload_shutdown (ZendAccelerator.c:3207)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf101c is 28 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid write of size 4
==136195==    at 0x5FFB045: preload_shutdown (ZendAccelerator.c:3207)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf101c is 28 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 4
==136195==    at 0x5FFB05F: preload_shutdown (ZendAccelerator.c:3207)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf100c is 12 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 8
==136195==    at 0x5FFB06B: preload_shutdown (ZendAccelerator.c:3207)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf1010 is 16 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid read of size 8
==136195==    at 0x5FFB0EA: preload_shutdown (ZendAccelerator.c:3207)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf1010 is 16 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== Invalid write of size 4
==136195==    at 0x5FFB11F: preload_shutdown (ZendAccelerator.c:3207)
==136195==    by 0x5FFA972: accel_shutdown (ZendAccelerator.c:3075)
==136195==    by 0x6004FD9: zm_shutdown_zend_accelerator (zend_accelerator_module.c:432)
==136195==    by 0x6753FB: module_destructor (zend_API.c:2563)
==136195==    by 0x6664AA: module_destructor_zval (zend.c:768)
==136195==    by 0x681FF8: _zend_hash_del_el_ex (zend_hash.c:1305)
==136195==    by 0x6820D8: _zend_hash_del_el (zend_hash.c:1328)
==136195==    by 0x683A0C: zend_hash_graceful_reverse_destroy (zend_hash.c:1782)
==136195==    by 0x672E02: zend_destroy_modules (zend_API.c:1995)
==136195==    by 0x66715C: zend_shutdown (zend.c:1055)
==136195==    by 0x5ABF5C: php_module_shutdown (main.c:2481)
==136195==    by 0x75A96A: main (php_cli.c:1374)
==136195==  Address 0x4bf1018 is 24 bytes inside a block of size 56 free'd
==136195==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x66700B: zend_post_startup (zend.c:1026)
==136195==    by 0x5ABB8C: php_module_startup (main.c:2360)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195==  Block was alloc'd at
==136195==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==136195==    by 0x6669CE: zend_startup (zend.c:893)
==136195==    by 0x5AB267: php_module_startup (main.c:2166)
==136195==    by 0x758362: php_cli_startup (php_cli.c:410)
==136195==    by 0x75A79A: main (php_cli.c:1326)
==136195== 
==136195== 
==136195== HEAP SUMMARY:
==136195==     in use at exit: 3,319 bytes in 10 blocks
==136195==   total heap usage: 9,003 allocs, 8,993 frees, 1,577,474 bytes allocated
==136195== 
==136195== LEAK SUMMARY:
==136195==    definitely lost: 0 bytes in 0 blocks
==136195==    indirectly lost: 0 bytes in 0 blocks
==136195==      possibly lost: 0 bytes in 0 blocks
==136195==    still reachable: 3,319 bytes in 10 blocks
==136195==         suppressed: 0 bytes in 0 blocks
==136195== Rerun with --leak-check=full to see details of leaked memory
==136195== 
==136195== For lists of detected and suppressed errors, rerun with: -s
==136195== ERROR SUMMARY: 13 errors from 13 contexts (suppressed: 0 from 0)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-11 13:54 UTC] dktapps at pmmp dot io
Correction: git hash is e41867888a76da3c270afe8dc86352e41d1f8c39.
 [2020-09-17 10:31 UTC] nikic@php.net
-Status: Open +Status: Verified
 [2020-09-17 10:31 UTC] nikic@php.net
The fact that "-v" is passed is relevant here, it does work in normal usage.
 [2023-10-02 17:46 UTC] git@php.net
Automatic comment on behalf of nielsdos
Revision: https://github.com/php/php-src/commit/bdc87b0f66666e188e35d61b9ad9199db378c4ab
Log: Fix #80092: ZTS + preload = segfault on shutdown
 [2023-10-02 17:46 UTC] git@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 20:01:26 2024 UTC