From:             itsgoingd at luzer dot sk
Operating system: FreeBSD
PHP version:      5.4.6
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Segfault when __callStatic causes infinite function call loop

Description:
------------
Calling non-existent or private static method in __callStatic magic method

(infinite function call loop) causes segfault.

Also reproducible on older 5.3.x versions on all platforms.

Test script:
---------------
<?php

class Foo {
        public static function __callStatic($a, $b) {
                self::bar();
        }
}

Foo::bar();

Expected result:
----------------
Fatal error: Allowed memory size of xxx bytes exhausted

Actual result:
--------------
Segmentation fault.

Backtrace from cordeump:
#0  0x00000000006e46f6 in instanceof_function ()
#1  0x00000000006fbfae in zend_call_method ()
#2  0x00000000007081b4 in zend_std_callstatic_user_call ()
#3  0x00000000007538bd in zend_do_fcall_common_helper_SPEC ()
#4  0x000000000070bdd8 in execute ()
#5  0x00000000006db8b1 in zend_call_function ()
#6  0x00000000006fbfeb in zend_call_method ()
#7  0x00000000007081b4 in zend_std_callstatic_user_call ()
#8  0x00000000007538bd in zend_do_fcall_common_helper_SPEC ()
#9  0x000000000070bdd8 in execute ()
... last 5 lines repeat ...
#23750 0x00000000006db8b1 in zend_call_function ()
#23751 0x00000000006fbfeb in zend_call_method ()
#23752 0x00000000007081b4 in zend_std_callstatic_user_call ()
#23753 0x00000000007538bd in zend_do_fcall_common_helper_SPEC ()
#23754 0x000000000070bdd8 in execute ()
#23755 0x00000000006e82ed in zend_execute_scripts ()
#23756 0x000000000068dffc in php_execute_script ()
#23757 0x0000000000774012 in do_cli ()
#23758 0x000000000077302d in main ()

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

Reply via email to