Edit report at https://bugs.php.net/bug.php?id=62084&edit=1
ID: 62084 Updated by: fel...@php.net Reported by: victor dot kupriyanov at gmail dot com Summary: Segfault during inheritance check on method -Status: Open +Status: Feedback Type: Bug Package: *Compile Issues Operating System: Any PHP Version: 5.4.3 Block user comment: N Private report: N New Comment: I can't reproduce it. Try disabling the xdebug and testing it again. Previous Comments: ------------------------------------------------------------------------ [2012-05-21 02:27:31] victor dot kupriyanov at gmail dot com Description: ------------ When inherited method has different type hinting information for the method parameters and E_STRICT error reporting level is set - PHP tries to report method declaration incompatibility and segfaults on attempt to dereference a null pointer. Test script: --------------- <?php class A {} class B { public function b(A $a) {} } class C extends B { public function b($a) {} } $a = new C(); Expected result: ---------------- Valid message explaining that inherited method has a different signature. Actual result: -------------- $ php a.php Segmentation fault (core dumped) ... (gdb) bt #0 zend_get_function_declaration (fptr=0x0) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3046 #1 0x00000000005a2479 in do_inheritance_check_on_method (child= 0x7ffff7fc3558, parent=0x7ffff7fc3f18) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3267 #2 0x00000000005a2665 in do_inherit_method_check ( child_function_table=<value optimized out>, parent=<value optimized out>, hash_key=<value optimized out>, child_ce=0x7ffff7fc3310) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3288 #3 0x00000000005d3cf1 in zend_hash_replace_checker_wrapper (target= 0x7ffff7fc3338, source=<value optimized out>, pCopyConstructor= 0x5a7bc0 <do_inherit_method>, size=240, pMergeSource= 0x5a2620 <do_inherit_method_check>, pParam=0x7ffff7fc3310) at /usr/src/debug/php-5.4.3/Zend/zend_hash.c:878 #4 zend_hash_merge_ex (target=0x7ffff7fc3338, source=<value optimized out>, pCopyConstructor=0x5a7bc0 <do_inherit_method>, size=240, pMergeSource= 0x5a2620 <do_inherit_method_check>, pParam=0x7ffff7fc3310) at /usr/src/debug/php-5.4.3/Zend/zend_hash.c:892 #5 0x00000000005a850b in zend_do_inheritance (ce=0x7ffff7fc3310, parent_ce= 0x7ffff7fc2ff8) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3519 #6 0x00000000005a962c in do_bind_inherited_class ( op_array=<value optimized out>, opline=<value optimized out>, class_table= 0xdf4c30, parent_ce=0x7ffff7fc2ff8, compile_time=1 '\001') at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4569 #7 0x00000000005a985a in zend_do_early_binding () at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4626 #8 0x000000000058c1ca in zendparse () at /usr/src/debug/php-5.4.3/Zend/zend_language_parser.c:3547 #9 0x000000000058fa0d in compile_file (file_handle=0x7fffffffdec0, type=<value optimized out>) at Zend/zend_language_scanner.l:579 #10 0x00007fffeb6d4042 in phar_compile_file (file_handle=0x7fffffffdec0, type= 8) at /usr/src/debug/php-5.4.3/ext/phar/phar.c:3391 #11 0x00007ffff1d8101d in xdebug_compile_file ( file_handle=<value optimized out>, type=<value optimized out>) at /usr/src/debug/php-pecl-xdebug-2.2.0/xdebug-2.2.0/xdebug.c:1537 #12 0x00000000005c70ca in zend_execute_scripts (type=8, retval=0x0, file_count= 3) at /usr/src/debug/php-5.4.3/Zend/zend.c:1264 #13 0x0000000000566cc3 in php_execute_script (primary_file=0x7fffffffdec0) at /usr/src/debug/php-5.4.3/main/main.c:2473 #14 0x0000000000672395 in do_cli (argc=2, argv=0x7fffffffe1f8) at /usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:983 #15 0x0000000000672cbc in main (argc=2, argv=0x7fffffffe1f8) at /usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:1356 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62084&edit=1