php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63405 Segfault with traits and namespaces and as operator
Submitted: 2012-10-31 09:30 UTC Modified: 2012-11-01 01:04 UTC
From: mbretter@php.net Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.4.8 OS: Ubuntu 12.04 32bit
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mbretter@php.net
New email:
PHP Version: OS:

 

 [2012-10-31 09:30 UTC] mbretter@php.net
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-31 14:39 UTC] laruence@php.net
could you give us a complete test script?
 [2012-10-31 20:59 UTC] mbretter@php.net
I could reduce it to the relevant files:
http://www.1401.at/phpcrash.tgz

=> just invoke index.php several times, the crash occurs reliably ;)
 [2012-10-31 21:10 UTC] mbretter@php.net
ok, I've found that the problem disappears, if I'm disabling APC, so this bug seems to be APC related.

So you can close this Bug.
 [2012-10-31 21:16 UTC] mbretter@php.net
after Upgrading APC from 3.1.11 to 3.1.13 the crash does not occur anymore :D
 [2012-11-01 01:04 UTC] sixd@php.net
Closing as per previous comment.
 [2012-11-01 01:04 UTC] sixd@php.net
-Status: Open +Status: Not a bug -Package: Scripting Engine problem +Package: APC
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC