From dev-return-216445-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Wed Mar 17 09:20:43 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 34F9818065C for ; Wed, 17 Mar 2021 10:20:43 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 2E36044718 for ; Wed, 17 Mar 2021 09:20:42 +0000 (UTC) Received: (qmail 21999 invoked by uid 500); 17 Mar 2021 09:20:41 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 21989 invoked by uid 99); 17 Mar 2021 09:20:41 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2021 09:20:41 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 4524D8E928; Wed, 17 Mar 2021 09:20:40 +0000 (UTC) Date: Wed, 17 Mar 2021 09:20:40 +0000 To: "dev@tomcat.apache.org" Subject: [tomcat] branch 9.0.x updated: Add debug logging after test failure on Travis CI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <161597284008.1042.14793923331044515712@gitbox.apache.org> From: markt@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: tomcat X-Git-Refname: refs/heads/9.0.x X-Git-Reftype: branch X-Git-Oldrev: 4fa399a17fc97daad1772d02ea938c29a799464d X-Git-Newrev: 1520961b082d6a7c7e9c9e6466ff7fe5031cbf72 X-Git-Rev: 1520961b082d6a7c7e9c9e6466ff7fe5031cbf72 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/9.0.x by this push: new 1520961 Add debug logging after test failure on Travis CI 1520961 is described below commit 1520961b082d6a7c7e9c9e6466ff7fe5031cbf72 Author: Mark Thomas AuthorDate: Wed Mar 17 09:19:03 2021 +0000 Add debug logging after test failure on Travis CI Error was: Exception in thread "http-nio2-127.0.0.1-auto-1-exec-6" java.nio.BufferOverflowException at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:213) at org.apache.coyote.http2.Http2Parser.readDataFrame(Http2Parser.java:200) ... So far, I ahven't been able to identify a code path that could trigger this so enabling debug logging to gather more info. --- .../apache/coyote/http2/TestCancelledUpload.java | 121 +++++++++++---------- 1 file changed, 64 insertions(+), 57 deletions(-) diff --git a/test/org/apache/coyote/http2/TestCancelledUpload.java b/test/org/apache/coyote/http2/TestCancelledUpload.java index accd4b3..a3ad010 100644 --- a/test/org/apache/coyote/http2/TestCancelledUpload.java +++ b/test/org/apache/coyote/http2/TestCancelledUpload.java @@ -19,6 +19,8 @@ package org.apache.coyote.http2; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; +import java.util.logging.Level; +import java.util.logging.LogManager; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -37,72 +39,77 @@ public class TestCancelledUpload extends Http2TestBase { public void testCancelledRequest() throws Exception { http2Connect(); - http2Protocol.setAllowedTrailerHeaders(TRAILER_HEADER_NAME); + LogManager.getLogManager().getLogger("org.apache.coyote.http2").setLevel(Level.ALL); + try { + http2Protocol.setAllowedTrailerHeaders(TRAILER_HEADER_NAME); - int bodySize = 8192; - int bodyCount = 20; + int bodySize = 8192; + int bodyCount = 20; - byte[] headersFrameHeader = new byte[9]; - ByteBuffer headersPayload = ByteBuffer.allocate(128); - byte[] dataFrameHeader = new byte[9]; - ByteBuffer dataPayload = ByteBuffer.allocate(bodySize); - byte[] trailerFrameHeader = new byte[9]; - ByteBuffer trailerPayload = ByteBuffer.allocate(256); + byte[] headersFrameHeader = new byte[9]; + ByteBuffer headersPayload = ByteBuffer.allocate(128); + byte[] dataFrameHeader = new byte[9]; + ByteBuffer dataPayload = ByteBuffer.allocate(bodySize); + byte[] trailerFrameHeader = new byte[9]; + ByteBuffer trailerPayload = ByteBuffer.allocate(256); - buildPostRequest(headersFrameHeader, headersPayload, false, dataFrameHeader, dataPayload, - null, trailerFrameHeader, trailerPayload, 3); + buildPostRequest(headersFrameHeader, headersPayload, false, dataFrameHeader, dataPayload, + null, trailerFrameHeader, trailerPayload, 3); - // Write the headers - writeFrame(headersFrameHeader, headersPayload); - // Body - for (int i = 0; i < bodyCount; i++) { - writeFrame(dataFrameHeader, dataPayload); - } + // Write the headers + writeFrame(headersFrameHeader, headersPayload); + // Body + for (int i = 0; i < bodyCount; i++) { + writeFrame(dataFrameHeader, dataPayload); + } - // Trailers - writeFrame(trailerFrameHeader, trailerPayload); - - // The Server will process the request on a separate thread to the - // incoming frames. - // The request processing thread will: - // - read up to 128 bytes of request body - // (and issue a window update for bytes read) - // - write a 403 response with no response body - // The connection processing thread will: - // - read the request body until the flow control window is exhausted - // - reset the stream if further DATA frames are received - parser.readFrame(true); - - // Check for reset and exit if found - if (checkReset()) { - return; - } + // Trailers + writeFrame(trailerFrameHeader, trailerPayload); + + // The Server will process the request on a separate thread to the + // incoming frames. + // The request processing thread will: + // - read up to 128 bytes of request body + // (and issue a window update for bytes read) + // - write a 403 response with no response body + // The connection processing thread will: + // - read the request body until the flow control window is exhausted + // - reset the stream if further DATA frames are received + parser.readFrame(true); - // Not window update, not reset, must be the headers - Assert.assertEquals("3-HeadersStart\n" + - "3-Header-[:status]-[403]\n" + - "3-Header-[content-length]-[0]\n" + - "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" + - "3-HeadersEnd\n", - output.getTrace()); - output.clearTrace(); - parser.readFrame(true); - - // Check for reset and exit if found - if (checkReset()) { - return; - } + // Check for reset and exit if found + if (checkReset()) { + return; + } + + // Not window update, not reset, must be the headers + Assert.assertEquals("3-HeadersStart\n" + + "3-Header-[:status]-[403]\n" + + "3-Header-[content-length]-[0]\n" + + "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" + + "3-HeadersEnd\n", + output.getTrace()); + output.clearTrace(); + parser.readFrame(true); - // Not window update, not reset, must be the response body - Assert.assertEquals("3-Body-0\n" + - "3-EndOfStream\n", - output.getTrace()); - output.clearTrace(); - parser.readFrame(true); + // Check for reset and exit if found + if (checkReset()) { + return; + } - Assert.assertTrue(checkReset()); + // Not window update, not reset, must be the response body + Assert.assertEquals("3-Body-0\n" + + "3-EndOfStream\n", + output.getTrace()); + output.clearTrace(); + parser.readFrame(true); + + Assert.assertTrue(checkReset()); - // If there are any more frames after this, ignore them + // If there are any more frames after this, ignore them + } finally { + LogManager.getLogManager().getLogger("org.apache.coyote.http2").setLevel(Level.INFO); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org