Closed Bug 197478 Opened 23 years ago Closed 10 years ago

Headers sometimes included as content on Linux with chunked transfer-encoding

Categories

(Core :: Networking: HTTP, defect, P2)

x86
Linux
defect

Tracking

()

RESOLVED INVALID
mozilla1.4final

People

(Reporter: kasmith, Unassigned)

Details

(Keywords: platform-parity, testcase)

Attachments

(4 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 When accessing an intranet application ( not available to the internet, sorry couldn't provide a URL ) Mozilla 1.3 will sometimes work, but also sometimes just seems to randomly not respond when we ask it to do load a page, then if we press the 'Stop' button the requested page will ( sometimes ) load. Other times it will load when requested, but either not apply the stylesheet, or else put some text in the page that shouldn't be there, at least some of the unwanted text looks like it might be http headers. This is difficult to reproduce, as the same pages that had problems on one load, will work fine on the next. Here is some text that sometimes ( only sometimes ) appears at the top of some of our pages when displayed: 0 HTTP/1.1 200 OK Content-Type: text/html Expires: Thu, 01 Jan 1970 00:00:00 GMT Date: Fri, 14 Mar 2003 22:19:08 GMT Pragma: No-cache Server: Apache Tomcat/4.1.12-LE-jdk14 (HTTP/1.1 Connector) Transfer-Encoding: chunked Cache-Control: no-cache 2000 It also puts a few other characters at odd places in the page. If we come back to the same page later it will probably look fine. The intranet app is being served by Tomcat 4.1.12 embedded in JBoss 3.4 application server. So far we've only seen this problem start when trying to access pages from this app, but sometimes after the problems start we have trouble visiting other sites as well ( page load problems, have not seen display problems yet ). Also so far we've only seen this behaviour from Mozilla 1.3, versions 1.1 and 1.2.1 have been used with this app regularly with no problems. Various versions of IE also seem to work fine. There is nothing that seems to reliably reproduce the problem, but it does seem to happen more frequently when we are logging into the application, or if we log out and then back in. We have ( so far ) only seen this problem when accessing webapps served from JBoss+Tomcat. Reproducible: Sometimes Steps to Reproduce: 1. No steps reliably reproduce this problem, it seems fairly random. 2. 3.
If you can't run CL-HTTP and can't reproduce it some other way, maybe someone on the Bug-CL-HTTP@ai.mit.edu list will be willing to set up this test case on a public server for you.
This is the output that is sent consistently by the server to wget and presumably to Mozilla, but is received incorrectly by Linux Mozilla roughly 10% of the time. The identical bytes, except the date header, are known to have been sent 49,000 times to wget. The content and chunk codes are known not to have varied in over 500,000 runs. Yet when repeatedly sent to Mozilla, it will fail in less than 200 tries, often in less than 20.
Just in case the cr and lf characters are altered in the text attachment.
Test case to show that it's not the server's fault.
We have run into the same bug on my project and confirmed with extensive automated testing that it occurs when Mozilla is on Linux (versions 1.3, 1.1, and 1.0.1), as opposed to MacOS 9 or Solaris (1.1), AND the server is using chunked transfer encoding. It occurs roughly 10% of the time on Linux Mozilla. On MacOS9 and Solaris Mozilla, it does seem to occur with very low probability -- about one in every 100,000 requests when run for 48 hours. Most of the time, it works fine. But every once in a while, Mozilla will prepend the HTTP headers to the contents and embed the chunk lengths instead of decoding them. As far as I can tell by running over half a million trials with "wget" (forcing the server to use chunked transfer encoding even though wget 1.5.3 doesn't decode this), the server sends exactly the same bytes each time. I ran 49,000 runs saving the headers too, just to make sure it's not inserting a blank line or something. The contents are always identical except for the Date header. In our case the server is CL-HTTP 70.156, and it's not installed on a public web site. There are two test cases: One to make the browser repeatedly fetch a script until it gets a syntax error because the script starts with "HTTP/1.1 200 OK" which is not valid JavaScript, and the other to make an alternative client, wget, repeatedly fetch pages to confirm that they never change (Attachment #124100 [details]). I have attached both a CL-HTTP "script" that I used to generate simple test content (Attachment #124095 [details]), and also some sample content with headers (Attachment #124096 [details] or Attachment #124099 [details]). If it's difficult for the developer and QA to run CL-HTTP, then maybe you can set up a server that sends the same content. If you can't, maybe someone on the Bug-CL-HTTP@ai.mit.edu list will be willing to set up Attachment #124095 [details] on a public server for you.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: pp, testcase
Priority: -- → P2
Summary: sporadic page load and display problems when accessing Tomcat based intranet app. → Headers sometimes included as content on Linux with chunked transfer-encoding
Target Milestone: --- → mozilla1.4final
I have run into this problem serving from Solaris. the site is: http://www.kcl.ac.uk/depsta/healifsci/index.php bug is intermittend, about one in 20 clicks. There are a number of seperate queries taking place on the page which I suppose would increase the likelyhood of the chunks being out of sequence. Reproducible: Intermittent, can produce it by clicking on links between the dynamic pages, say three times on the top blue button, then follow breadcrumb back, have ONLY been able to reproduce the problem on PC on same network as Server (possibly to do with bandwidth?) simple does not happen on my machine at home (215k ADSL) yet is running win2k with mozilla 1.3.1. sample of header text included in page content: "0 HTTP/1.1 200 OK Date: Tue, 17 Jun 2003 13:12:04 GMT Server: Apache X-Powered-By: PHP/4.2.3 Keep-Alive: timeout=15, max=89 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html e2b"
I just had this problem too. The "0 " in "0 HTTP/1.1 200..." actually is the "0CRLF" trailer of a previous response that was sent using chunked transfer coding, on the same http connection. This happens with "304 Not modified" responses, Mozilla expects no message body even if "Transfer-Encoding: chunked" is set (did not test with Content-Length). In my case I was using a custom-written http server that also could produce this kind of response. The aforementioned site http://www.kcl.ac.uk/depsta/healifsci/index.php also supports chunked transfer coding, but the 304s never contained a transfer-encoding header (maybe it´s been changed/fixed in the past 12 months). The problem is on the server side. The HTTP 1.1 spec says: 10.3.5 304 Not Modified If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code. The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields. ...so Mozilla implements this correctly. However, it would be possible to handle this server bug gracefully on the client side.
I believe this 'bug' is related to bug #161464 http://bugzilla.mozilla.org/show_bug.cgi?id=161464 Reading the previous comment, I wonder if it *is* possible to handle this gracefully on the client side.
Product: Browser → Seamonkey
Assignee: asa → nobody
Component: General → Networking: HTTP
Product: SeaMonkey → Core
QA Contact: asa → networking.http
This is related to invalid 304 responses (with bodies) - we've had some mitigations here for a long while
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: