Bug #67215 [NEW]: php-cgi work with opcache, may be segmentation fault happen
| From: | dailei6200 at 163 dot com | Date: | Tue, 06 May 2014 12:21:46 +0000 |
| Subject: | Bug #67215 [NEW]: php-cgi work with opcache, may be segmentation fault happen | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185669@lists.php.net to get a copy of this message | ||
From: dailei6200 at 163 dot com
Operating system: CentOS 6.5 x86_64
PHP version: 5.5.12
Package: opcache
Bug Type: Bug
Bug description:php-cgi work with opcache, may be segmentation fault happen
Description:
------------
php-cgi work with opcache, may be segmentation fault happen
[dailei@Ideal core]$ gdb /usr/local/php-5.5.12/bin/php-cgi
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
Copyright (C) 2010 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/php-5.5.12/bin/php-cgi...done.
(gdb) run index.php
Starting program: /usr/local/php-5.5.12/bin/php-cgi index.php
[Thread debugging using libthread_db enabled]
PHP Fatal error: Cannot redeclare class c in
/home/dailei/Project/core/c.class.php on line 0
Status: 500 Internal Server Error
Content-type: text/html
Program received signal SIGSEGV, Segmentation fault.
_zval_ptr_dtor (zval_ptr=0x7ffff7fd9558) at
/usr/local/src/php-5.5.12/Zend/zend_execute_API.c:426
426 i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC);
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.132.el6.x86_64 libxml2-2.7.6-14.el6.x86_64
nss-softokn-freebl-3.14.3-10.el6_5.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) bt
#0 _zval_ptr_dtor (zval_ptr=0x7ffff7fd9558) at
/usr/local/src/php-5.5.12/Zend/zend_execute_API.c:426
#1 0x00000000006f4c57 in zend_object_std_dtor (object=0x7ffff7fd7ba8)
at /usr/local/src/php-5.5.12/Zend/zend_objects.c:54
#2 0x00000000006f4c89 in zend_objects_free_object_storage
(object=0x7ffff7fd7ba8) at
/usr/local/src/php-5.5.12/Zend/zend_objects.c:137
#3 0x00000000006fa938 in zend_objects_store_del_ref_by_handle_ex
(handle=1, handlers=<value optimized out>) at
/usr/local/src/php-5.5.12/Zend/zend_objects_API.c:226
#4 0x00000000006fa953 in zend_objects_store_del_ref
(zobject=0x7ffff7fd8870) at
/usr/local/src/php-5.5.12/Zend/zend_objects_API.c:178
#5 0x00000000006c2c80 in _zval_dtor (zval_ptr=<value optimized out>) at
/usr/local/src/php-5.5.12/Zend/zend_variables.h:35
#6 i_zval_ptr_dtor (zval_ptr=<value optimized out>) at
/usr/local/src/php-5.5.12/Zend/zend_execute.h:81
#7 _zval_ptr_dtor (zval_ptr=<value optimized out>) at
/usr/local/src/php-5.5.12/Zend/zend_execute_API.c:426
#8 0x00000000006def0b in zend_hash_clean (ht=0x7ffff7fd88a0) at
/usr/local/src/php-5.5.12/Zend/zend_hash.c:596
#9 0x00000000006c7b9b in zend_cleanup_op_array_data (function=<value
optimized out>) at /usr/local/src/php-5.5.12/Zend/zend_opcode.c:134
#10 zend_cleanup_function_data (function=<value optimized out>) at
/usr/local/src/php-5.5.12/Zend/zend_opcode.c:141
#11 0x00000000006de8e4 in zend_hash_reverse_apply (ht=0xdedc30,
apply_func=0x6c7b70 <zend_cleanup_function_data>) at
/usr/local/src/php-5.5.12/Zend/zend_hash.c:799
#12 0x00000000006c56cb in shutdown_executor () at
/usr/local/src/php-5.5.12/Zend/zend_execute_API.c:286
#13 0x00000000006d1af2 in zend_deactivate () at
/usr/local/src/php-5.5.12/Zend/zend.c:935
#14 0x000000000067323c in php_request_shutdown (dummy=<value optimized
out>) at /usr/local/src/php-5.5.12/main/main.c:1808
#15 0x0000000000781d05 in main (argc=2, argv=0x7fffffffe258) at
/usr/local/src/php-5.5.12/sapi/cgi/cgi_main.c:2505
Test script:
---------------
index.php
<?php
require __DIR__ . '/c.class.php';
function getClass() {
static $cache = NULL;
$cache = new c();
}
getClass();
require __DIR__ . '/c.class.php';
-------------------------------------------
p.class.php
<?php
class p {
protected $_keyspace = '';
}
-------------------------------------------
c.class.php
<?php
require __DIR__ . '/p.class.php';
class c extends p {
}
Expected result:
----------------
opcache.enable = Off
[dailei@Ideal core]$ /usr/local/php-5.5.12/bin/php-cgi index.php
PHP Fatal error: Cannot redeclare class c in
/home/dailei/Project/core/c.class.php on line 7
Status: 500 Internal Server Error
Content-type: text/html
[dailei@Ideal core]$ echo $?
255
Actual result:
--------------
opcache.enable = On
[dailei@Ideal core]$ /usr/local/php-5.5.12/bin/php-cgi index.php
PHP Fatal error: Cannot redeclare class c in
/home/dailei/Project/core/c.class.php on line 0
Status: 500 Internal Server Error
Content-type: text/html
段é误 (core dumped)
[dailei@Ideal core]$ echo $?
139
--
Edit bug report at https://bugs.php.net/bug.php?id=67215&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67215&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67215&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67215&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67215&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67215&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67215&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67215&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67215&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67215&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67215&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67215&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67215&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67215&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67215&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67215&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67215&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67215&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67215&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67215&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67215&r=mysqlcfg