Bug #18336: Loop in PHP code causes crash in Apache2 instead of PHP error message
| From: | peter at helpnet dot com dot au | Date: | Sun, 14 Jul 2002 09:40:12 +0000 |
| Subject: | Bug #18336: Loop in PHP code causes crash in Apache2 instead of PHP error message | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-14127@lists.php.net to get a copy of this message | ||
From: peter@helpnet.com.au
Operating system: Windows NT
PHP version: 4.2.1
PHP Bug Type: Reproducible crash
Bug description: Loop in PHP code causes crash in Apache2 instead of PHP error message
I wrote a function that called itself occasionally. When I accidentally
changed the selection criteria the wrong way, the function went in to a
loop calling itself. Instead of getting a PHP error message, Apache2
crashed with:
Apache.exe Exception stack overflow(oxc000000fd), Address: 0x00801366
There were no error messages in any logs, Apache, NT, or PHP.
At first I thought it an Apache error as I upgraded to Apache 2 with the
release of Apache 2.0.35 and PHP 4.2.0. That combination produced
occasional random errors on some new extensions, including DOMXML, but
nothing I needed for a production environment.
An upgrade to PHP 4.2.1 made matters worse as it made every test site
crash. An upgrade to Apache 2.0.39 did nothing to help PHP's problems. I
tried php4-win32-latest.zip today, 2002-07-14, but it crashed Apache on
start up. (Apache worked with everything non PHP.)
php4-win32-STABLE-latest.zip solved the start up crash and solved the
crashes with the other test sites.
Back to the code that induced the first problem. I had just turned
sessions on in the test site and thought the PHP session code had failed
under Apache but most of the other sites were running happily with PHP
4.2.0 sessions under Apache2. Eventually I discovered the exact line
causing the problem. In the past when I created an infinite loop in PHP,
it either produced a PHP time out message or a PHP memory limit error.
Because I have hundreds of Mb available and set php.ini's memory usage to
many times the default, tiny test programs rarely run out of memory before
timing out.
Under PHP 4.2.0 onwards and Apache 2, the result is an Apache crash
instead of a PHP error.
The Apache 2 httpd.conf contains the defaults for all process related
settings.
php.ini contains the defaults except for an increase in the memory
allocation to 30 Mb and changing error reporting to report all errors.
--
Edit bug report at http://bugs.php.net/?id=18336&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18336&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18336&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18336&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18336&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18336&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18336&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18336&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18336&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18336&r=globals