From:             ray at snapws dot com
Operating system: Linux and Mac
PHP version:      5.5.3
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Using traits with get_class_methods causes segfault

Description:
------------
When using multiple traits in a certain way, using get_class_methods()
causes a 
segmentation fault crash. I tested this on the following PHP versions and 
Operating systems

Mac OSX 10.8.4 PHP 5.5.0 and PHP 5.5.3
Fedora Core 19 PHP 5.5.0 and PHP 5.5.3

On php 5.4.8, the crash doesn't happen and all works as it should.

Test script:
---------------
<?php
trait parentTrait {
        public function testMethod() { }
}

trait childTrait {
        use parentTrait {
                testMethod as testMethodFromParentTrait;
        }
        public function testMethod() { }
}

class testClass {
        use childTrait;
}

$obj = new testClass();
print "Created Object successfully\n";
get_class_methods($obj);
print "Goodbye\n";

Expected result:
----------------
Expected output is:

Created Object successfully
Goodbye



Actual result:
--------------
Actual output on Mac is:

Created Object successfully
Segmentation fault: 11

On Fedora Core 19 output is:

Created Object successfully
Segmentation fault

-- 
Edit bug report at https://bugs.php.net/bug.php?id=65579&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65579&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65579&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65579&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65579&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65579&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65579&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65579&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65579&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65579&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65579&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65579&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65579&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65579&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65579&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65579&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65579&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65579&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65579&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65579&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65579&r=mysqlcfg

Reply via email to