Bug 28959 - IOException using CoyoteReader.readLine() but not using .read()
Summary: IOException using CoyoteReader.readLine() but not using .read()
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Connector:Coyote (show other bugs)
Version: 5.0.24
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-13 17:57 UTC by jim hopp
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jim hopp 2004-05-13 17:57:35 UTC
I get IOExceptions when I use CoyoteReader.readLine to read the request's 
input if the request has many lines to it.  If I read the request using 
CoyoteReader.read(), it works fine.  The stack trace (from my bug test code) 
is below.  I'll attach a war file that demonstrates the bug, as well as source 
code.

I originally discovered this under 5.0.19, but thought it was caused by bug 
#27447.  That bug was reported fixed in 5.0.20, but that fix did not fix this 
problem.

2004-05-13 10:30:15 StandardWrapperValve[bugTest]: Servlet.service() for 
servlet bugTest threw exception
java.io.IOException
	at org.apache.coyote.tomcat5.InputBuffer.reset(InputBuffer.java:440)
	at org.apache.coyote.tomcat5.CoyoteReader.reset(CoyoteReader.java:121)
	at org.apache.coyote.tomcat5.CoyoteReader.readLine
(CoyoteReader.java:178)
	at jimpkg.BugTest.doPost(BugTest.java:45)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Comment 1 jim hopp 2004-05-13 18:13:21 UTC
I seem to be having trouble uploading attachments, so I've posted the war file 
and the zip file at:
http://www.netyourwork.com/download/bugtest.war
and
http://www.netyourwork.com/download/tomcat-5.0.24-bugtest.zip

I'll try again to attach them later.
Comment 2 Remy Maucherat 2004-05-14 07:32:59 UTC
Please also submit the client code to reproduce the problem, as this works for
me right now.
Comment 3 jim hopp 2004-05-14 15:56:42 UTC
I'm not sure what you mean by "submit the client code to reproduce the problem"
- both the war file and the zip file include /bugtest.html, which is the browser
page that explains how to reproduce the bug and has a form that invokes the
first servlet.  The zip file also includes the source code for the two servlets.
 To invoke the page on my default install of Tomcat, I use
http://localhost:8080/bugtest/bugtest.html.

I've tried several times to attach the zip file and the war file to this bug
report, but with no success.  Perhaps because I'm behind a firewall and a router
using NAT?
Comment 4 Remy Maucherat 2004-05-14 16:08:08 UTC
I need some data you send to the servlet, as well as how you send it (= the
cleint code). I didn't look at bugtest.html (the servlet code seemed obvious,
you could have done while(r.readLine() != null)), and it does look enough. I'll
try it. It would have been more reliable using a custom program, of course.
Comment 5 Remy Maucherat 2004-05-14 16:31:15 UTC
I'm unable to have bugreport.html work, right now (it doesn't seem to generate
anything).
Comment 6 jim hopp 2004-05-14 16:38:40 UTC
The html page was just to enable me to quickly try different combinations of
line length and number of lines, since some combinations worked and some did
not.  If after trying the html you still can't reproduce it, I'll write a little
java program that tries the various combinations.
Comment 7 Remy Maucherat 2004-05-14 16:47:07 UTC
I'm ok with using your html file, but right now it doesn't work for me. For
example, it accesses the BugTest1 servlet (which I think should work), and it
also seems to send empty lines.
Comment 8 Remy Maucherat 2004-05-14 17:05:13 UTC
Ok, I got the thing to work. It seems like this doesn't work with Mozilla.
Comment 9 Remy Maucherat 2004-05-14 21:17:52 UTC
.
Comment 10 Remy Maucherat 2004-05-14 21:19:37 UTC
The test worked ok on IE, and the issue is now fixed.