php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44226 Throwing an exception causes crash
Submitted: 2008-02-23 14:44 UTC Modified: 2008-04-17 10:22 UTC
Votes:11
Avg. Score:4.9 ± 0.3
Reproduced:11 of 11 (100.0%)
Same Version:9 (81.8%)
Same OS:4 (36.4%)
From: james dot j dot hackett at gmail dot com Assigned: dmitry (profile)
Status: Closed Package: Reproducible crash
PHP Version: 5.3CVS-2008-02-23 (snap) OS: linux debian 2.6.18-5-686
Private report: No CVE-ID: None
 [2008-02-23 14:44 UTC] james dot j dot hackett at gmail dot com
Description:
------------
Throwing an exception causes a segmentation fault

Reproduce code:
---------------
<?php
try{
    throw new Exception("Hi, I am an Exception");
}
catch(Exception $e)
{
    echo $e->getMessage();
}
?>


Expected result:
----------------
display "Hi, I am an Exception"

Actual result:
--------------
#0  0x0000000000000000 in ?? ()
#1  0x00002acf5c4008de in execute (op_array=0xa1af00, tsrm_ls=0xa00550) zend_vm_execute.h:91
#2  0x00002acf5c3db6aa in zend_execute_scripts (type=8, tsrm_ls=0xa00550, retval=0xa98be8, file_count=3) zend.c:1173
#3  0x00002acf5c38ba36 in php_execute_script (primary_file=0x4700cf40, tsrm_ls=0xa00550) main.c:2026
#4  0x00002acf5c474849 in php_handler (r=0x9fa5b8) sapi_apache2.c:629
#5  0x0000000000437c4a in ap_run_handler ()
#6  0x000000000043affc in ap_invoke_handler ()
#7  0x0000000000447248 in ap_process_request ()
#8  0x000000000044468c in ?? ()
#9  0x000000000043ec22 in ap_run_process_connection ()
#10 0x000000000044b696 in ?? ()
#11 0x00002acf57bbd317 in start_thread () from /lib/libpthread.so.0
#12 0x00002acf580a9d5d in clone () from /lib/libc.so.6
#13 0x0000000000000000 in ?? ()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-24 19:50 UTC] jani@php.net
Please try using this CVS snapshot:

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

For Windows (installer):

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

Does not crash for me..please try the latest CVS snapshot. And if that fails, provide the configure line you used.
 [2008-02-26 00:26 UTC] james dot j dot hackett at gmail dot com
There was no change when using the latest snapshot. I used a configure of "./configure --with-apxs2=/usr/bin/apxs2".

I am able to run 5.2.5 with no problems.
 [2008-02-26 11:07 UTC] petr at hroch dot info
Hi,
I'm experiencing the same problem on Windows platform.

Throwing an Exception causes PHP to crash.
Using PHP5.3-dev latest snapshot, running as Apache 2.2.8 module.

Regards
Petr
 [2008-03-29 01:00 UTC] jeremy at omegavortex dot net
Just wanted to add that this still isn't fixed in the latest 5.3 snapshot, for me. Windows XP Pro with SP2. Apache 2.2.8.
 [2008-03-29 19:59 UTC] auroraeosrose at gmail dot com
Wow, pretty bug - I can confirm this with Apache 2.2.8 on windows with a 5.3 snap - note this ONLY is an issue for the apache 2.2.x handler, I can't get it to crash cgi, fastcgi, or cli

Here's a backtrace from a Debug_TS build

 	cdcdcdcd()	
>	php5ts_debug.dll!execute(_zend_op_array * op_array=0x026c2268, void * * * tsrm_ls=0x0148a970)  Line 91 + 0x11 bytes	C
 	php5ts_debug.dll!zend_execute_scripts(int type=8, void * * * tsrm_ls=0x0148a970, _zval_struct * * retval=0x00000000, int file_count=3, ...)  Line 1169 + 0x21 bytes	C
 	php5ts_debug.dll!php_execute_script(_zend_file_handle * primary_file=0x0262fe30, void * * * tsrm_ls=0x0148a970)  Line 2077 + 0x1b bytes	C
 	php5apache2_2.dll!php_handler(request_rec * r=0x006d3ae0)  Line 630 + 0x13 bytes	C
 	libhttpd.dll!ap_run_handler(request_rec * r=0x006d3ae0)  Line 158 + 0x21 bytes	C
 	libhttpd.dll!ap_invoke_handler(request_rec * r=0x006b0e08)  Line 372 + 0x6 bytes	C
 	libhttpd.dll!ap_process_request(request_rec * r=0x006d3ae0)  Line 262	C
 	libhttpd.dll!ap_process_http_connection(conn_rec * c=0x006cea90)  Line 190 + 0x6 bytes	C
 	libhttpd.dll!ap_run_process_connection(conn_rec * c=0x006cea90)  Line 43 + 0x21 bytes	C
 	libhttpd.dll!ap_process_connection(conn_rec * c=0x006cea90, void * csd=0x006c7a58)  Line 178 + 0x6 bytes	C
 	libhttpd.dll!worker_main(void * thread_num_val=0x006cea88)  Line 778	C
 	msvcrt.dll!__endthreadex()  + 0xa9 bytes	
 	kernel32.dll!7c80b683()
 [2008-03-30 22:27 UTC] jeremy at omegavortex dot net
I've confirmed this is also affecting Apache 2.0.x on Windows, as well. I can't try Apache 1.3.x on this machine, though.
 [2008-03-31 00:14 UTC] RQuadling at GMail dot com
I sort of reported this earlier at http://bugs.php.net/bug.php?id=44039 but only seemed to get it to crash for ISAPI. CLI was OK.
 [2008-03-31 21:29 UTC] ghurtado at gmail dot com
I experience the same exact problem on Windows XP SP2. Throwing any PHP Exception causes Apache 2.0.63 to crash, presumably due to a PHP process crash. I am using the latest snapshot of PHP 5.3 as of 3/31/2008. This same behaviour is also present in Apache 2.2.
 [2008-04-09 08:59 UTC] tony2001@php.net
Not reproducible.
Both CLI(w/ and w/o ZTS enabled) and Apache2(prefork) work just fine, valgrind keeps silence.
Need more details to be able to reproduce it.
 [2008-04-09 22:02 UTC] mageofchrisz at gmail dot com
Hi,

I'm also having this problem but I'm not sure what type of information I can provide that will aide in reproducing the crash. A simple snippet of "throw new Exception('Hello, Crash!');" causes Apache 2.2.8 to restart all its threads.

I'm not sure what I can do to help or provide more information. It's XP SP2 (all latest updates, ie6) on a windows domain. It's an Intel Pentium D 3.4GHz, 4GiB of RAM installed but only utilizes 3.25 of it.

Apache 2.2.8 runs with mod_ssl/2.2.8 OpenSSL/0.9.8g.

If there's any more information I can provide please let me know. I've been trying to take the time to figure out how to compile a debug build but i've been busy with work-related stuff.
 [2008-04-15 20:04 UTC] l dot alberton at quipo dot it
I can reproduce this bug as well. I first thought it was a SPL problem, but it happens whenever an exception is thrown. Apache 2.2 handler, win XP. I posted a trace here:
http://bugs.php.net/bug.php?id=44546

PS: cli is ok, no bug there.
 [2008-04-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-04-17 10:22 UTC] dmitry@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 11 21:01:31 2024 UTC