Bug #75744 [Com]: Sporadic crashes when opcache enabled

From: Date: Fri, 29 Dec 2017 13:21:19 +0000
Subject: Bug #75744 [Com]: Sporadic crashes when opcache enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213319@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75744&edit=1 ID: 75744 Comment by: kochuev at gmail dot com Reported by: kochuev at gmail dot com Summary: Sporadic crashes when opcache enabled Status: Open Type: Bug Package: opcache Operating System: Oracle Linux PHP Version: 7.0.26 Block user comment: N Private report: N New Comment: Tried opcache.optimization_level=0 - no noticeable change in the frequency of crashes (may be just a bit). Traces for the crashes with opcache.protect_memory=1 (fast_shutdown => 1, optimization_level => 0x7FFFBFFF) are given below: Program terminated with signal 11, Segmentation fault. #0 php_stream_notification_free (notifier=0xffffffff) at /usr/src/debug/php-7.0.25/main/streams/streams.c:2211 2211 if (notifier->dtor) { #0 php_stream_notification_free (notifier=0xffffffff) at /usr/src/debug/php-7.0.25/main/streams/streams.c:2211 #1 0x000055619d392227 in php_stream_context_free (context=0x7f7eb2c7dae0) at /usr/src/debug/php-7.0.25/main/streams/streams.c:2186 #2 0x000055619d3ed5d1 in zend_resource_dtor (res=<optimized out>) at /usr/src/debug/php-7.0.25/Zend/zend_list.c:76 #3 0x000055619d3ed623 in zend_close_rsrc (zv=<optimized out>) at /usr/src/debug/php-7.0.25/Zend/zend_list.c:230 #4 0x000055619d3eaeb2 in zend_hash_reverse_apply (ht=0x55619d7d8558 <executor_globals+536>, apply_func=apply_func@entry=0x55619d3ed610 <zend_close_rsrc>) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1628 #5 0x000055619d3edc0c in zend_close_rsrc_list (ht=<optimized out>) at /usr/src/debug/php-7.0.25/Zend/zend_list.c:238 #6 0x000055619d3c8793 in shutdown_executor () at /usr/src/debug/php-7.0.25/Zend/zend_execute_API.c:351 #7 0x000055619d3d8598 in zend_deactivate () at /usr/src/debug/php-7.0.25/Zend/zend.c:985 #8 0x000055619d377411 in php_request_shutdown (dummy=dummy@entry=0x0) at /usr/src/debug/php-7.0.25/main/main.c:1856 #9 0x000055619d217cde in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/php-7.0.25/sapi/fpm/fpm/fpm_main.c:1995 Program terminated with signal 11, Segmentation fault. #0 0xfffffff80000001a in ?? () #0 0xfffffff80000001a in ?? () #1 0x000055619d3e9a4d in zend_hash_destroy (ht=0x7f7eb2c7eab8) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1264 #2 0x000055619d3e9d19 in zend_array_destroy (ht=0x7f7eb2c7eab8) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1324 #3 0x000055619d3e9c98 in i_zval_ptr_dtor (zval_ptr=0x7f7eb2c6ef60) at /usr/src/debug/php-7.0.25/Zend/zend_variables.h:58 #4 zend_array_destroy (ht=0x7f7eb2c7e150) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1338 #5 0x000055619d40eed4 in i_zval_ptr_dtor (zval_ptr=0x7f7eb2c7f118) at /usr/src/debug/php-7.0.25/Zend/zend_variables.h:58 #6 zend_object_std_dtor (object=0x7f7eb2c7f0c0) at /usr/src/debug/php-7.0.25/Zend/zend_objects.c:69 #7 0x000055619d413850 in zend_objects_store_free_object_storage (objects=objects@entry=0x55619d7d8670 <executor_globals+816>) at /usr/src/debug/php-7.0.25/Zend/zend_objects_API.c:99 #8 0x000055619d3c86e3 in shutdown_executor () at /usr/src/debug/php-7.0.25/Zend/zend_execute_API.c:361 #9 0x000055619d3d8598 in zend_deactivate () at /usr/src/debug/php-7.0.25/Zend/zend.c:985 #10 0x000055619d377411 in php_request_shutdown (dummy=dummy@entry=0x0) at /usr/src/debug/php-7.0.25/main/main.c:1856 #11 0x000055619d217cde in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/php-7.0.25/sapi/fpm/fpm/fpm_main.c:1995 Previous Comments: ------------------------------------------------------------------------ [2017-12-28 20:15:42] nikic@php.net These shutdown crashes are likely triggered by some form of memory corruption at an earlier point in time, so it will be hard to track down the root cause of this issue. Two things to try would be: * Set opcache.optimization_level=0, to exclude one relatively common source of issues. * Set opcache.protect_memory=1 to immediately abort if the SHM memory is corrupted. ------------------------------------------------------------------------ [2017-12-28 20:07:04] kochuev at gmail dot com Yes, correct version for the traces given is 7.0.25 which is still on our prod servers, crashes started at 7.0.12 and still in place up to 7.0.26 (but I don't have core dumps for it). ------------------------------------------------------------------------ [2017-12-28 19:57:29] spam2 at rhsoft dot net PHP Version: 7.0.26 zend_hash_destroy (ht=0x7f9987280ab8) at /usr/src/debug/php-7.0.25/ i guess 7.0.26 is a lie then and so the question is if it still happens with the latest version ------------------------------------------------------------------------ [2017-12-28 19:47:32] kochuev at gmail dot com Description: ------------ There are sporadic crashed with the traces: Program terminated with signal 11, Segmentation fault. #0 0xfffffff80000001a in ?? () #0 0xfffffff80000001a in ?? () #1 0x00005563484baa4d in zend_hash_destroy (ht=0x7f9987280ab8) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1264 #2 0x00005563484bad19 in zend_array_destroy (ht=0x7f9987280ab8) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1324 #3 0x00005563484bac98 in i_zval_ptr_dtor (zval_ptr=0x7f998726bf60) at /usr/src/debug/php-7.0.25/Zend/zend_variables.h:58 #4 zend_array_destroy (ht=0x7f9987280150) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1338 #5 0x00005563484dfed4 in i_zval_ptr_dtor (zval_ptr=0x7f9987281118) at /usr/src/debug/php-7.0.25/Zend/zend_variables.h:58 #6 zend_object_std_dtor (object=0x7f99872810c0) at /usr/src/debug/php-7.0.25/Zend/zend_objects.c:69 #7 0x00005563484e4c11 in zend_objects_store_del (object=0x7f99872810c0) at /usr/src/debug/php-7.0.25/Zend/zend_objects_API.c:178 #8 0x000055634849d140 in i_zval_ptr_dtor (zval_ptr=0x7f99872696a0) at /usr/src/debug/php-7.0.25/Zend/zend_variables.h:58 #9 zend_cleanup_user_class_data (ce=0x7f998720a800) at /usr/src/debug/php-7.0.25/Zend/zend_opcode.c:167 #10 0x0000556348499415 in shutdown_executor () at /usr/src/debug/php-7.0.25/Zend/zend_execute_API.c:336 #11 0x00005563484a9598 in zend_deactivate () at /usr/src/debug/php-7.0.25/Zend/zend.c:985 #12 0x0000556348448411 in php_request_shutdown (dummy=dummy@entry=0x0) at /usr/src/debug/php-7.0.25/main/main.c:1856 #13 0x00005563482e8cde in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/php-7.0.25/sapi/fpm/fpm/fpm_main.c:1995 Another example: Program terminated with signal 11, Segmentation fault. #0 zend_string_release (s=0x4) at /usr/src/debug/php-7.0.25/Zend/zend_string.h:269 269 if (!ZSTR_IS_INTERNED(s)) { #0 zend_string_release (s=0x4) at /usr/src/debug/php-7.0.25/Zend/zend_string.h:269 #1 free_zend_constant (zv=<optimized out>) at /usr/src/debug/php-7.0.25/Zend/zend_constants.c:41 #2 0x00005563484bbf85 in _zend_hash_del_el_ex (prev=<optimized out>, p=<optimized out>, idx=<optimized out>, ht=<optimized out>) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1025 #3 _zend_hash_del_el (p=0x7f998be85b90, idx=3164, ht=0x55634a3265a0) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1049 #4 zend_hash_reverse_apply (ht=0x55634a3265a0, apply_func=apply_func@entry=0x556348497440 <clean_non_persistent_constant>) at /usr/src/debug/php-7.0.25/Zend/zend_hash.c:1631 #5 0x00005563484977c3 in clean_non_persistent_constants () at /usr/src/debug/php-7.0.25/Zend/zend_constants.c:161 #6 0x00005563484997a5 in shutdown_executor () at /usr/src/debug/php-7.0.25/Zend/zend_execute_API.c:347 #7 0x00005563484a9598 in zend_deactivate () at /usr/src/debug/php-7.0.25/Zend/zend.c:985 #8 0x0000556348448411 in php_request_shutdown (dummy=dummy@entry=0x0) at /usr/src/debug/php-7.0.25/main/main.c:1856 #9 0x00005563482e8cde in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/php-7.0.25/sapi/fpm/fpm/fpm_main.c:1995 /var/www/corefiles_storage/core.php-fpm.6071.web138.eta.prod.ed2.etadirect.com.80.1514298742 Crashes are NOT gone if fast_shutdown is set to 0 Increasing interned_strings_buffer to a large values or settign it to zero does not help. Disabling opcache makes crashes go ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75744&edit=1

« previous php.bugs (#213319) next »