patch-fd-lexer5

php.internals

Sascha Schumann

23 years ago
Hi, today I discovered that I had overlooked a zend_fopen call in zend_execute.c which caused PHP/Solaris to still fail in some cases. The new patch modifies the specific section of code (right at the beginning of the patch): http://schumann.cx/patch-fd-lexer5 The current load test will run over night. If it is successful, I'll propose to merge this into PHP_4_3. - Sascha

David Knox

23 years ago
Thanks for setting this up! -- dave

Jani Taskinen

23 years ago
On Tue, 13 May 2003, Sascha Schumann wrote:
> Hi, > > today I discovered that I had overlooked a zend_fopen call in > zend_execute.c which caused PHP/Solaris to still fail in some > cases. > > The new patch modifies the specific section of code (right at > the beginning of the patch): > > http://schumann.cx/patch-fd-lexer5 > > The current load test will run over night. If it is > successful, I'll propose to merge this into PHP_4_3.
Just commit. PHP_4_3 can't get any more broken than what it is now. --Jani

Rasmus Lerdorf

23 years ago
On Wed, 14 May 2003, Jani Taskinen wrote:
> > today I discovered that I had overlooked a zend_fopen call in > > zend_execute.c which caused PHP/Solaris to still fail in some > > cases. > > > > The new patch modifies the specific section of code (right at > > the beginning of the patch): > > > > http://schumann.cx/patch-fd-lexer5 > > > > The current load test will run over night. If it is > > successful, I'll propose to merge this into PHP_4_3. > > > Just commit. PHP_4_3 can't get any more broken than what it is now.
It seems pretty stable to me. What exactly are you referring to, or is this just your sarcastic way of disagreeing with this going into 4.3 at all? 4.3 is currently almost unusable on Solaris, which is a big bug. As far as I am concerned, Sascha is fixing a rather serious bug. Granted, it is a big change, and if the 4.3 release manager says that this shouldn't go into 4.3.2 because we are too close to the 4.3.2 release, then that is perfectly valid. Let's aim this at 4.3.3 then. But we clearly need to address this problem in the 4.3 codebase at some point. We can't just tell Solaris users that they are screwed and that they should go and try to hack sfio into PHP themselves. -Rasmus

Jani Taskinen

23 years ago
On Tue, 13 May 2003, Rasmus Lerdorf wrote:
>On Wed, 14 May 2003, Jani Taskinen wrote: >> > today I discovered that I had overlooked a zend_fopen call in >> > zend_execute.c which caused PHP/Solaris to still fail in some >> > cases. >> > >> > The new patch modifies the specific section of code (right at >> > the beginning of the patch): >> > >> > http://schumann.cx/patch-fd-lexer5 >> > >> > The current load test will run over night. If it is >> > successful, I'll propose to merge this into PHP_4_3. >> >> >> Just commit. PHP_4_3 can't get any more broken than what it is now. > >It seems pretty stable to me. What exactly are you referring to, or is >this just your sarcastic way of disagreeing with this going into 4.3 at >all?
Heh, I meant the specific problem this solves can't get any worse.
>4.3 is currently almost unusable on Solaris, which is a big bug. As far >as I am concerned, Sascha is fixing a rather serious bug. Granted, it is >a big change, and if the 4.3 release manager says that this shouldn't go >into 4.3.2 because we are too close to the 4.3.2 release, then that is
And I already promised that this fix will be in 4.3.2. :) I will roll RC3 once this patch is in. There's also the fix for the array stuff Ilia just committed that needs some testing too. --Jani

Rasmus Lerdorf

23 years ago
On Wed, 14 May 2003, Jani Taskinen wrote:
> Heh, I meant the specific problem this solves can't get any worse.
Sorry, I assumed you were being crabby. -Rasmus

Mike Robinson

23 years ago
Rasmus Lerdorf wrote: [snip]
> We can't just tell Solaris users that they are screwed
[snip] Too late. I've been doing that for several years now. Best Regards Mike Robinson --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.481 / Virus Database: 277 - Release Date: 13/05/2003

Uwe Schindler

23 years ago
At 15:00 13.05.2003 -0700, Rasmus Lerdorf wrote:
>On Wed, 14 May 2003, Jani Taskinen wrote: > > > today I discovered that I had overlooked a zend_fopen call in > > > zend_execute.c which caused PHP/Solaris to still fail in some > > > cases. > > > > > > The new patch modifies the specific section of code (right at > > > the beginning of the patch): > > > > > > http://schumann.cx/patch-fd-lexer5 > > > > > > The current load test will run over night. If it is > > > successful, I'll propose to merge this into PHP_4_3. > > > > > > Just commit. PHP_4_3 can't get any more broken than what it is now. > >It seems pretty stable to me. What exactly are you referring to, or is >this just your sarcastic way of disagreeing with this going into 4.3 at >all? > >4.3 is currently almost unusable on Solaris, which is a big bug. As far >as I am concerned, Sascha is fixing a rather serious bug. Granted, it is >a big change, and if the 4.3 release manager says that this shouldn't go >into 4.3.2 because we are too close to the 4.3.2 release, then that is >perfectly valid. Let's aim this at 4.3.3 then. But we clearly need to >address this problem in the 4.3 codebase at some point. We can't just >tell Solaris users that they are screwed and that they should go and try >to hack sfio into PHP themselves. > >-Rasmus
I agree, it seems stable to me, too. The only thing to do is to check extensions for use of fopen/fdopen. Often you find similar lines to this in extensions (just search the code): fh.handle.fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r"); this should be changed, too. I am rewriting for example browscap.c to use streams without knowing if they use fp or fd when reading ini file.

Rasmus Lerdorf

23 years ago
On Wed, 14 May 2003, Uwe Schindler wrote:
> I agree, it seems stable to me, too. The only thing to do is to check > extensions for use of fopen/fdopen. > Often you find similar lines to this in extensions (just search the code): > fh.handle.fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r"); > this should be changed, too. > I am rewriting for example browscap.c to use streams without knowing if > they use fp or fd when reading ini file.
Sure, but this is orthogonal to the patch itself. Getting rid of stdio in other places is a good idea, but it doesn't absolutely have to be done. Getting rid of it in the core gets us most of the way there. Chances are the few other places in external bits won't overflow the fp limit. -Rasmus

Sascha Schumann

23 years ago
> Just commit. PHP_4_3 can't get any more broken than what it is now.
The 4.3 branch has been much improved since the last release. The NEWS file alone counts 170 fixed bugs. I'm absolutely positive that way more than that has been addressed, including the segfaults caused by arbitrary input data (crashme script). The fd lexer patch is another step in that direction. It has been extremely well tested using a pretty complex smarty based app. There are some more tests I want to complete (Hartmut, are you listening?) to ensure complete BC. IMHO, PHP 4.3.3 is destined for becoming the best release in a long time. - Sascha

Sascha Schumann

23 years ago
> IMHO, PHP 4.3.3 is destined for becoming the best release in > a long time.
Call that a freudian slip, if you want to. s/4.3.3/4.3.2/ - Sascha

Edin Kadribasic

23 years ago
On Wed, 14 May 2003, Sascha Schumann wrote:
> > IMHO, PHP 4.3.3 is destined for becoming the best release in > > a long time. > > Call that a freudian slip, if you want to. s/4.3.3/4.3.2/
If we are going to have that patch in 4.3.2 why not commit it now so it can get broader testing. And lets release RC3 soon after. IMHO 4.3.2 is long overdue. Edin

Sascha Schumann

23 years ago
> If we are going to have that patch in 4.3.2 why not commit it now so it > can get broader testing. And lets release RC3 soon after.
Yay: Edin, Sascha Nay: - Sascha

Jani Taskinen

23 years ago
On Wed, 14 May 2003, Sascha Schumann wrote:
>> If we are going to have that patch in 4.3.2 why not commit it now so it >> can get broader testing. And lets release RC3 soon after.
- Yay: Edin, Sascha + Yay: Edin, Sascha, Jani Nay:

James Cox

23 years ago
> On Wed, 14 May 2003, Sascha Schumann wrote: > > >> If we are going to have that patch in 4.3.2 why not commit it now so it > >> can get broader testing. And lets release RC3 soon after. >
from what I see of this, and the performance increase I've seen, this looks really good. Thanks Sascha. Yay: Edin, Sascha, Jani, James

Rasmus Lerdorf

23 years ago
> On Wed, 14 May 2003, Sascha Schumann wrote: > ... > > Yay: Edin, Sascha, Jani, James, Wez, Rasmus > Nay:
ok, go nuts! ;)

Wez Furlong

23 years ago
+1 to have the patch in 4.3.2 --Wez. On Wed, 14 May 2003, Jani Taskinen wrote:

Jani Taskinen

23 years ago
On Wed, 14 May 2003, Sascha Schumann wrote:
>> IMHO, PHP 4.3.3 is destined for becoming the best release in >> a long time. > > Call that a freudian slip, if you want to. s/4.3.3/4.3.2/
I actually do agree that 4.3.3 will be the best. :) --Jani

Zeev Suraski

23 years ago
At 01:00 14/05/2003, Rasmus Lerdorf wrote:
>4.3 is currently almost unusable on Solaris, which is a big bug.
Can you explain this statement? What went wrong in 4.3 that makes it almost unusable under Solaris? (for the record, I'm not trying to argue against the inclusion of the fd-lexer patch in 4.3.2, but understand the scope of the problem). Zeev

Uwe Schindler

23 years ago
Read this: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=ffaqs/01406 The problem is the limitation of fopen()/fdopen() that will fail if the FD used is > 255 (FILE* on solaris has only an unsigned char in the struct for the FD). The most used webserver on Solaris (SunONE/iPlanet) opens a lot of files and PHP is then unable to open them by fopen()/fdopen() because the internally used FD is then > 255. At 14:07 14.05.2003 +0300, Zeev Suraski wrote:
>At 01:00 14/05/2003, Rasmus Lerdorf wrote: >>4.3 is currently almost unusable on Solaris, which is a big bug. > >Can you explain this statement? What went wrong in 4.3 that makes it >almost unusable under Solaris? (for the record, I'm not trying to argue >against the inclusion of the fd-lexer patch in 4.3.2, but understand the >scope of the problem). > >Zeev > > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php
----- Uwe Schindler Addr 1: Bamberger Str. 24a, D-96049 Bamberg Addr 2: Drausnickstr. 153, D-91052 Erlangen http://www.thetaphi.de - http:///www.schindlers-software.de eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company) Tel./Fax: +49 700 PCLATEIN (+49 700 72528346) Schindlers Software - Home of Schindlers PC-LATEIN 3.10 DIE Software zum Lateinlernen!

Zeev Suraski

23 years ago
At 15:38 14/05/2003, Uwe Schindler wrote:
>Read this: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=ffaqs/01406 > >The problem is the limitation of fopen()/fdopen() that will fail if the FD >used is > 255 (FILE* on solaris has only an unsigned char in the struct >for the FD).
Well, that's a problem I bumped into in 1996 with Apache and a large number of log files, that's really nothing new :) I was under the impression that there was something unique about PHP 4.3 that made this problem surface. What I'm trying to understand is what happened in PHP 4.3 that changed anything, if any. If this antique problem just suddenly surfaced for no particular reason, it's fine, but then saying that PHP is virtually unusable under Solaris is a big exaggeration. Most users of Solaris will never bump into that problem.
> The most used webserver on Solaris (SunONE/iPlanet) opens a lot of files > and PHP is then unable to open them by fopen()/fdopen() because the > internally used FD is then > 255.
I doubt very much that there are many PHP deployments running under SunONE/iPlanet at this time, because of threading issues. Are we really dealing with a SunONE issue here? Zeev

Wez Furlong

23 years ago
Thats correct; this Solaris problem is nothing new, and affects everyone (even the perl guys/monks/masochists). --Wez. On Wed, 14 May 2003, Zeev Suraski wrote:

Uwe Schindler

23 years ago
At 15:48 14.05.2003 +0300, Zeev Suraski wrote:
>At 15:38 14/05/2003, Uwe Schindler wrote: >>Read this: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=ffaqs/01406 >> >>The problem is the limitation of fopen()/fdopen() that will fail if the >>FD used is > 255 (FILE* on solaris has only an unsigned char in the >>struct for the FD). > >Well, that's a problem I bumped into in 1996 with Apache and a large >number of log files, that's really nothing new :) I was under the >impression that there was something unique about PHP 4.3 that made this >problem surface. What I'm trying to understand is what happened in PHP >4.3 that changed anything, if any. If this antique problem just suddenly >surfaced for no particular reason, it's fine, but then saying that PHP is >virtually unusable under Solaris is a big exaggeration. Most users of >Solaris will never bump into that problem. > >> The most used webserver on Solaris (SunONE/iPlanet) opens a lot of >> files and PHP is then unable to open them by fopen()/fdopen() because >> the internally used FD is then > 255. > >I doubt very much that there are many PHP deployments running under >SunONE/iPlanet at this time, because of threading issues. Are we really >dealing with a SunONE issue here?
The threading problem is no problem anymore because with the newest SunONE/iPlanet servers they do not appear under Solaris/Win32. I have a really heavy loaded solaris server which has no problems. The NSAPI plugin is fixed now, also and gives the SAPI all standard _SERVER variables (exactly the same as apache does). Also some memory leaks appearing with the newest SunONE servers are fixed now. So there is nothing against using PHP with Solaris 8/9 and PHP 4.3.2 if the fd-lexer patch is used. Performance is really good. I will maintain the NSAPI module in future. By the way, can anybody run the credits-update-script before releasing PHP 4.3.2 ? :-) And for other users which have still problems there is a new NSAPI plugin written by me that can be used with the CGI version of PHP: http://www.thetaphi.de/php-ressources/
>Zeev
Uwe

Zeev Suraski

23 years ago
At 16:11 14/05/2003, Uwe Schindler wrote:
>>I doubt very much that there are many PHP deployments running under >>SunONE/iPlanet at this time, because of threading issues. Are we really >>dealing with a SunONE issue here? > >The threading problem is no problem anymore because with the newest >SunONE/iPlanet servers they do not appear under Solaris/Win32. I have a >really heavy loaded solaris server which has no problems.
You're one helluva lucky guy :) Zeev