php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75861 SEGFAULT in zend_objects_store_del during shutdown
Submitted: 2018-01-23 14:06 UTC Modified: 2021-06-09 11:56 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: deepdiver at owncloud dot com Assigned: cmb (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 7.2.1 OS: Debian 9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: deepdiver at owncloud dot com
New email:
PHP Version: OS:

 

 [2018-01-23 14:06 UTC] deepdiver at owncloud dot com
Description:
------------
We observe a segfault with 7.2.0 and 7.2.1 as soon as the memcached module is loaded.

This happens at the very end when running our testsuites with phpunit.
Doesn't help much but here is the failing travis execution.

I have this reproduced locally and I have the coredump in gdb.

Here is the backtrace:
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/php7.2...Reading symbols from /usr/lib/debug/.build-id/e0/7d0878ecea2bca94547dfad8d7dfc57848832b.debug...done.
done.
[New LWP 2701]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php7.2 ../lib/composer/phpunit/phpunit/phpunit --configuration phpunit-autotest'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  zend_objects_store_del (object=0x7f251f13a2b0) at ./Zend/zend_objects_API.c:191
191	./Zend/zend_objects_API.c: No such file or directory.
(gdb) bt
#0  zend_objects_store_del (object=0x7f251f13a2b0) at ./Zend/zend_objects_API.c:191
#1  0x00005631eb049d56 in _zval_dtor_func (p=<optimized out>) at ./Zend/zend_variables.c:56
#2  0x00005631eb049d9d in i_zval_ptr_dtor (zval_ptr=0x7f251f0fa590) at ./Zend/zend_variables.h:49
#3  _zval_dtor_func (p=0x7f251f0fa588) at ./Zend/zend_variables.c:69
#4  0x00005631eb05dc7d in i_zval_ptr_dtor (zval_ptr=0x7f253376f1a0) at ./Zend/zend_variables.h:49
#5  zend_array_destroy (ht=0x7f253375c690) at ./Zend/zend_hash.c:1308
#6  0x00005631eb03efa4 in destroy_op_array (op_array=0x7f253349f598) at ./Zend/zend_opcode.c:380
#7  0x00005631eb05d8c5 in zend_hash_destroy (ht=ht@entry=0x7f253349c340) at ./Zend/zend_hash.c:1234
#8  0x00005631eb03ed31 in destroy_zend_class (zv=<optimized out>) at ./Zend/zend_opcode.c:288
#9  0x00005631eb05d904 in zend_hash_destroy (ht=0x5631eb9634e0) at ./Zend/zend_hash.c:1253
#10 0x00005631eb04bc11 in zend_shutdown () at ./Zend/zend.c:911
#11 0x00005631eafe6e0b in php_module_shutdown () at ./main/main.c:2453
#12 0x00005631eae9beb0 in main (argc=6, argv=0x5631eb963040) at ./sapi/cli/php_cli.c:1419
(gdb) 



What further information do you need to get this sorted out?

THX


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-29 16:28 UTC] crodriguez at owncloud dot com
Just in case anyone else sees this problem, just do not unload the extension.. (export ZEND_DONT_UNLOAD_MODULES=1) 
in fact PHP should load all extensions with RTLD_NODELETE unless it has means to ensure all extensions are dlclose safe.. most code out there is not.

If you want to get rid of this problem, relink the memcached extension with -Wl,-z,nodelete.
 [2021-06-09 11:56 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-09 11:56 UTC] cmb@php.net
The memcached bug tracker is now on Github[1].  If this is still
an issue with the current memcached version, please report there.

[1] <https://github.com/php-memcached-dev/php-memcached/issues>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC