Re: svn commit: r645722 - /tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java

2008-04-08 Thread Filip Hanik - Dev Lists

just taking a quick look at the patch, this is a memory leak.
the buffer will simply grow larger and larger until an OOM happens, if 
one keeps marking the buffer

when I am more awake, I'll help out on this, it's very easy to reproduce
http://people.apache.org/~fhanik/upload-mark.jsp

Filip

[EMAIL PROTECTED] wrote:

Author: markt
Date: Mon Apr  7 15:47:54 2008
New Revision: 645722

URL: http://svn.apache.org/viewvc?rev=645722view=rev
Log:
All of the issues I was seeing with mark/reset were due to states that resulted 
in a call to CharChunk.flushBuffer().
I tried many different ways to fix it but by far the simplest was this patch 
that just increases the size of the CharChunk internal buffer when creating the 
mark sufficiently that flushBuffer() is never called.
With this patch I can't break mark/reset with bug 44494's test case in single 
or multibyte mode.

Modified:
tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=645722r1=645721r2=645722view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Mon Apr  7 
15:47:54 2008
@@ -457,11 +457,7 @@
 cb.setOffset(0);
 }
 }
-int offset = readAheadLimit;
-if (offset  size) {
-offset = size;
-}
-cb.setLimit(cb.getStart() + offset);
+cb.setLimit(cb.getStart() + readAheadLimit + size);
 markPos = cb.getStart();
 }
 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r645722 - /tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java

2008-04-08 Thread Filip Hanik - Dev Lists
ignore my prev email about the mem leak, I wasn't up to current in 
trunk, and was running into something else


Filip

[EMAIL PROTECTED] wrote:

Author: markt
Date: Mon Apr  7 15:47:54 2008
New Revision: 645722

URL: http://svn.apache.org/viewvc?rev=645722view=rev
Log:
All of the issues I was seeing with mark/reset were due to states that resulted 
in a call to CharChunk.flushBuffer().
I tried many different ways to fix it but by far the simplest was this patch 
that just increases the size of the CharChunk internal buffer when creating the 
mark sufficiently that flushBuffer() is never called.
With this patch I can't break mark/reset with bug 44494's test case in single 
or multibyte mode.

Modified:
tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=645722r1=645721r2=645722view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Mon Apr  7 
15:47:54 2008
@@ -457,11 +457,7 @@
 cb.setOffset(0);
 }
 }
-int offset = readAheadLimit;
-if (offset  size) {
-offset = size;
-}
-cb.setLimit(cb.getStart() + offset);
+cb.setLimit(cb.getStart() + readAheadLimit + size);
 markPos = cb.getStart();
 }
 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r645722 - /tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java

2008-04-07 Thread Remy Maucherat
On Mon, 2008-04-07 at 22:47 +, [EMAIL PROTECTED] wrote:
 Author: markt
 Date: Mon Apr  7 15:47:54 2008
 New Revision: 645722
 
 URL: http://svn.apache.org/viewvc?rev=645722view=rev
 Log:
 All of the issues I was seeing with mark/reset were due to states that
 resulted in a call to CharChunk.flushBuffer().
 I tried many different ways to fix it but by far the simplest was this
 patch that just increases the size of the CharChunk internal buffer
 when creating the mark sufficiently that flushBuffer() is never
 called.
 With this patch I can't break mark/reset with bug 44494's test case in
 single or multibyte mode.

Oops, I had forgotten that part, there was indeed another problem with
that. Sorry.

Rémy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r645722 - /tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java

2008-04-07 Thread Mark Thomas

Remy Maucherat wrote:

On Mon, 2008-04-07 at 22:47 +, [EMAIL PROTECTED] wrote:

Author: markt
Date: Mon Apr  7 15:47:54 2008
New Revision: 645722

URL: http://svn.apache.org/viewvc?rev=645722view=rev
Log:
All of the issues I was seeing with mark/reset were due to states that
resulted in a call to CharChunk.flushBuffer().
I tried many different ways to fix it but by far the simplest was this
patch that just increases the size of the CharChunk internal buffer
when creating the mark sufficiently that flushBuffer() is never
called.
With this patch I can't break mark/reset with bug 44494's test case in
single or multibyte mode.


Oops, I had forgotten that part, there was indeed another problem with
that. Sorry.


No problem. I learned quite a bit digging around in that code ;)

If you can see a better way of fixing this then feel free to propose an 
alternative patch.


Mark


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]