Tuesday, February 08, 2005

Laying bear a PHP bug

I've been playing around with security profiles on my main home computer (XP Professional), and have found new ways to destabilize my system. Upshot is, with the non-admin account I usually use, Firefox is crashing occasionally on form submittal.

I wanted to post here my response to a problem Mr. Bear was having at "The Truth Laid Bear" was having in case I lost it again:
This might be due to a known PHP bug.

The one thing I noticed from the lsof output is the value in the size/offset column for the one Unix domain socket (~544MB). Not the IP socket — I think that's stuck in CLOSE_WAIT because that's how Apache deals with connections while it's waiting for possibly dependent file handles to close.

If this is an error with Unix sockets, then it's probably an inter-process communication problem. Running 'lsof -U -r' should who that one socket going out of control parallel with the HTTPD process. Something in Apache is going nuts trying to talk to some other process, most likely MySQL.

The best match I could find is this bug first reported for PHP 4.3.4. There's an official PHP bug page for it. It's been fixed in CVS, but I don't see it incorporated into any 4.x release yet. As a bonus, the bug descriptions include test script to recreate the problem on purpose.

If that doesn't pan out, I did find one other thread where it looks like mysql_close wasn't behaving as the guy expected it to.

No comments: