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

 ID:               52238
 Comment by:       giorgio dot liscio at email dot it
 Reported by:      php-bugs at majkl578 dot cz
 Summary:          Crash when an Exception occured in iterator_to_array
 Status:           Open
 Type:             Bug
 Package:          Reproducible crash
 Operating System: Linux Debian
 PHP Version:      5.3.2

 New Comment:

crashes on windows x64 with php 5.3.2 installed as module on apache 2


Previous Comments:
------------------------------------------------------------------------
[2010-07-02 20:46:26] php-bugs at majkl578 dot cz

Backtrace:



#0  spl_iterator_apply (obj=0x93d610c, 

    apply_func=0xb7064140 <spl_iterator_to_array_apply>,
puser=0x93d6170)

    at /tmp/buildd/php5-5.3.2/ext/spl/spl_iterators.c:3038

#1  0xb70660fd in zif_iterator_to_array (ht=1, return_value=0x93d6170, 

    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)

    at /tmp/buildd/php5-5.3.2/ext/spl/spl_iterators.c:3111

#2  0xb719cddb in execute_internal (execute_data_ptr=0x941bcbc, 

    return_value_used=1) at
/tmp/buildd/php5-5.3.2/Zend/zend_execute.c:1260

#3  0xb6756aac in xdebug_execute_internal
(current_execute_data=0x941bcbc, 

    return_value_used=1)

    at
/build/buildd-xdebug_2.0.5-1+b1-i386-VWnNbE/xdebug-2.0.5/build-php5/xdebug.c:1631

#4  0xb33bced3 in ?? () from /usr/lib/php5/20090626+lfs/suhosin.so

#5  0xb71c8a18 in zend_do_fcall_common_helper_SPEC (execute_data=0x12)

    at /tmp/buildd/php5-5.3.2/Zend/zend_vm_execute.h:315

#6  0xb719f77e in execute (op_array=0x93d6028)

    at /tmp/buildd/php5-5.3.2/Zend/zend_vm_execute.h:104

#7  0xb6756765 in xdebug_execute (op_array=0x93d6028)

    at
/build/buildd-xdebug_2.0.5-1+b1-i386-VWnNbE/xdebug-2.0.5/build-php5/xdebug.c:1562

#8  0xb33bd334 in ?? () from /usr/lib/php5/20090626+lfs/suhosin.so

#9  0xb71758e6 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)

    at /tmp/buildd/php5-5.3.2/Zend/zend.c:1266

#10 0xb7119ff4 in php_execute_script (primary_file=0xbfe11fd4)

    at /tmp/buildd/php5-5.3.2/main/main.c:2288

#11 0xb7207d9b in php_handler (r=0x9412cc8)

    at /tmp/buildd/php5-5.3.2/sapi/apache2handler/sapi_apache2.c:674

#12 0x0807cb96 in ap_run_handler ()

#13 0x08080311 in ap_invoke_handler ()

#14 0x0808e390 in ap_process_request ()

#15 0x0808b3a0 in ?? ()

#16 0x080846e6 in ap_run_process_connection ()

#17 0x080930f8 in ?? ()

#18 0x0809344b in ?? ()

#19 0x0809423c in ap_mpm_run ()

#20 0x080696a4 in main ()

------------------------------------------------------------------------
[2010-07-02 20:27:42] php-bugs at majkl578 dot cz

Description:
------------
PHP crashes when an Exception is thrown from
IteratorAggregate::getIterator() and passed to iterator_to_array().

Test script:
---------------
class Foo implements IteratorAggregate

{

        public function bar()

        {

                throw new Exception;

        }

        

        public function getIterator()

        {

                return new ArrayIterator($this->bar());

        }

}



var_dump(iterator_to_array(new Foo));

Expected result:
----------------
Uncaught Exception

Actual result:
--------------
PHP crashed


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



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

Reply via email to