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

 ID:                 54372
 Updated by:         dmi...@php.net
 Reported by:        atorkhov at gmail dot com
 Summary:            Crash accessing global object itself returned from
                     its __get() handle
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   Linux
 PHP Version:        5.3SVN-2011-03-24 (snap)
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

fixed in php-trunk and php-5.3


Previous Comments:
------------------------------------------------------------------------
[2011-04-07 15:35:29] dmi...@php.net

Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=310009
Log: Fixed bug #54372 (Crash accessing global object itself returned
from its __get() handle)

------------------------------------------------------------------------
[2011-03-25 14:32:05] atorkhov at gmail dot com

'Fatal error: Call to a member function b() on a non-object' is wrong
behaviour either. Test should return nothing.

------------------------------------------------------------------------
[2011-03-24 22:25:53] fel...@php.net

I can reproduce the issue using:

<?php

class test_class

{

    public function __get($name)

    {

        return $this;

    }

}



global $test3;

$test3 = new test_class();

var_dump($test3->a);

?>



Your test gives me 'Fatal error: Call to a member function b() on a
non-object'.

------------------------------------------------------------------------
[2011-03-24 17:21:37] atorkhov at gmail dot com

(changing version in header)

------------------------------------------------------------------------
[2011-03-24 17:14:57] atorkhov at gmail dot com

Crashes too with backtrace:



#0  zend_object_store_get_object (zobject=0x8e5621c) at
/home/alex/tmp/php5.3-201103241530/Zend/zend_objects_API.c:269

#1  0x082b3ca1 in zend_std_get_method (object_ptr=0x8e85a78,
method_name=0x8e581cc "b", method_len=1) at
/home/alex/tmp/php5.3-201103241530/Zend/zend_object_handlers.c:842

#2  0x082d90c3 in ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER
(execute_data=0x8e85a60) at
/home/alex/tmp/php5.3-201103241530/Zend/zend_vm_execute.h:10388

#3  0x082b7ab9 in execute (op_array=0x8e566a4) at
/home/alex/tmp/php5.3-201103241530/Zend/zend_vm_execute.h:107

#4  0x082972b2 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/alex/tmp/php5.3-201103241530/Zend/zend.c:1194

#5  0x08245dc0 in php_execute_script (primary_file=0xbfc959f0) at
/home/alex/tmp/php5.3-201103241530/main/main.c:2270

#6  0x0831a318 in main (argc=3, argv=0xbfc95b64) at
/home/alex/tmp/php5.3-201103241530/sapi/cli/php_cli.c:1193

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


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

    http://bugs.php.net/bug.php?id=54372


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

Reply via email to