ID:               46112
 Updated by:       [EMAIL PROTECTED]
 Reported By:      erikg at codepoet dot no
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: ArchLinux
 PHP Version:      5.2.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi




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

[2008-10-07 17:44:31] erikg at codepoet dot no

The crash doesn't occur when I compile PHP with debug symbols - no idea
why.

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

[2008-09-19 11:57:32] erikg at codepoet dot no

CVS works when compiled on my laptop (32-bit Intel Core2), but still
segfaults when compiled on a development server (64-bit AMD Opteron
running in 32-bit mode).

Here is a backtrace (unfortunately only have debugging-symbols in
apache and php, but it should be sufficient):

#0  0xb766c676 in zend_do_fcall_common_helper_SPEC ()
   from /usr/lib/apache/libphp5.so
#1  0xb7658758 in execute () from /usr/lib/apache/libphp5.so
#2  0xb762f886 in zend_execute_scripts () from
/usr/lib/apache/libphp5.so
#3  0xb75e519a in php_execute_script () from
/usr/lib/apache/libphp5.so
#4  0xb76a9f31 in php_handler () from /usr/lib/apache/libphp5.so
#5  0x08084fa8 in ap_run_handler ()
#6  0x080884f1 in ap_invoke_handler ()
#7  0x080c1056 in ap_process_request ()
#8  0x080bdab8 in ?? ()
#9  0x08410a88 in ?? ()
#10 0x00000004 in ?? ()
#11 0x08410a88 in ?? ()
#12 0x00000014 in ?? ()
#13 0x00000001 in ?? ()
#14 0x081eba60 in ?? ()
#15 0xbfbc4be8 in ?? ()
#16 0x0808ce98 in ap_run_process_connection ()

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

[2008-09-18 14:26:02] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

I can't reproduce this.

PHP Fatal error:  Uncaught exception 'Exception' with message 'error'
in /tmp/test.php:3
Stack trace:
#0 /tmp/test.php(8): error()
#1 /tmp/test.php(17): Foo->__construct()
#2 {main}
  thrown in /tmp/test.php on line 3

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

[2008-09-18 10:07:16] erikg at codepoet dot no

Oops, the $item variables weren't supposed to be there. Doesn't matter
though, the segfault still triggers.

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

[2008-09-18 10:04:08] erikg at codepoet dot no

Description:
------------
Apache segfaults when throwing an exception in a function whose return
value is used to construct a class within another class' constructor.

That sentence made my head hurt, just read the code :) I haven't been
able to remove any code while still reproducing the crash.

Reproduce code:
---------------
function error($item) {
        throw new Exception("error");
}

class Foo {
        function __construct() {
                new Bar(error($item));
        }
}

class Bar {
        function __construct($param) {
        }
}

new Foo();

Expected result:
----------------
Foo object to be instantiated

Actual result:
--------------
Apache segfaults


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


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

Reply via email to