Bug #63066 [Com]: Calling an undefined method in a generator results in a seg fault
| From: | laruence@php.net | Date: | Tue, 11 Sep 2012 15:29:19 +0000 |
| Subject: | Bug #63066 [Com]: Calling an undefined method in a generator results in a seg fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173333@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63066&edit=1
ID: 63066
Comment by: laruence@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:
a quick fix made, and attached, hope that will help.
Previous Comments:
------------------------------------------------------------------------
[2012-09-11 15:27:58] laruence@php.net
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
------------------------------------------------------------------------
[2012-09-11 15:12:54] laruence@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.
------------------------------------------------------------------------
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