Description of problem: eclipse-bugzilla grabs the bugzilla components from the query page. This fails with gcc 4.1 where it does not fail with 4.0.x. We isolated the parts that do this (hackily and not very precisely, might I add ;) and I will attach that test case. Version-Release number of selected component (if applicable): gcc-4.1.0-0.15.i386 How reproducible: Always. Steps to Reproduce: 1. javac FetchError.java 2. java FetchError 3. Actual results: java.net.ProtocolException: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> at gnu.java.net.protocol.http.Request.readResponse (libgcj.so.7) at gnu.java.net.protocol.http.Request.dispatch (libgcj.so.7) at gnu.java.net.protocol.http.HTTPURLConnection.connect (libgcj.so.7) at FetchError$ConnectingThread.run (FetchError.java:478) Expected results: No output (like gij 4.0.x and Sun). Additional info: There is another error that we were attempting to duplicate, but we hit this bug first. Hopefully once this is fixed, we will be able to investigate the next bug. Andrew Haley (on IRC) thinks this might be the same as the https issue (bug 177733). This is http vs. https, but it might be the same.
Created attachment 123493 [details] Test case (ripped out of eclipse{,-bugzilla})
Created attachment 123502 [details] explanation
I think what was happening previously was that the http protocol handler was eagerly reading the entire response body into a byte[]. This meant that we didn't have to handle flushing the body anywhere else.
Testing a patch.
As Andrew said in the original report we were trying to reproduce another bug in which the connection timed out, so if the patch fixes this, it might trigger the other bug. Unless they are related of course.
I've checked in the fix to gcc cvs, on the 4.1 branch. It is purely a libgcj change and won't require any application rebuilds. Even with the patch, the attached test case fails -- it times out when reading. However, if I comment out the call to getTimedInputStream (so that we're reading from the raw un-timed-out underlying input stream), then it works. I suspect that there is a timing bug of some kind in the timed input stream code, but I have not looked into it deeply.
Thanks a lot for the quick fix! The timeout bug is the one we were originally after. Now we can try and dig out the timeout bug.
I have verified that the first bug is indeed fixed. I have opened a new one for the timeout: bug 178703. Thanks!