Update on the lexer-no-stdio patch

php.internals

Sascha Schumann

23 years ago
Hi there, the patch[1] which eliminates use of stdio in the script lexer has been successfully running on php.net for half a day now. I'd still love to hear from Win32 experts whether there is a specific reason why Win32 could not simply use POSIX IO (open(), read()) instead of stdio on that platform. [1] http://www.php.net/~sas/patch-lexer-no-stdio Thanks - Sascha

J Smith

23 years ago
I applied the patch about an hour ago to an iPlanet server. We'll see how it fares over next couple of days. It doesn't get much traffic, so I'll probably run some ab tests tomorrow... J Sascha Schumann wrote:

Uwe Schindler

23 years ago
The patch now runs 5 days on my heavy loaded iPlanet Server without sfio and no problems occur. At 18:46 05.05.2003 -0400, you wrote:
>I applied the patch about an hour ago to an iPlanet server. We'll see how it >fares over next couple of days. It doesn't get much traffic, so I'll >probably run some ab tests tomorrow... > >J > >Sascha Schumann wrote: > > > Hi there, > > > > the patch[1] which eliminates use of stdio in the script > > lexer has been successfully running on php.net for half a day > > now. > > > > I'd still love to hear from Win32 experts whether there is a > > specific reason why Win32 could not simply use POSIX IO > > (open(), read()) instead of stdio on that platform. > > > > [1] http://www.php.net/~sas/patch-lexer-no-stdio > > > > Thanks > > - Sascha > > >-- >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 01:36 06/05/2003, Sascha Schumann wrote:
> Hi there, > > the patch[1] which eliminates use of stdio in the script > lexer has been successfully running on php.net for half a day > now. > > I'd still love to hear from Win32 experts whether there is a > specific reason why Win32 could not simply use POSIX IO > (open(), read()) instead of stdio on that platform.
The problem with POSIX IO under Windows is generally that it's a bit of a 'bastard child'. It works, but it shows some anomalies in certain situations. I *think* that if we limit ourselves to just simple read()'s, we should do fine. The problem start pouring in when you try some more complex stuff like fdopen(), use sockets, etc. You mentioned that URL includes are not working to begin with - did you refer to Solaris specifically or are they broken altogether? If they're broken altogether it sounds like a pretty nasty bug, doesn't it, Jani..? Zeev

Derick Rethans

23 years ago
On Tue, 6 May 2003, Zeev Suraski wrote:
> The problem with POSIX IO under Windows is generally that it's a bit of a > 'bastard child'. It works, but it shows some anomalies in certain > situations. I *think* that if we limit ourselves to just simple read()'s, > we should do fine. The problem start pouring in when you try some more > complex stuff like fdopen(), use sockets, etc.
Or try something like this: fd = open(...) // file op send(fd, ...) // socket op Windows doesn't like that either, and it's not even complex ;-) Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

Zeev Suraski

23 years ago
At 11:55 06/05/2003, Derick Rethans wrote:
>On Tue, 6 May 2003, Zeev Suraski wrote: > > > The problem with POSIX IO under Windows is generally that it's a bit of a > > 'bastard child'. It works, but it shows some anomalies in certain > > situations. I *think* that if we limit ourselves to just simple read()'s, > > we should do fine. The problem start pouring in when you try some more > > complex stuff like fdopen(), use sockets, etc. > >Or try something like this: > >fd = open(...) // file op >send(fd, ...) // socket op > >Windows doesn't like that either, and it's not even complex ;-)
I said "fdopen(), use sockets" :) Zeev

Derick Rethans

23 years ago
On Tue, 6 May 2003, Zeev Suraski wrote:
> >Or try something like this: > > > >fd = open(...) // file op > >send(fd, ...) // socket op > > > >Windows doesn't like that either, and it's not even complex ;-) > > I said "fdopen(), use sockets" :)
ok :) though it works fine if you use the socket() function and accept() and stuff... weird thing, that windows. Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

Sascha Schumann

23 years ago
> The problem with POSIX IO under Windows is generally that it's a bit of a > 'bastard child'. It works, but it shows some anomalies in certain > situations. I *think* that if we limit ourselves to just simple read()'s, > we should do fine. The problem start pouring in when you try some more > complex stuff like fdopen(), use sockets, etc.
Ok, so the patch should work on Win32 as well.
> You mentioned that URL includes are not working to begin with - did you > refer to Solaris specifically or are they broken altogether? If they're > broken altogether it sounds like a pretty nasty bug, doesn't it, Jani..?
A clean checkout from PHP_4_3 produces this: send(9, " G", 1, 0) = 1 send(9, " E", 1, 0) = 1 send(9, " T", 1, 0) = 1 etc. Note the leading space and that exactly one character is sent (which seems bogus by itself). - Sascha

Wez Furlong

23 years ago
I am investigating this issue. --Wez. On Tue, 6 May 2003, Sascha Schumann wrote:

Sascha Schumann

23 years ago
> The problem with POSIX IO under Windows is generally that it's a bit of a > 'bastard child'. It works, but it shows some anomalies in certain > situations. I *think* that if we limit ourselves to just simple read()'s, > we should do fine. The problem start pouring in when you try some more > complex stuff like fdopen(), use sockets, etc.
Has including URLs worked on Win32 ever before then? It was doing fdopen(socket(..)) basically. The patch omits that step and directly read()s from the fd (not recv). Does that work on Win32? - Sascha

Derick Rethans

23 years ago
On Tue, 6 May 2003, Sascha Schumann wrote:
> The patch omits that step and directly read()s from the fd > (not recv). Does that work on Win32?
No, that doesn't work correctly. Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

Edin Kadribasic

23 years ago
On Tue, 6 May 2003, Sascha Schumann wrote:
> Has including URLs worked on Win32 ever before then? It was > doing fdopen(socket(..)) basically.
Inlcuding URLs has worked on win32 since 4.3.0. Edin

Sascha Schumann

23 years ago
On Tue, 6 May 2003, Edin Kadribasic wrote:
> On Tue, 6 May 2003, Sascha Schumann wrote: > > > Has including URLs worked on Win32 ever before then? It was > > doing fdopen(socket(..)) basically. > > Inlcuding URLs has worked on win32 since 4.3.0.
Yes, with a hack -- it writes out the socket content to a temporary file. I think we can simplify the code by adding a HANDLE_SOCKET_FD type to the lexer, so that the lexer simply calls recv when appropiate. That is a lot better from my POV than messing with temporary files. - Sascha

Uwe Schindler

23 years ago
Our intention is not to use any things like fdopen(), fopen() because this two commands do not work correctly under solaris. We want pure POSIX. At 10:55 06.05.2003 +0300, you wrote:
>At 01:36 06/05/2003, Sascha Schumann wrote: >> Hi there, >> >> the patch[1] which eliminates use of stdio in the script >> lexer has been successfully running on php.net for half a day >> now. >> >> I'd still love to hear from Win32 experts whether there is a >> specific reason why Win32 could not simply use POSIX IO >> (open(), read()) instead of stdio on that platform. > >The problem with POSIX IO under Windows is generally that it's a bit of a >'bastard child'. It works, but it shows some anomalies in certain >situations. I *think* that if we limit ourselves to just simple read()'s, >we should do fine. The problem start pouring in when you try some more >complex stuff like fdopen(), use sockets, etc. > >You mentioned that URL includes are not working to begin with - did you >refer to Solaris specifically or are they broken altogether? If they're >broken altogether it sounds like a pretty nasty bug, doesn't it, Jani..? > >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!