PHP Crashes with GPF on NT due to Parser forgets defined functions
| From: | Daniel Lange | Date: | Wed, 26 Jan 2000 17:05:48 +0000 |
| Subject: | PHP Crashes with GPF on NT due to Parser forgets defined functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14932@lists.php.net to get a copy of this message | ||
In Bug id #2061 it is stated that in complex scripts PHP 3.0.11 forgets
defined functions.
This behaviour still exists in 3.0.14! On NT there is also a high risk of
php.exe crashing with a GPF (protection fault) after this occurs.
I found the following method to reproduce the bug and crash PHP on
Windoze NT 4.0SP6a servers every time: (hope it'll crash you too :-)
1)
Use NT4+PHP3.0.14 (with new PHP_IMAP4r1.DLL (e.g. from greg@darkphoton.com)
that does not crash on IMAP reads frequently as the dist .dll does due to the
bug documented in bug id #2651 and solved in TWIG's FAQ:
http://twig.screwdriver.net/file.php3?file=FAQ&plaintext=1
)
O.k. that was only to make sure this would not play tricks on us, so
let's find the annoying parser bug now:
2)
Grab the -pre9 versions of horde AND imp from
ftp://ftp.horde.org/horde.org/imp/tarballs/
NOTE: It must be those versions others will not crash so nicely. ;-)
3)
Install into .../horde and .../horde/imp right out of the box.
4)
On a command line try:
php.exe <Drive:>\path\to\imp-dir\index.php3
And voila:
===cut===Start of Output on console===cut===
Content-type: text/html
<br>
<b>Fatal error</b>: Call to unsupported or undefined function preg_match() in
<b>../lib/horde.lib</b> on line <b>935</b><br>
===cut===End of Output on console===cut===
At this point php.exe will have caused a GPF too and NT will bring up Doc Watson
to write a dump!
The parser error might be valid (...it is not) but php.exe should definitely not crash.
Additional info:
The scheme is that script errors (eg ";" at the wrong location or unescaped
"\"'s) will cause the right parser message in simple scripts. In more complex
ones it will cause the error to be output and then cause a GPF in php.exe.
In even more complex ones the parser will find functions undefined that
actually are defined and php.exe will crash with a GPF too.
You can also call php.exe as a cgi from Apache to process index.php3 as above.
It'll also dump the php.exe but may not show the error message due to Apache buffering...
The parser bug seems to be occurring on other OS's as well as bug #2061 was
reported on RedHat Linux 5.2, kernel 2.0.36.
Any ideas?
Daniel