Description of problem: Running this script twice: <?php if(xcache_isset('boroda')) $a = xcache_get('boroda'); else $a = array(); print_r($a); $db = new PDO('mysql:dbname=BPLnew;unix_socket=/var/lib/mysql/mysql.sock','root',''); $a[] = $db->query("SELECT 1"); xcache_set('boroda', $a, 3000); ?> leads to crash Version-Release number of selected component: php-fpm-5.6.1-1.fc21 Additional info: reporter: libreport-2.2.3 backtrace_rating: 4 cmdline: 'php-fpm: pool mikhail' '' '' '' '' '' '' '' '' '' '' crash_function: zend_std_object_get_class_name executable: /usr/sbin/php-fpm kernel: 3.17.0-301.fc21.x86_64+debug runlevel: N 5 type: CCpp uid: 1000 Truncated backtrace: Thread no. 1 (10 frames) #0 zend_std_object_get_class_name at /usr/src/debug/php-5.6.1/Zend/zend_object_handlers.c:1536 #1 zend_print_zval_r_ex at /usr/src/debug/php-5.6.1/Zend/zend.c:420 #2 print_hash at /usr/src/debug/php-5.6.1/Zend/zend.c:184 #3 zend_print_zval_r_ex at /usr/src/debug/php-5.6.1/Zend/zend.c:409 #4 zend_print_zval_r at /usr/src/debug/php-5.6.1/Zend/zend.c:395 #5 zif_print_r at /usr/src/debug/php-5.6.1/ext/standard/basic_functions.c:5527 #6 dtrace_execute_internal at /usr/src/debug/php-5.6.1/Zend/zend_dtrace.c:97 #7 zend_do_fcall_common_helper_SPEC at /usr/src/debug/php-5.6.1/Zend/zend_vm_execute.h:560 #8 execute_ex at /usr/src/debug/php-5.6.1/Zend/zend_vm_execute.h:363 #9 dtrace_execute_ex at /usr/src/debug/php-5.6.1/Zend/zend_dtrace.c:73
Created attachment 947022 [details] File: backtrace
Created attachment 947023 [details] File: cgroup
Created attachment 947024 [details] File: core_backtrace
Created attachment 947025 [details] File: dso_list
Created attachment 947026 [details] File: environ
Created attachment 947027 [details] File: exploitable
Created attachment 947028 [details] File: limits
Created attachment 947029 [details] File: maps
Created attachment 947030 [details] File: open_fds
Created attachment 947031 [details] File: proc_pid_status
Created attachment 947032 [details] File: var_log_messages
First, this is not a PHP bug, so re-affecting to XCache. Sorry but your code doesn't have any sense. You should not cache the query (PDOStatement) but the result of the Query. Despite, XCache should not crash, and properly detect the error. If you try $a = $db->query("SELECT 1"); It will raise a fatal error Fatal error: xcache_set(): Objects cannot be stored in the variable cache. Use serialize before xcache_set in But with $a[] = $db->query("SELECT 1"); Xcache is unable to detect that the value cannot be cached.
Created attachment 947099 [details] xcache.patch This patch seems to solve this issue anc correctly raise a fatal error with an array of objects. Need to get upstream feedback.
Upstream report: https://groups.google.com/forum/#!topic/xcache/vwlzkQBkeHI
Created attachment 947116 [details] xcache.patch Improve previous, protect against recursion
Closing as workaround (good code) exists, and this but have be reported upstream with a patch proposal. Even if it seems, upstream don't care of segfault on bad code.
*** Bug 1238879 has been marked as a duplicate of this bug. ***