Socket bug in PHP 5.2.11

I had to reverse a PHP upgrade today which I did just yesterday because of what I can only assume is some sort of regression error. I've been using the PEAR HTTP_Request library for webservice calls. Today I've noticed that in about 5% of requests, the request body would be incomplete for no good reason. A quick comparison with 5.2.10 showed no such problem, so I had to reverse to that version to investigate. HTTP_Request uses Net_Socket, which in turn uses the fsockopen function. I build a test case and confirmed that it was indeed a problem in that function. I checked the nightly build of PHP 5.2 and the problem is not in there, so I recon no bug report should be necessary.

UPDATE: I checked the PHP repository and the offending commit was r288034 by Sriram Natarajan. What really pisses me off about this is that not only did he check it in despite breaking a test (ext/standard/tests/streams/stream_get_contents_002.phpt). But the change made it all the way into the next bugfix release despite breaking a test. The bug was fixed 5 days ago by Dmitry Stogov in r288604.

Comments (1)

DanielNovember 19th, 2009 at 10:09 am

Thank you for sharing your insights, wondered why "make test" showed up with this. php QA seems an optional step which just got skipped for this release. :)

Leave a comment

Your comment