This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: HTT URLConnection.getInputStream seems broken in cvs
yes. the problem happens when the gnu.java.net.protocol.http.Headers
tries to parse the response.
in fact the bug only happens when trying to download one specific file.
I put this file here http://fabio.k2infinity.com/test.hdr and this code
triggers the bug:
public class Test {
public static void main(String[] args) {
try {
new URL("http://fabio.k2infinity.com/test.hdr").openStream();
} catch (Exception e) {
e.printStackTrace();
}
}
}
I tried putting the file here http://dinavis.net/test.hdr but
downloading from that site the bug does not come up.
and this code works fine in gcc 3.4 .. it only throws the exception in
cvs HEAD.
Fabio Roger
On Fri, 2005-03-04 at 10:18 +0100, Michael Koch wrote:
> On Fri, Mar 04, 2005 at 05:10:58PM +0800, Fabio Roger wrote:
> > Hi,
> >
> > I try a URL.getInputStream() for a normal http connection and it throws
> > this exception:
> >
> > ...
> > Caused by: java.lang.ArrayIndexOutOfBoundsException
> > at java.lang.System.arraycopy(java.lang.Object, int,
> > java.lang.Object, int, int) (/usr/lib/libgcj.so.6.0.0)
> > at java.io.BufferedInputStream.refill() (/usr/lib/libgcj.so.6.0.0)
> > at java.io.BufferedInputStream.read(byte[], int, int)
> > (/usr/lib/libgcj.so.6.0.0)
> > at gnu.java.net.LineInputStream.readLine() (/usr/lib/libgcj.so.6.0.0)
> > at gnu.java.net.protocol.http.Headers.parse(java.io.InputStream)
> > (/usr/lib/libgcj.so.6.0.0)
> > at gnu.java.net.protocol.http.Request.readResponse
> > (gnu.java.net.LineInputStream) (/usr/lib/libgcj.so.6.0.0)
> > at gnu.java.net.protocol.http.Request.dispatch()
> > (/usr/lib/libgcj.so.6.0.0)
> > at gnu.java.net.protocol.http.HTTPURLConnection.connect()
> > (/usr/lib/libgcj.so.6.0.0)
> > at gnu.java.net.protocol.http.HTTPURLConnection.getInputStream()
> > (/usr/lib/libgcj.so.6.0.0)
> > ...
> >
> >
> > gcc version 4.1.0 20050303 (experimental) (I just checkout and compile)
> >
> > and this works well when compiled/used with gcc 3.4.2 in the other box.
> >
> > am I doing something wrong or the thing is broken?
>
> Do you have a simple testcase that triggers this ?
>
>
> Michael