ID:               26698
 Updated by:       [EMAIL PROTECTED]
 Reported By:      davidc at bLesys dot com
-Status:           Open
+Status:           Verified
 Bug Type:         Reproducible crash
 Operating System: Win XP Professional
 PHP Version:      5CVS-2003-12-22 (dev)
 New Comment:

Using CLI:
0x0832ba22 in _zval_ptr_dtor (zval_ptr=0x55e78c0c,
__zend_filename=0x856c820 "/opt/dev/php/php5/Zend/zend_execute.h",
    __zend_lineno=114) at
/opt/dev/php/php5/Zend/zend_execute_API.c:353
353             (*zval_ptr)->refcount--;

#0  0x0832ba22 in _zval_ptr_dtor (zval_ptr=0x55e78c0c,
__zend_filename=0x856c820 "/opt/dev/php/php5/Zend/zend_execute.h",
    __zend_lineno=114) at
/opt/dev/php/php5/Zend/zend_execute_API.c:353
No locals.
#1  0x08361ef9 in zend_ptr_stack_clear_multiple () at
zend_execute.h:114
        p = (void **) 0x55e78c0c
        delete_count = 1441317091
#2  0x0835d7ed in zend_do_fcall_common_helper (execute_data=0xfeffd3c0,
op_array=0x55e88f30)
    at /opt/dev/php/php5/Zend/zend_execute.c:2630
        original_return_value = (zval **) 0xfeffd4dc
        current_scope = (zend_class_entry *) 0x0
        current_this = (zval *) 0x0
        return_value_used = 0
        should_change_scope = 1 '\001'
#3  0x0835d8cc in zend_do_fcall_by_name_handler
(execute_data=0xfeffd3c0, op_array=0x55e88f30)
    at /opt/dev/php/php5/Zend/zend_execute.c:2651
No locals.
#4  0x0835998d in execute (op_array=0x55e88f30) at
/opt/dev/php/php5/Zend/zend_execute.c:1260
        execute_data = {opline = 0x55e89790, function_state =
{function_symbol_table = 0x55e8be80, function = 0x55e88f30,
    reserved = {0x0, 0x0, 0x55e88f30, 0x0}}, fbc = 0x0, fbc_constructor
= 0x0, op_array = 0x55e88f30, object = 0x0,
  Ts = 0xfeffd2a4, original_in_execution = 0 '\0', calling_scope =
0x9d, prev_execute_data = 0x0}
#5  0x08337624 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /opt/dev/php/php5/Zend/zend.c:1049
        files = 0xfeffd514 ""
        i = 1
        file_handle = (zend_file_handle *) 0xfefff800
        orig_op_array = (zend_op_array *) 0x0
        local_retval = (zval *) 0x0



Previous Comments:
------------------------------------------------------------------------

[2003-12-22 16:51:31] davidc at bLesys dot com

Description:
------------
(bug was not fixed in beta3 also)

While evaluting argument 3 to pass to method setProperties, an
exception is thrown but any attempt to rethrow this exception/new
exception or return from the method crashes PHP.
Strangely, no problem is encountered if this exception is thrown while
evaluting the first two arguments.
The solution for now is to create a local variable that holds the
contents of the argument. Then, we simply pass the local variable to
the method, but this creates additional work for the programmer.

Reproduce code:
---------------
<?php
class x
{ function getFirst(){ throw ( new Exception( "No rows present"));} }
class Proxy
{
 function setProperties($c){}
   /* public void*/function setObject( $b, $obj, $res){
     try
   {
       $res=new x();
    $this->setProperties($a,$b,$res->getFirst());
   }
   catch(Exception $e)
   {
        throw new Exception("Failed to get it!");
   }
  }
}
$p =( new Proxy());
 $p->setObject($this,$o,$ret);?>

Expected result:
----------------
Thrown exception caught by PHP5's default handler (stack output, etc)

Actual result:
--------------
Apache2 dies


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


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

Reply via email to