|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-11-28 13:26 UTC] cfc4n at cnxct dot com
Description:
------------
php5.4.8
dump server:ubuntu 12.04 64bit (gcc 4.6.3)
load server:centos 6.2 64bit (gcc 4.6.3)
Use dump.php to dump a.php to a bin file with apc_bin_dumpfile function on dump
server(ubuntu 12.04). and copy this bin file to an other server(centos 6.2),use
load.php to load this bin file . and It'll result to a core dump. But it is works
in dump server ....
And remove static array() syntax ,It'll work to in php5.4.x .
So,I think there is a wrong about cross compiler maybe. but I can't find that. :(
-----------------------------------
PS:In php5.3.x ,It's works.
Test script:
---------------
compile pram:
./configure --prefix=/usr/local/service/php --with-config-file-path=/usr/local/service/php/etc --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --enable-bcmath --with-mcrypt --enable-fpm
a.php:
<?php
class T{
//private static $_instance; // It's works.
private static $_instance = array(); //It's crashed
public function __construct() {
if ( self::$_instance[$c] ) {
throw new Exception('Single Forbidden');
}
}
public static function getInstance($a = array()){
$c = get_called_class();
if (self::$_instance[$c] == null ) {
self::$_instance[$c] = new $c();
}
return self::$_instance[$c];
}
public function hello() {
echo "hello world!";
}
}
class B{
private static $_instance = array();
public function hello() {
echo "hello world BB!";
}
}
?>
dump.php:
<?php
$dir = dirname(__FILE__);
apc_compile_file($dir.'/T.php');
apc_bin_dumpfile(array($dir.'/T.php'), array(), 'apc.bin');
?>
load.php:
<?php
error_reporting(E_ALL ^ E_NOTICE);
$dir = dirname(__FILE__);
apc_bin_loadfile('apc.bin');
var_dump( apc_cache_info());
include($dir.'/T.php');
$t = new T();
$t->getInstance();
$t->hello();
?>
Expected result:
----------------
fixed it, as result like php5.3.x (ZEND_ENGINE_2_3)
Actual result:
--------------
#0 0x000000000092dac0 in zend_inline_hash_func (arKey=0xffffffff <Address
0xffffffff out of bounds>, nKeyLength=1) at /home/cfc4n/php-
5.4.8/Zend/zend_hash.h:283
#1 0x000000000092dcfe in _zend_hash_add_or_update (ht=0x11fec60,
arKey=0xffffffff <Address 0xffffffff out of bounds>, nKeyLength=1,
pData=0x7fffffffcdb0, nDataSize=32, pDest=0x0, flag=2)
at /home/cfc4n/php-5.4.8/Zend/zend_hash.c:215
#2 0x00000000009078aa in zend_register_auto_global (name=0x7fffffffcde0 "",
name_len=0, jit=160 \240, auto_global_callback=0x1290780) at /home/cfc4n/php-
5.4.8/Zend/zend_compile.c:6667
#3 0x000000000091c63b in _zval_dtor_func (zvalue=0x7ffff7fcce40) at
/home/cfc4n/php-5.4.8/Zend/zend_variables.c:43
#4 0x000000000090b4b9 in _zval_dtor (zval_ptr=0x7ffff7fd0b28) at
/home/cfc4n/php-5.4.8/Zend/zend_variables.h:35
#5 _zval_ptr_dtor (zval_ptr=0x7ffff7fd0b28) at /home/cfc4n/php-
5.4.8/Zend/zend_execute_API.c:438
#6 0x00007fffeb8335db in apc_free_class_entry_after_execution
(src=0x7ffff7fd0bf0) at /home/cfc4n/APC-3.1.13/apc_compile.c:1992
#7 0x00007fffeb836bb4 in apc_deactivate () at /home/cfc4n/APC-
3.1.13/apc_main.c:948
#8 0x00007fffeb836ccf in apc_request_shutdown () at /home/cfc4n/APC-
3.1.13/apc_main.c:1042
#9 0x00007fffeb826ce4 in zm_deactivate_apc (type=1, module_number=46) at
/home/cfc4n/APC-3.1.13/php_apc.c:407
#10 0x00000000009280ba in zend_deactivate_modules () at /home/cfc4n/php-
5.4.8/Zend/zend_API.c:2335
#11 0x000000000089bf74 in php_request_shutdown (dummy=0x0) at /home/cfc4n/php-
5.4.8/main/main.c:1759
#12 0x0000000000a5437b in do_cli (argc=2, argv=0x7fffffffe678) at
/home/cfc4n/php-5.4.8/sapi/cli/php_cli.c:1171
#13 0x0000000000a54947 in main (argc=2, argv=0x7fffffffe678) at /home/cfc4n/php-
5.4.8/sapi/cli/php_cli.c:1364
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
I'm so sorry that the content of load.php was : <?php $dir = dirname(__FILE__); apc_bin_loadfile('apc.bin'); var_dump( apc_cache_info()); include($dir.'/T.php'); $t = T::getInstance(); $t->hello(); // core ..... $b = new B(); $b->hello(); // not core The wrong content was test for non static array syntax leaved. and use a common array syntax was the same result -- core dump.