Bug #71977 [NEW]: After opcache turned on to cause Segmentation fault
From: wangduo1122 at 163 dot com
Operating system: Linux
PHP version: 7.0.5
Package: opcache
Bug Type: Bug
Bug description: After opcache turned on to cause Segmentation fault
Description:
------------
When turned on opcache, the first call to extension function normally ,
the second appeared Segmentation fault. Close opcache is normal.Through
debug and found add_assoc_stringl,add_assoc_long caused Segmentation
fault when turned on opcache
Test script:
---------------
ZEND_FUNCTION( L5ApiGetRoute ){
double d_time_out = 0;
std::string err_msg;
zval *za_qos_req;
if ( ZEND_NUM_ARGS() == 2 ){
if ( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"ad",&za_qos_req,&d_time_out) == FAILURE ){
RETURN_LONG(-2);
}else{
WRONG_PARAM_COUNT;
RETURN_LONG(-3);
}
php_var_dump(za_qos_req, 1);
add_assoc_stringl( za_qos_req, "hostIp", "10.175.90.28", 12);
add_assoc_long( za_qos_req, "hostPort", 80 );
}
PHP code:
<?php
$l5_req = array(
'modId' => 64100225,
'cmdId' => 65536
);
$l5_time_out = 0.2;
$ret = L5ApiGetRoute($l5_req, $l5_time_out);
print_r($l5_req);
$l5_reqx = array(
'modId' => 64000833,
'key' => 3
);
$ret = L5ApiGetRoute($l5_reqx, $l5_time_out);
print_r($l5_reqx);
?>
PHP.INI(opcache config)
zend_extension=opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=10
opcache.fast_shutdown=1
opcache.enable_cli=1
Actual result:
--------------
[root@cweb_sports_api_new_10 ~/cl5/php/src]#
/usr/local/qqwebsrv/php7/bin/php test.php
array(2) {
["modId"]=>
int(64100225)
["cmdId"]=>
int(65536)
}
Array
(
[modId] => 64100225
[cmdId] => 65536
[hostIp] => 10.175.90.28
[hostPort] => 80
)
array(2) {---------------------Get the correct parameters
["modId"]=>
int(64000833)
["key"]=>
int(3)
}
Array
(
[modId] => 64000833
[key] => 3
[hostIp] => 10.175.90.28
[hostPort] => 80
)
[root@cweb_sports_api_new_10 ~/cl5/php/src]#
/usr/local/qqwebsrv/php7/bin/php test.php
array(2) {
["modId"]=>
int(64100225)
["cmdId"]=>
int(65536)
}
Array
(
[modId] => 64100225
[cmdId] => 65536
[hostIp] => 10.175.90.28
[hostPort] => 80
)
array(32696) {----------------------Did not get to the parameter
Segmentation fault (core dumped)
--
Edit bug report at https://bugs.php.net/bug.php?id=71977&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71977&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71977&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71977&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71977&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71977&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71977&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71977&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71977&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71977&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71977&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71977&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71977&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71977&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71977&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71977&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71977&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71977&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71977&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71977&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71977&r=mysqlcfg
Thread (5 messages)
- wangduo1122 at 163 dot com