|
From: Venkatesh S. <Ven...@lc...> - 2004-07-01 12:08:09
|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please read the disclaimer at the bottom of this e-mail.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Leif,
Bingo !!!.
It worked.
On applying the below two patches, it worked.
I think the key is that=20
0.EWOULDBLOCK and EAGAIN constants in HP-UX have different values
1.The test must be made for EAGAIN on accept and receive(for HP-UX)
2.The constant EAGAIN is 11
I have mailed you the log with the STATE_OUTPUT=3DTRUE.
Thanks again for all the help.Much appreciated.
Let me know if there is something else i can do.
( removing the extra log_printf statements is a start ).
Cheers,
-----Original Message-----
From: wra...@li...
[mailto:wra...@li...]On Behalf Of Leif
Mortenson
Sent: 01 July 2004 05:12
To: wra...@li...
Subject: Re: [Wrapper-user] HP-UX 11i 64 bit:log level DEBUG crashes
application
Venkatesh,
Ok, I think I know what the problem is. I found this message:
http://lists.parisc-linux.org/pipermail/parisc-linux/2004-March/022504.html
It comments on the EWOULDBLOCK and EAGAIN constants not being
equal on HPUX like they are on Linux. I am testing for EWOULDBLOCK,
but reviewing the accept man page, it looks like I should be testing for=20
EAGAIN.
Could try out a couple more changes to the code and let me know how they
work out?
The first is to modify the tests just after the accept call on or=20
about wrapper.c:552
Old:
---
if (sd =3D=3D INVALID_SOCKET) {
rc =3D wrapperGetLastError();
if (rc =3D=3D EWOULDBLOCK) {
/* There are no incomming sockets right now. */
return;
} else {
if (wrapperData->isDebugging) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket creation failed. (%s)", getLastErrorText());
}
return;
}
}
---
New:
---
if (sd =3D=3D INVALID_SOCKET) {
rc =3D wrapperGetLastError();
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"errno 11 =3D %s", strerror(11));
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"errno EWOULDBLOCK =3D %d =3D %s", EWOULDBLOCK,=20
strerror(EWOULDBLOCK));
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"errno EAGAIN =3D %d =3D %s", EAGAIN, strerror(EAGAIN));
/* EWOULDBLOCK !=3D EAGAIN on some platforms. */
if ((rc =3D=3D EWOULDBLOCK) || (rc =3D=3D EAGAIN)) {
/* There are no incomming sockets right now. */
return;
} else {
if (wrapperData->isDebugging) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket creation failed. (%s)", getLastErrorText());
}
return;
}
}
---
I am expecting that EAGAIN =3D 11 on your system. If not, then I would=20
appreciate
it if you could figure out what constant is =3D 11 on your machine. =20
Assuming for now
that it is, then the patch above and the one that follows should fix=20
your problem.
The second patch is for the test just after the recv call at or around=20
line 793.
Old:
---
len =3D recv(sd, &c, 1, 0);
if (len =3D=3D SOCKET_ERROR) {
err =3D wrapperGetLastError();
if (wrapperData->isDebugging) {
if ((err !=3D EWOULDBLOCK) && (err !=3D ENOTSOCK) && (err !=
=3D=20
ECONNRESET)) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket read failed. (%s)", getLastErrorText());
wrapperProtocolClose();
}
}
---
New:
---
len =3D recv(sd, &c, 1, 0);
if (len =3D=3D SOCKET_ERROR) {
err =3D wrapperGetLastError();
if (wrapperData->isDebugging) {
if ((err !=3D EWOULDBLOCK) && (err !=3D EAGAIN)
&& (err !=3D ENOTSOCK) && (err !=3D ECONNRESET)) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket read failed. (%s)", getLastErrorText());
wrapperProtocolClose();
}
}
---
Cheers,
Leif
Venkatesh Sellappa wrote:
>Hi List,
>
>I think we got a little bit more visibility on this.
>Having made the changes to wrapper.c and re-compiling.
>I still get the same error.
>
>The value of EWOULDBLOCK in this case is not 11 but 246.
>
>I have mailed you the log file with all the gory details.
>
>Cheers,
>
> =20
>
<snip>
**********************************************************************
This email is intended for the named recipient(s) only. Its contents
are confidential and may only be retained by the named recipient(s)
and may only be copied or disclosed with the consent of=20
LCH.Clearnet Limited. If you are not an intended recipient please
delete this e-mail and notify pos...@lc....
The contents of this email are subject to contract in all cases,=20
and LCH.Clearnet Limited makes no contractual commitment save where
confirmed by hard copy. LCH.Clearnet Limited accepts no liability,=20
including liability for negligence, in respect of any statement in=20
this email.
LCH.Clearnet Limited, Registered Office: Aldgate House,=20
33 Aldgate High Street, London EC3N 1EA. Recognised as a Clearing=20
House under the Financial Services & Markets Act 2000. Reg in England No.25=
932=20
Telephone: +44 20 7426 7000 Internet: http://www.lchclearnet.c=
om
**********************************************************************
|