From: mbretter
Operating system: Ubuntu 12.04 32bit
PHP version: 5.4.8
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Segfault with traits and namespaces and as operator
Description:
------------
It looks like that this segfault occurs on every second request, when using
namespaces + traits + autloader + 'as' operator.
Without 'as' op it works.
Test script:
---------------
<?php
namespace app\modules\backend\rest\controllers;
class Language extends Generic
{
use \app\traits\rest\Mongo {
\app\traits\rest\Mongo::setQueryParam as _setQueryParam;
}
....
public function setQueryParam(&$query, $p, $op, $v)
{
switch ($p)
{
case 'name':
// whatever
break;
default:
$this->_setQueryParam($query, $p, $op, $v);
}
}
...
}
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
zend_do_bind_traits (ce=0xb6c0873c) at
/build/buildd/php5-5.4.8/Zend/zend_compile.c:4029
4029 /build/buildd/php5-5.4.8/Zend/zend_compile.c: No such file or
directory.
(gdb) bt
#0 zend_do_bind_traits (ce=0xb6c0873c) at
/build/buildd/php5-5.4.8/Zend/zend_compile.c:4029
#1 0xb6785bab in ZEND_BIND_TRAITS_SPEC_HANDLER (execute_data=0xb75ab04c)
at /build/buildd/php5-5.4.8/Zend/zend_vm_execute.h:1027
#2 0xb67bc975 in execute (op_array=0xb67442a6) at
/build/buildd/php5-5.4.8/Zend/zend_vm_execute.h:410
#3 0xb67442a6 in zend_call_function (fci=0x0, fci_cache=0x0) at
/build/buildd/php5-5.4.8/Zend/zend_execute_API.c:958
#4 0xb676abd4 in zend_call_method (object_pp=<error reading variable:
Unknown argument list address for `object_pp'.>, obj_ce=<error reading
variable: Unknown argument list address for `obj_ce'.>,
fn_proxy=<error reading variable: Unknown argument list address for
`fn_proxy'.>, function_name=<error reading variable: Unknown argument list
address for `function_name'.>,
function_name_len=<error reading variable: Unknown argument list
address for `function_name_len'.>, retval_ptr_ptr=<error reading variable:
Unknown argument list address for `retval_ptr_ptr'.>,
param_count=<error reading variable: Unknown argument list address for
`param_count'.>, arg1=<error reading variable: Unknown argument list
address for `arg1'.>,
arg2=<error reading variable: Unknown argument list address for
`arg2'.>) at /build/buildd/php5-5.4.8/Zend/zend_interfaces.c:97
#5 0xb662772a in zif_spl_autoload_call (ht=0, return_value=0x1,
return_value_ptr=0x80225b58, this_ptr=0x0, return_value_used=-2145232000)
at /build/buildd/php5-5.4.8/ext/spl/php_spl.c:436
#6 0xb6744379 in zend_call_function (fci=0x5283354c, fci_cache=0xbfffcd0b)
at /build/buildd/php5-5.4.8/Zend/zend_execute_API.c:980
#7 0xb6744b8d in zend_lookup_class_ex (name=0x802278a8
"app\\modules\\backend\\rest\\controllers\\Language", name_length=45,
key=0x0, use_autoload=1, ce=0xbfffcda0) at
/build/buildd/php5-5.4.8/Zend/zend_execute_API.c:1127
#8 0xb6744d4b in zend_lookup_class (name=0x802278a8
"app\\modules\\backend\\rest\\controllers\\Language", name_length=45,
ce=0xbfffcda0) at /build/buildd/php5-5.4.8/Zend/zend_execute_API.c:1152
#9 0xb6764d21 in zif_class_exists (ht=2, return_value=0x80225924,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at
/build/buildd/php5-5.4.8/Zend/zend_builtin_functions.c:1233
#10 0xb6800dfa in zend_do_fcall_common_helper_SPEC
(execute_data=0xb75aa9f0) at
/build/buildd/php5-5.4.8/Zend/zend_vm_execute.h:642
#11 0xb67bc975 in execute (op_array=0xb6753729) at
/build/buildd/php5-5.4.8/Zend/zend_vm_execute.h:410
#12 0xb6753729 in zend_execute_scripts (type=0, retval=0xbffff164,
file_count=0) at /build/buildd/php5-5.4.8/Zend/zend.c:1309
#13 0xb66ecdae in php_execute_script (primary_file=0xbffff164) at
/build/buildd/php5-5.4.8/main/main.c:2482
#14 0xb68036c0 in php_handler (r=0xb2c61888) at
/build/buildd/php5-5.4.8/sapi/apache2handler/sapi_apache2.c:682
--
Edit bug report at https://bugs.php.net/bug.php?id=63405&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=63405&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=63405&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=63405&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63405&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63405&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63405&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63405&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63405&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63405&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63405&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63405&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63405&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63405&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63405&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63405&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63405&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63405&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63405&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63405&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63405&r=mysqlcfg