Edit report at https://bugs.php.net/bug.php?id=63066&edit=1

 ID:                 63066
 Patch added by:     larue...@php.net
 Reported by:        Jared dot Williams1 at ntlworld dot com
 Summary:            Calling an undefined method in a generator results
                     in a seg fault
 Status:             Assigned
 Type:               Bug
 Package:            Class/Object related
 Operating System:   Linux ubuntu 3.5.0-14-generic #1
 PHP Version:        master-Git-2012-09-11 (Git)
 Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

The following patch has been added/updated:

Patch Name: bug63066.patch
Revision:   1347377278
URL:        
https://bugs.php.net/patch-display.php?bug=63066&patch=bug63066.patch&revision=1347377278


Previous Comments:
------------------------------------------------------------------------
[2012-09-11 15:12:54] larue...@php.net

nikic, while method is not exists, then the EX(object)'s refcount will not be 
increased..

then this object will be dtor in genertor_close, and then the arguments of 
previous exeucte_data clean up.. 

nikic, please look at this.  thanks

------------------------------------------------------------------------
[2012-09-11 13:50:49] Jared dot Williams1 at ntlworld dot com

Backtrace of the NON debug seg fault...

jared@ubuntu:~$ gdb ./Development/php-src/sapi/cli/php 
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jared/Development/php-src/sapi/cli/php...done.
(gdb) run fatalSegFault.php 
Starting program: /home/jared/Development/php-src/sapi/cli/php fatalSegFault.php
foo
PHP Fatal error:  Call to undefined method stdClass::fatalError() in 
/home/jared/fatalSegFault.php on line 6

Fatal error: Call to undefined method stdClass::fatalError() in 
/home/jared/fatalSegFault.php on line 6

Program received signal SIGSEGV, Segmentation fault.
0x00000000006f36b2 in gc_zval_possible_root (zv=0x7ffff7fcafd8)
    at /home/jared/Development/php-src/Zend/zend_gc.c:143
143                     GC_ZOBJ_CHECK_POSSIBLE_ROOT(zv);
(gdb) bt
#0  0x00000000006f36b2 in gc_zval_possible_root (zv=0x7ffff7fcafd8)
    at /home/jared/Development/php-src/Zend/zend_gc.c:143
#1  0x00000000006f6246 in zend_generator_close 
(generator=generator@entry=0x7ffff7fce180, 
    finished_execution=finished_execution@entry=0 '\000')
    at /home/jared/Development/php-src/Zend/zend_generators.c:148
#2  0x00000000006f63cb in zend_generator_free_storage (generator=0x7ffff7fce180)
    at /home/jared/Development/php-src/Zend/zend_generators.c:181
#3  0x00000000006fc0a8 in zend_objects_store_free_object_storage (
    objects=0xdbae60 <executor_globals+960>)
    at /home/jared/Development/php-src/Zend/zend_objects_API.c:92
#4  0x00000000006c7153 in shutdown_executor ()
    at /home/jared/Development/php-src/Zend/zend_execute_API.c:298
#5  0x00000000006d5646 in zend_deactivate () at 
/home/jared/Development/php-src/Zend/zend.c:938
#6  0x000000000067641d in php_request_shutdown (dummy=dummy@entry=0x0)
    at /home/jared/Development/php-src/main/main.c:1780
#7  0x0000000000781fe0 in do_cli (argc=2, argv=0x7fffffffe118)
    at /home/jared/Development/php-src/sapi/cli/php_cli.c:1171
#8  0x000000000042d56b in main (argc=2, argv=0x7fffffffe118)
    at /home/jared/Development/php-src/sapi/cli/php_cli.c:1364

------------------------------------------------------------------------
[2012-09-11 13:46:20] Jared dot Williams1 at ntlworld dot com

It appears that the seg fault doesn't appear in debug builds. 

Recompiled without debug again, and the seg fault is still present


jared@ubuntu:~$ php -v
PHP 5.5.0-dev (cli) (built: Sep 11 2012 14:25:38) (DEBUG)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.5.0-dev, Copyright (c) 1998-2012 Zend Technologies
jared@ubuntu:~$ php fatalSegFault.php 
foo
PHP Fatal error:  Call to undefined method stdClass::fatalError() in 
/home/jared/fatalSegFault.php on line 6

Fatal error: Call to undefined method stdClass::fatalError() in 
/home/jared/fatalSegFault.php on line 6

----

jared@ubuntu:~$ ./Development/php-src/sapi/cli/php -v
PHP 5.5.0-dev (cli) (built: Sep 11 2012 14:41:40) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.5.0-dev, Copyright (c) 1998-2012 Zend Technologies
jared@ubuntu:~$ ./Development/php-src/sapi/cli/php fatalSegFault.php 
foo
PHP Fatal error:  Call to undefined method stdClass::fatalError() in 
/home/jared/fatalSegFault.php on line 6

Fatal error: Call to undefined method stdClass::fatalError() in 
/home/jared/fatalSegFault.php on line 6
Segmentation fault

------------------------------------------------------------------------
[2012-09-11 13:17:14] jared dot williams1 at ntlworld dot com

No APC or XDebug. 

Will recompile with debug and get a bt.

------------------------------------------------------------------------
[2012-09-11 13:13:41] reeze dot xia at gmail dot com

Can't reproduce in Ubuntu too.

parallels@ubuntu:~/php-src$ uname -a
Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 
x86_64 
x86_64 x86_64 GNU/Linux


if your are testing the lastest version, Could please provide backtrace?
https://bugs.php.net/bugs-generating-backtrace.php

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63066


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63066&edit=1

Reply via email to