Bug 178445

Summary: java.net.ProtocolException
Product: [Fedora] Fedora Reporter: Andrew Overholt <overholt>
Component: gccAssignee: Tom Tromey <tromey>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: ifoox, jakub, patrickm, tromey
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-23 18:36:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test case (ripped out of eclipse{,-bugzilla})
none
explanation none

Description Andrew Overholt 2006-01-20 17:03:55 UTC
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.

Comment 1 Andrew Overholt 2006-01-20 17:03:55 UTC
Created attachment 123493 [details]
Test case (ripped out of eclipse{,-bugzilla})

Comment 2 Andrew Haley 2006-01-20 19:45:09 UTC
Created attachment 123502 [details]
explanation

Comment 3 Tom Tromey 2006-01-20 20:18:51 UTC
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.


Comment 4 Tom Tromey 2006-01-20 20:46:58 UTC
Testing a patch.


Comment 5 Igor Foox 2006-01-20 21:09:31 UTC
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.

Comment 6 Tom Tromey 2006-01-20 22:05:53 UTC
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.


Comment 7 Igor Foox 2006-01-20 22:17:24 UTC
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.

Comment 8 Andrew Overholt 2006-01-23 16:50:22 UTC
I have verified that the first bug is indeed fixed.  I have opened a new one for
the timeout:  bug 178703.  Thanks!