This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Socket regressions


On Tue, 19 Mar 2002, Bryce McKinlay wrote:
> >1) write() sometimes hangs in an infinite loop.  It appears that we don't
> >handle an error return from the system call properly.  Moreover we ignore
> >certain important errors like EBADF (why?).
> 
> I queried Nic Ferrier (who wrote the socket timeout code) about that 
> when he submitted the patch. He assured me that it was correct,

Nic's intentions aside, the code is wrong... it decrements the buffer
address and increments len for each error, so that it ends up outside the
array bounds.

> ignoring them does seem odd to me. Its been a while since I did much 
> with socket stuff, but surely it is supposed to throw if you try to 
> write to a closed or unconnected socket?

I'm pretty sure the JDK does throw an exception.

> OK for mainline and branch, as an interim fix. I think some testing is 
> required to figure out what is really correct.

Committed, and agreed.  Thanks.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]