Schroedinger's Bug - may require exorcism...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So... I have this script (being called in a perfectly typical way by PHP 4.4.1 through mod_php in Apache 2.0.55) which sometimes runs perfectly, and sometimes chooses, totally haphazardly, to seemingly run itself twice, which of course causes it to die with a fatal error after it tries to redefine some functions.

As mysterious as that is, it turns out it must be something altogether more sinister. I tried putting die() at the end of the script, on the assumption that it was for some reason executing twice, yet behold: the problem is still present, and the PHP error log still complains about constants and functions being redefined! The problem, I therefore thought, cannot be that the script is being run twice. (In retrospect, this was the most likely possibility, because the page doesn't actually output anything if it dies with this error.) So for debugging, I added a bit that logs one message to a file immediately before the die() at the end of the file, and a different message after the die(). The die() seems to be working normally, in that it only logs the first message...

But wait a second! WTF? If the PHP error log is to be believed, then the script should be dying with a fatal error before it even *gets* to that point in the script, isn't it?

And the greater WTF is the fact that, as I mentioned above, every time the page is requested, it unpredictably either does this or works flawlessly. Oh my. How do I even *begin* to debug something like this?

Thanks for any help.
-- Adam Atlas

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux