hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Berlin <sber...@limepeer.com>
Subject Re: ArrayIndexOutOfBoundsException while reading
Date Thu, 08 Jan 2004 18:25:29 GMT
I agree that working around JVM bugs is annoying, but in most cases 
there's really not much else you can do.  However, it's not acceptable 
to allow a runtime exception to kill code that should otherwise work.  
The bug so far has only been reported with Windows (but that could be 
because there's just a lot more windows users).  On 1.3.X versions of 
Java, the bug stems from the socketRead method.  On 1.4.X versions, it 
stems from socketRead0.  If HttpClient is hesitant to add the 
workaround code, it's no big deal -- we already are using a modified 
version, so I can just insert an AIOOBExceptionStreamHandler of sorts 
around the existing streams.  It might be useful to have this in 
HttpClient, though, as it could bite some other heavy-duty users.

Thanks,
  Sam

On Thursday, January 8, 2004, at 01:10  PM, Ingo Brunberg wrote:

> To work around a bug in the Java VM in this manner seems a bad idea to
> me. As I have never seen this myself, I guess only Windows platforms
> are affected?
>
> What are the Sun engineers saying?
>
> Regards,
> Ingo
>
>> Hi all,
>>
>> Under some exceptional circumstances, reading from a SocketInputStream
>> can cause an ArrayIndexOutOfBoundsException.  We have seen this occur
>> in many other places (non HttpClient related), and since including
>> HttpClient a few bugs have been reported with it as well.  The exact
>> cause is unknown and not easily reproduced, and the exception actually
>> occurs in native code (java.net.SocketInputStream.socketRead0).  I
>> suggest adding a wrapper input stream around the underlying 
>> inputstream
>> that extends all read-style calls, catches
>> ArrayIndexOutOfBoundsException and rethrows it as an IOException.
>>
>> An example bug report demonstrating this bug can be at:
>> http://bugs.limewire.com/bugs/searching.jsp?l=80&c=46&m=-1_-1&os=-
>> 1&offset=15 .  (Note that we're currently redoing the internals of the
>> bug server, so if that link doesn't work, you can reach the bug 
>> reports
>> yourself by going to http://bugs.limewire.com/bugs/search.jsp ,
>> choosing or typing "java.lang.ArrayIndexOutOfBoundsException" as the
>> exception to search for, and choosing or typing
>> "org.apache.commons.httpclient.HttpParser" as the class that the error
>> occurs in.)
>>
>> Thanks,
>>   Sam
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> commons-httpclient-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message