Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 31547 invoked from network); 8 Oct 2003 19:04:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 8 Oct 2003 19:04:01 -0000 Received: (qmail 25887 invoked by uid 500); 8 Oct 2003 19:03:43 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 25843 invoked by uid 500); 8 Oct 2003 19:03:42 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 25829 invoked from network); 8 Oct 2003 19:03:42 -0000 Received: from unknown (HELO brmea-mail-2.sun.com) (192.18.98.43) by daedalus.apache.org with SMTP; 8 Oct 2003 19:03:42 -0000 Received: from engmail1mpk.Eng.Sun.COM ([129.146.11.21]) by brmea-mail-2.sun.com (8.12.10/8.12.9) with ESMTP id h98J3laV028250 for ; Wed, 8 Oct 2003 13:03:47 -0600 (MDT) Received: from phys-mpkmaila (phys-mpkmaila.SFBay.Sun.COM [129.146.18.131]) by engmail1mpk.Eng.Sun.COM (8.12.10+Sun/8.12.10/ENSMAIL,v2.2) with ESMTP id h98J3jDS024533 for ; Wed, 8 Oct 2003 12:03:45 -0700 (PDT) Received: from misto (misto.SFBay.Sun.COM [129.145.132.207]) by mpkmail.eng.sun.com (iPlanet Messaging Server 5.2 Patch 1 (built Apr 2 2002)) with SMTP id <0HMG009B2CYALQ@mpkmail.eng.sun.com> for tomcat-dev@jakarta.apache.org; Wed, 08 Oct 2003 12:03:46 -0700 (PDT) Date: Wed, 08 Oct 2003 12:03:46 -0700 (PDT) From: Kin-Man Chung Subject: [5] IndexOutOfBoundsException from CharChunk To: tomcat-dev@jakarta.apache.org Reply-to: Kin-Man Chung Message-id: <0HMG009B3CYALQ@mpkmail.eng.sun.com> MIME-version: 1.0 X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.5.3_06 SunOS 5.9 sun4u sparc Content-type: TEXT/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-MD5: m0stazc2szXOKVG+nWRUQQ== X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I am getting a sporadic IndexOutOfBoundsException and it seems to come from org.apache.tomcat.util.buf.CharChunk.flushBuffer. The trace is Servlet.service() for servlet jsp threw exception java.lang.IndexOutOfBoundsException at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:132) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:191) at org.apache.tomcat.util.buf.WriteConvertor.write(C2BConverter.java:228 ) at org.apache.tomcat.util.buf.C2BConverter.convert(C2BConverter.java:120 ) at org.apache.coyote.tomcat5.OutputBuffer.realWriteChars(OutputBuffer.ja va:606) at org.apache.tomcat.util.buf.CharChunk.flushBuffer(CharChunk.java:463) at org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:357) at org.apache.coyote.tomcat5.CoyoteWriter.flush(CoyoteWriter.java:117) at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:203) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary .java:990) ... In CharChunk, public void flushBuffer() throws IOException { //assert out!=null if( out==null ) { throw new IOException( "Buffer overflow, no sink " + limit + " " + buff.length ); } out.realWriteChars( buff, start, end - start ); end=start; } when realWriteChars is called, the value for start is 0, end is 16384, and buff.length is 8192, hence the exception. Does anyone knows how end can go beyond 8192? This only hapeens very rarely, under heavy load. -Kin-man --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org