https://bz.apache.org/bugzilla/show_bug.cgi?id=57638

--- Comment #1 from Konstantin Kolinko <[email protected]> ---
What version the stacktrace is from?

> at java.nio.Buffer.limit(Buffer.java:275)

The line matches Java 8u31 sources.
The IAE is triggered by the following check:

[[[
public final Buffer limit(int newLimit) {
   if ((newLimit > capacity) || (newLimit < 0))
            throw new IllegalArgumentException();
]]]

> org.apache.coyote.ajp.AjpNioProcessor.readSocket(AjpNioProcessor.java:179)

The above does not match Tomcat 7 sources. By method name I guess that is line
356.

[[[
    private int readSocket(byte[] buf, int pos, int n, boolean block)
            throws IOException {
        int nRead = 0;
        ByteBuffer readBuffer =
                socketWrapper.getSocket().getBufHandler().getReadBuffer();
        readBuffer.clear();
        readBuffer.limit(n);
]]]

Apparently it tries to read n bytes from the Socket read buffer at once. The
buffer is smaller that that thus the IAE.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to