tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51124] ArrayIndexOutOfBoundsException after setting org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
Date Wed, 04 May 2011 09:39:28 GMT

--- Comment #1 from Ramiro <> 2011-05-04 09:39:28 UTC ---
Created attachment 26956
patch for BodyContentImpl class of trunk

We are reproducing this problem after getting an OutOfMemoryError on

java.lang.OutOfMemoryError: Java heap space

We are on version 6.0.29, but the cause is still in trunk.

When the buffer needs to increase the size and an OOM error is thrown the
bufferSize member variable is increased before the buffer is reallocated. But
the BodyContentImpl is accessible for later requests (from the PageContext
pool) with a bufferSize greater than the real buffer size, causing the
ArrayIndexOutOfBoundsException to be thrown when trying to use the buffer space
above the real size.

To solve the problem the bufferSize member variable should be updated only
after the buffer array is properly created.

The patch fixes this issue.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message