#45822 [NEW]: Invalid value passed to StrToTime crashes W3WP process

[email protected] ("matt at neimeyer dot org")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             matt at neimeyer dot org
Operating system: Windows 2003
PHP version:      5.2.6
PHP Bug Type:     Reproducible crash
Bug description:  Invalid value passed to StrToTime crashes W3WP process

Description:
------------
Using a stock installation of PHP 5.2.6 (or 5.2.5 or 5.2.3) as an ISAPI
module on Windows 2003 Standard Edition x32 (fully updated using Windows
Update), if you pass a "wacky" value to strtotime the w3wp.exe (IIS Worker
Pool) spikes to 99% and crashes the web server.

We accidentally used date("-24 hours") instead of strtotime("-24 hours")
and then passed that (via some intermediary function calls) to strtotime.

It does not crash on Win2003 SE x64 (or any other operating system that we
run this application on).

I am aware of other w3wp.exe bugs being reported but those do not seem to
match this specific cause. Similarly, strtotime bugs don't seem to match.

Reproduce code:
---------------
echo strtotime(date("-24 hours"));

Expected result:
----------------
Return false or -1

(with the caveat that I know it's "bad code" on my part)

Actual result:
--------------
w3wp.exe crashes as soon as the page starts to load.

Watching in task manager on the web server, you can see w3wp.exe spike to
99% then stay there. If you kill the task the web server behaves oddly,
generating "Service Unavailable" results to the end browser until the
"World Wide Web Publishing Service" is restarted.

-- 
Edit bug report at http://bugs.php.net/?id=45822&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45822&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45822&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45822&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45822&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=45822&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45822&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45822&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45822&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45822&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45822&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=45822&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=45822&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45822&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45822&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45822&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45822&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45822&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45822&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45822&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45822&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.