Re: Problem with select/5 on AF_INET sockets with Windows 7
Fx <[email protected]> Fri, 6 Mar 2015 07:24:05 +0100
| Newsgroups | gmane.comp.gnu.prolog.bugs |
|---|---|
| Message-ID | <[email protected]> |
--===============4015396316050499855==
Content-Type: multipart/alternative; boundary="Apple-Mail=_0BC28BF8-0D35-428D-AD74-E04984558DF6"
--Apple-Mail=_0BC28BF8-0D35-428D-AD74-E04984558DF6
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=windows-1252
Hi,
After several days of intensive tests around socket (git 1.4.5) on =
Windows, sockets seams stables.
I have maybe an explanation for the "system_error(No error) =BB on =
Windows:
-I read somewhere that Windows didn=92t support select on streams, =
only on sockets.
So i do not use select on streams. Sad but running.
Fx
Le 25 f=E9vr. 2015 =E0 07:30, Fx <[email protected]> a =E9crit :
> Hi,
>=20
> I went ahead in the test, and discovered a new bug: when calling =
select/5 on a list filled with socket Id AND input streams:
> - on Windows i get a system_error(No error).Ok, clear.
> - on Os X, no error but finally the program crash with an overflow =
while reading another file stream during the server_process_request.=20
> - It seems like something like a stream scramble due to select, =
but i wouldn=92t bet my shirt on it.
>=20
> To illustrate, let say we have the following predicate:
>=20
> server_handle_connections(Socket):-
> connection_list_read(Reads),
> select([Socket|Reads],ReadyReads,[],[],0),
> server_accept_incomming(Socket,ReadyReads,StreamIn,StreamOut),
> server_process_request(StreamIn, StreamOut),!.
>=20
> connection_list_read(Reads) succeeds and return a list of opened input =
streams (filled in server_accept_incomming predicate)
>=20
> server_accept_incomming(Socket,ReadyReads,StreamIn,StreamOut) succeeds =
when ReadyReads contain Socket.=20
> - It =AB accepts =BB the socket, unifying StreamIn and StreamOut, =
appends StreamIn to a list of active connections
>=20
> server_process_request(StreamIn, StreamOut) reads the request, serve =
the requested file, and depending the test, close or not the streams.
>=20
> At the first time,=20
> - only the Socket is observed by the select.( Works nice on Windows =
with the correction made by Daniel.)
> - the accept return a new input stream.
> - the end of server_process_request can be viewed in to manner : it =
close the stream, or it doesn=92t close the streams.
> - if it closes the stream, the next accept call will probably =AB =
reuse =BB the last stream indices (as if there was no use of select, =
just accept): not sure this is the case.
> - if it doesn=92t close the streams, the current StreamIn could =
be observed in the next select/5 call no ? It crashes on windows, sure.
>=20
> input streams are set with no buffering, according the advice in the =
manual.
>=20
> So:
>=20
> Do i use the select/5 correctly, mixing sockets and opened input =
streams ?
>=20
> Do select/5 have a side effets on the internal stream pool (settings =
properties for example ) ?
>=20
> Did someone already use successfully select/5 on streams, to make some =
kinda multiplexing server ?
> - i see a lot of examples using accept, but no one using select. we =
can do better.
>=20
> If i am not wrong in my tests, there is maybe a problem with streams =
and select/5 on all os targets.
>=20
> Fx
>=20
> Le 20 f=E9vr. 2015 =E0 19:59, Fx <[email protected]> a =E9crit :
>=20
>> Ok, this is a very little step, but after some adventures with =
installation i have some news:
>>=20
>> Getting source from git reveal two bugs (and something curious =
maybe):
>> - impossible to use anonymous git clone , so i fall back with =
getting the snapshot.
>> - the source didn=92t contain the =91configure=92 script (i =
picked it up from the 1.4.4 tar to go on)
>> - the version is still 1.4.4 (ok it=92s not the end of the =
world).
>>=20
>> I installed the MinGW on Windows 7 32 bit, in th standard manner. =
Fortunately my antivirus didn=92t says nothing with the default a.out =
a.exe.
>> As si said previously, i took the =AB configure" file from prolog =
1.4.4 source tarball
>>=20
>> And last, but not least, the select/5 bug seems to belong to the past =
on windows (MinGW). I run again the tests wrote in this mailing list, =
and the
>> previous error didn=92t appear anymore.=20
>>=20
>> It=92s weak for a beta test, but it=92s quite a good news. It would =
be nice if i had time to write some client/server tests, things like =
that.
>>=20
>> Fx
>>=20
>>=20
>> Le 19 f=E9vr. 2015 =E0 20:40, Paulo Moura <[email protected]> a =
=E9crit :
>>=20
>>>>=20
>>>> On 19/02/2015, at 19:11, Fx <[email protected]> wrote:
>>>>=20
>>>> :)) Paulo, you are right, if it can help. I won=92t promise =
anything, but i can at least take a look, sure.
>>>>=20
>>>> Can you help, and tell me where cans i found some infos:
>>>> - What are actually the tools (or info link )to compile under =
Windows (7,32b my office copmuter)
>>>> - What are actually the tools (or info link )to compile under Os X =
(this one is really rather a computer, my personnal(s) one(s)).
>>>=20
>>> I cannot help you with building GNU Prolog on Windows but, on Mac OS =
X, just follow the steps in the INTALL file.
>>>=20
>>>> Dont=92 they exists some kinda unit tests ? Prolog coded scenario ? =
Or a Jenkins like for massive testing ?
>>>=20
>>> Logtalk includes a Prolog conformance test suite but it only tests, =
as it names indicates, standards related stuff. The small number of =
conformance issues are known (and some of them are really limitations in =
the standard). I cannot speak for Daniel, of course, but testing of =
other (non-standard) features would like be more useful. Specially stuff =
this might behave differently across different operating-systems (like =
sockets :-).
>>>=20
>>> Cheers,
>>>=20
>>> Paulo
>>>=20
>>>> Le 19 f=E9vr. 2015 =E0 20:00, Paulo Moura <[email protected]> a =
=E9crit :
>>>>=20
>>>>>=20
>>>>>> On 19/02/2015, at 18:58, Fx <[email protected]> wrote:
>>>>>>=20
>>>>>> Daniel,
>>>>>>=20
>>>>>> Thank you very much for your answer, and this is a great news for =
1.4.5 !!!
>>>>>>=20
>>>>>> I=92ll be patient and wait for the official distribution.
>>>>>=20
>>>>> Don't be patient. Help instead beta-testing 1.4.5.
>>>>>=20
>>>>> Cheers,
>>>>>=20
>>>>> Paulo
>>>>>=20
>>>>>=20
>>>>>> Le 17 f=E9vr. 2015 =E0 13:32, Daniel Diaz =
<[email protected]> a =E9crit :
>>>>>>=20
>>>>>>> Hi,
>>>>>>>=20
>>>>>>> sorry for the late reply. Thank you for this bug report.
>>>>>>>=20
>>>>>>> The bug is fixed in the last git version. Will be fixed in next =
1.4.5
>>>>>>>=20
>>>>>>> Daniel
>>>>>>>=20
>>>>>>>=20
>>>>>>>=20
>>>>>>> Le 27/01/2015 12:44, [email protected] a =E9crit :
>>>>>>>> Dear Daniel,
>>>>>>>>=20
>>>>>>>> I am working on a specific http server for gnu prolog (1.4.4), =
and i discovered
>>>>>>>> a strange comportment under windows 7 (32) with the select/5 =
predicate.
>>>>>>>>=20
>>>>>>>> The simple test below works fine on a OSX (maybe all unix) =
system but will
>>>>>>>> return a system error under Windos 7 (32) , "Bad File =
Descriptor":
>>>>>>>>=20
>>>>>>>> ERROR : Failed to start server : error(system_error(Bad file
>>>>>>>> descriptor),select/5)
>>>>>>>>=20
>>>>>>>> To test, launch one of the two test cases and open an internet =
browser to
>>>>>>>> http://127.0.0.1:8080/ for example, or change the 127.0.0.1 by =
your IP.
>>>>>>>>=20
>>>>>>>> %- Program Test with Select -----------------------------------
>>>>>>>>=20
>>>>>>>> worker_run(Socket, Client, StreamIn, StreamOut):- write('i am a =
working worker
>>>>>>>> ...'), nl.
>>>>>>>>=20
>>>>>>>> server_test_with_select:-
>>>>>>>> socket('AF_INET', Socket),
>>>>>>>> socket_bind(Socket, 'AF_INET'(Host, 8080)),
>>>>>>>> socket_listen(Socket,10),
>>>>>>>> catch( server_loop_with_select(Socket),E,
>>>>>>>> ( socket_close(Socket),
>>>>>>>> format( "ERROR : Failed to start server =
: ~w~n", [E] )
>>>>>>>> )).
>>>>>>>>=20
>>>>>>>> server_loop_with_select(Socket):-
>>>>>>>> repeat,
>>>>>>>> select([Socket],ReadyReads,[Socket],[],0),
>>>>>>>> worker_run(Socket, Client, StreamIn, StreamOut),
>>>>>>>> fail.
>>>>>>>>=20
>>>>>>>> %- End of Program Test with Select =
-----------------------------------
>>>>>>>>=20
>>>>>>>> When not using usefull select/5 and directly use the =
socket_accept/4 predicate
>>>>>>>> the server works well.
>>>>>>>>=20
>>>>>>>>=20
>>>>>>>> %- Program Test without Select =
-----------------------------------
>>>>>>>>=20
>>>>>>>> worker_run(Socket, Client, StreamIn, StreamOut):- write('i am a =
working worker
>>>>>>>> ...'), nl.
>>>>>>>>=20
>>>>>>>> server_test_without_select:-
>>>>>>>> socket('AF_INET', Socket),
>>>>>>>> socket_bind(Socket, 'AF_INET'(Host, 8080)),
>>>>>>>> socket_listen(Socket,10),
>>>>>>>> catch( server_loop_without_select(Socket),E,
>>>>>>>> ( socket_close(Socket),
>>>>>>>> format( "ERROR : Failed to start server =
: ~w~n", [E] )
>>>>>>>> )).
>>>>>>>>=20
>>>>>>>> server_loop_without_select(Socket):-
>>>>>>>> repeat,
>>>>>>>> socket_accept(Socket, Client, StreamIn, =
StreamOut),
>>>>>>>> worker_run(Socket, Client, StreamIn, StreamOut),
>>>>>>>> fail.
>>>>>>>>=20
>>>>>>>> %- End of Program Test without Select =
-----------------------------------
>>>>>>>>=20
>>>>>>>>=20
>>>>>>>> Is it a known bug and did you plan to fix it in a future =
version ?
>>>>>>>>=20
>>>>>>>>=20
>>>>>>>> Best Regards,
>>>>>>>>=20
>>>>>>>> Fx NION.
>>>>>>>>=20
>>>>>>>>=20
>>>>>>>> _______________________________________________
>>>>>>>> Bug-prolog mailing list
>>>>>>>> [email protected]
>>>>>>>> https://lists.gnu.org/mailman/listinfo/bug-prolog
>>>>>>>>=20
>>>>>>>=20
>>>>>>>=20
>>>>>>> --=20
>>>>>>> Ce message a ete verifie par MailScanner
>>>>>>> pour des virus ou des polluriels et rien de
>>>>>>> suspect n'a ete trouve.
>>>>>>>=20
>>>>>>=20
>>>>>>=20
>>>>>> _______________________________________________
>>>>>> Bug-prolog mailing list
>>>>>> [email protected]
>>>>>> https://lists.gnu.org/mailman/listinfo/bug-prolog
>>>>>=20
>>>>> -----------------------------------------------------------------
>>>>> Paulo Moura
>>>>> Logtalk developer
>>>>>=20
>>>>> Email: <mailto:[email protected]>
>>>>> Web: <http://logtalk.org/>
>>>>> -----------------------------------------------------------------
>>>>>=20
>>>>>=20
>>>>>=20
>>>>>=20
>>>>=20
>>>=20
>>> -----------------------------------------------------------------
>>> Paulo Moura
>>> Logtalk developer
>>>=20
>>> Email: <mailto:[email protected]>
>>> Web: <http://logtalk.org/>
>>> -----------------------------------------------------------------
>>=20
>=20
--Apple-Mail=_0BC28BF8-0D35-428D-AD74-E04984558DF6
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=windows-1252
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space;"><div>Hi,</div><div><br></div><div>After several days =
of intensive tests around socket (git 1.4.5) on Windows, sockets seams =
stables.</div><div><br></div><div>I have maybe an explanation for the =
"system_error(No error) =BB on Windows:</div><div> =
-I read somewhere that Windows didn=92t support select on streams, =
only on sockets.</div><div><br></div>So i do not use select on streams. =
Sad but running.<div><br></div><div>Fx</div><div><br><div><div>Le 25 =
f=E9vr. 2015 =E0 07:30, Fx <<a =
href=3D"mailto:[email protected]">[email protected]</a>> a =E9crit =
:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space;"><div>Hi,</div><div><br></div><div>I went ahead in =
the test, and discovered a new bug: when calling select/5 on a list =
filled with socket Id AND input streams:</div><div>- on Windows i get a =
system_error(No error).Ok, clear.</div><div>- on Os X, no error but =
finally the program crash with an overflow while reading another file =
stream during the server_process_request. </div><div> =
- It seems like something like a stream scramble due to select, =
but i wouldn=92t bet my shirt on it.</div><div><br></div><div>To =
illustrate, let say we have the following =
predicate:</div><div><br></div><div><div>server_handle_connections(Socket)=
:-</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>connection_list_read(Reads),</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>select([Socket|Reads],ReadyReads,[],[],0),</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>server_accept_incomming(Socket,ReadyReads,StreamIn,StreamOut),</div=
><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>server_process_request(StreamIn, =
StreamOut),!.</div></div><div><br></div><div>connection_list_read(Reads) =
succeeds and return a list of opened input streams (filled in =
server_accept_incomming =
predicate)</div><div><br></div><div>server_accept_incomming(Socket,ReadyRe=
ads,StreamIn,StreamOut) succeeds when ReadyReads contain =
Socket. </div><div>- It =AB accepts =BB the socket, =
unifying StreamIn and StreamOut, appends StreamIn to a list of active =
connections</div><div><br></div><div>server_process_request(StreamIn, =
StreamOut) reads the request, serve the requested file, and depending =
the test, close or not the streams.</div><div><br></div><div>At the =
first time, </div><div> - only the Socket is observed by the =
select.( Works nice on Windows with the correction made by =
Daniel.)</div><div> - the accept return a new input =
stream.</div><div> - the end =
of server_process_request can be viewed in to manner : it =
close the stream, or it doesn=92t close the streams.</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>- if it =
closes the stream, the next accept call will probably =
=AB reuse =BB the last stream indices (as if there was no use =
of select, just accept): not sure this is the case.</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>- if it =
doesn=92t close the streams, the current StreamIn could be observed in =
the next select/5 call no ? It crashes on windows, =
sure.</div><div><br></div><div>input streams are set with no buffering, =
according the advice in the =
manual.</div><div><br></div><div>So:</div><div><br></div><div>Do i use =
the select/5 correctly, mixing sockets and opened input streams =
?</div><div><br></div><div>Do select/5 have a side effets on the =
internal stream pool (settings properties for example ) =
?</div><div><br></div><div>Did someone already use successfully select/5 =
on streams, to make some kinda multiplexing server ?</div><div> - =
i see a lot of examples using accept, but no one using select. we =
can do better.</div><div><br></div><div>If i am not wrong in my tests, =
there is maybe a problem with streams and select/5 on all os =
targets.</div><div><br></div><div>Fx</div><br><div><div>Le 20 f=E9vr. =
2015 =E0 19:59, Fx <<a =
href=3D"mailto:[email protected]">[email protected]</a>> a =E9crit =
:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space;"><div>Ok, this is a very little step, but after some =
adventures with installation i have some =
news:</div><div><br></div><div>Getting source from git reveal two bugs =
(and something curious maybe):</div><div><span class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </span>- impossible to use anonymous git =
clone , so i fall back with getting the snapshot.</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>- the =
source didn=92t contain the =91configure=92 script (i picked it up =
from the 1.4.4 tar to go on)</div><div><span class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </span>- the version is still 1.4.4 (ok =
it=92s not the end of the world).</div><div><br></div><div>I installed =
the MinGW on Windows 7 32 bit, in th standard manner. Fortunately my =
antivirus didn=92t says nothing with the default a.out =
a.exe.</div><div>As si said previously, i took the =AB configure" =
file from prolog 1.4.4 source tarball</div><div><br></div><div>And last, =
but not least, the select/5 bug seems to belong to the past on windows =
(MinGW). I run again the tests wrote in this mailing list, and =
the</div><div>previous error didn=92t appear =
anymore. </div><div><br></div><div>It=92s weak for a beta test, but =
it=92s quite a good news. It would be nice if i had time to write some =
client/server tests, things like =
that.</div><div><br></div><div>Fx</div><div><br></div><br><div><div>Le =
19 f=E9vr. 2015 =E0 20:40, Paulo Moura <<a =
href=3D"mailto:[email protected]">[email protected]</a>> a =E9crit =
:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><blockquote type=3D"cite" style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;"><br class=3D"Apple-interchange-newline">On 19/02/2015, at 19:11, =
Fx <<a href=3D"mailto:[email protected]">[email protected]</a>> =
wrote:<br><br>:)) Paulo, you are right, if it can help. I won=92t =
promise anything, but i can at least take a look, sure.<br><br>Can you =
help, and tell me where cans i found some infos:<br>- What are actually =
the tools (or info link )to compile under Windows (7,32b my office =
copmuter)<br>- What are actually the tools (or info link )to compile =
under Os X (this one is really rather a computer, my personnal(s) =
one(s)).<br></blockquote><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px; float: none; display: inline =
!important;">I cannot help you with building GNU Prolog on Windows but, =
on Mac OS X, just follow the steps in the INTALL file.</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;"><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><blockquote type=3D"cite" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;">Dont=92 they exists some kinda =
unit tests ? Prolog coded scenario ? Or a Jenkins like for massive =
testing ?<br></blockquote><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;"><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: =
none; display: inline !important;">Logtalk includes a Prolog conformance =
test suite but it only tests, as it names indicates, standards related =
stuff. The small number of conformance issues are known (and some of =
them are really limitations in the standard). I cannot speak for Daniel, =
of course, but testing of other (non-standard) features would like be =
more useful. Specially stuff this might behave differently across =
different operating-systems (like sockets :-).</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;"><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><span style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;">Cheers,</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;"><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><span style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;">Paulo</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;"><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><blockquote type=3D"cite" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;">Le 19 f=E9vr. 2015 =E0 20:00, =
Paulo Moura <<a =
href=3D"mailto:[email protected]">[email protected]</a>> a =E9crit =
:<br><br><blockquote type=3D"cite"><br><blockquote type=3D"cite">On =
19/02/2015, at 18:58, Fx <<a =
href=3D"mailto:[email protected]">[email protected]</a>> =
wrote:<br><br>Daniel,<br><br>Thank you very much for your answer, and =
this is a great news for 1.4.5 !!!<br><br>I=92ll be patient and wait for =
the official distribution.<br></blockquote><br>Don't be patient. Help =
instead beta-testing =
1.4.5.<br><br>Cheers,<br><br>Paulo<br><br><br><blockquote type=3D"cite">Le=
17 f=E9vr. 2015 =E0 13:32, Daniel Diaz <<a =
href=3D"mailto:[email protected]">[email protected]</a>&=
gt; a =E9crit :<br><br><blockquote type=3D"cite">Hi,<br><br>sorry for =
the late reply. Thank you for this bug report.<br><br>The bug is fixed =
in the last git version. Will be fixed in next =
1.4.5<br><br>Daniel<br><br><br><br>Le 27/01/2015 12:44, <a =
href=3D"mailto:[email protected]">[email protected]</a> a =E9crit =
:<br><blockquote type=3D"cite">Dear Daniel,<br><br>I am working on a =
specific http server for gnu prolog (1.4.4), and i discovered<br>a =
strange comportment under windows 7 (32) with the select/5 =
predicate.<br><br>The simple test below works fine on a OSX (maybe all =
unix) system but will<br>return a system error under Windos 7 (32) , =
"Bad File Descriptor":<br><br>ERROR : Failed to start server : =
error(system_error(Bad file<br>descriptor),select/5)<br><br>To test, =
launch one of the two test cases and open an internet browser to<br><a =
href=3D"http://127.0.0.1:8080/">http://127.0.0.1:8080/</a> for example, =
or change the 127.0.0.1 by your IP.<br><br>%- Program Test with Select =
-----------------------------------<br><br>worker_run(Socket, Client, =
StreamIn, StreamOut):- write('i am a working worker<br>...'), =
nl.<br><br>server_test_with_select:-<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span>socket('AF_INET', =
Socket),<br><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>socket_bind(Socket, 'AF_INET'(Host, 8080)),<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>socket_listen(Socket,10),<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span>catch(<span =
class=3D"Apple-converted-space"> </span><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>server_loop_with_select(Socket),E,<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span><span =
class=3D"Apple-converted-space"> </span>(<span =
class=3D"Apple-converted-space"> </span><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>socket_close(Socket),<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span>format( "ERROR : Failed to start =
server : ~w~n", [E] )<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> =
</span>)).<br><br>server_loop_with_select(Socket):-<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>repeat,<br><span class=3D"Apple-tab-span" style=3D"white-space: =
pre;"> </span><span class=3D"Apple-tab-span" style=3D"white-space: =
pre;"> </span>select([Socket],ReadyReads,[Socket],[],0),<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>worker_run(Socket, Client, StreamIn, StreamOut),<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>fail.<br><br>%- End of Program Test with Select =
-----------------------------------<br><br>When not using usefull =
select/5 and directly use the socket_accept/4 predicate<br>the server =
works well.<br><br><br>%- Program Test without Select =
-----------------------------------<br><br>worker_run(Socket, Client, =
StreamIn, StreamOut):- write('i am a working worker<br>...'), =
nl.<br><br>server_test_without_select:-<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span>socket('AF_INET', =
Socket),<br><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>socket_bind(Socket, 'AF_INET'(Host, 8080)),<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>socket_listen(Socket,10),<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span>catch(<span =
class=3D"Apple-converted-space"> </span><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>server_loop_without_select(Socket),E,<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span><span =
class=3D"Apple-converted-space"> </span>(<span =
class=3D"Apple-converted-space"> </span><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>socket_close(Socket),<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> </span>format( "ERROR : Failed to start =
server : ~w~n", [E] )<br><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;"> =
</span>)).<br><br>server_loop_without_select(Socket):-<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>repeat,<br><span class=3D"Apple-tab-span" style=3D"white-space: =
pre;"> </span><span class=3D"Apple-tab-span" style=3D"white-space: =
pre;"> </span>socket_accept(Socket, Client, StreamIn, =
StreamOut),<br><span class=3D"Apple-tab-span" style=3D"white-space: =
pre;"> </span><span class=3D"Apple-tab-span" style=3D"white-space: =
pre;"> </span>worker_run(Socket, Client, StreamIn, StreamOut),<br><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> =
</span>fail.<br><br>%- End of Program Test without Select =
-----------------------------------<br><br><br>Is it a known bug and did =
you plan to fix it in a future version ?<br><br><br>Best =
Regards,<br><br>Fx =
NION.<br><br><br>_______________________________________________<br>Bug-pr=
olog mailing list<br><a =
href=3D"mailto:[email protected]">[email protected]</a><br><a =
href=3D"https://lists.gnu.org/mailman/listinfo/bug-prolog">https://lists.g=
nu.org/mailman/listinfo/bug-prolog</a><br><br></blockquote><br><br>--<span=
class=3D"Apple-converted-space"> </span><br>Ce message a ete =
verifie par MailScanner<br>pour des virus ou des polluriels et rien =
de<br>suspect n'a ete =
trouve.<br><br></blockquote><br><br>______________________________________=
_________<br>Bug-prolog mailing list<br><a =
href=3D"mailto:[email protected]">[email protected]</a><br><a =
href=3D"https://lists.gnu.org/mailman/listinfo/bug-prolog">https://lists.g=
nu.org/mailman/listinfo/bug-prolog</a><br></blockquote><br>---------------=
--------------------------------------------------<br>Paulo =
Moura<br>Logtalk developer<br><br>Email: <<a =
href=3D"mailto:[email protected]">mailto:[email protected]</a>><br>We=
b: <<a =
href=3D"http://logtalk.org/">http://logtalk.org/</a>><br>--------------=
---------------------------------------------------<br><br><br><br><br></b=
lockquote><br></blockquote><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;"><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: =
none; display: inline =
!important;">-------------------------------------------------------------=
----</span><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px; float: none; display: inline =
!important;">Paulo Moura</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;"><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: =
none; display: inline !important;">Logtalk developer</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;"><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><span style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;">Email: <</span><a =
href=3D"mailto:[email protected]" style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;">mailto:[email protected]</a><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;">></span><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px; float: none; display: inline =
!important;">Web: <</span><a href=3D"http://logtalk.org/" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;">http://logtalk.org/</a><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px; float: none; display: inline =
!important;">></span><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px; float: none; display: inline =
!important;">-------------------------------------------------------------=
----</span></blockquote></div><br></div></blockquote></div><br></div></blo=
ckquote></div><br></div></body></html>=
--Apple-Mail=_0BC28BF8-0D35-428D-AD74-E04984558DF6--
--===============4015396316050499855==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog
--===============4015396316050499855==--