[GitHub] [tomcat-jakartaee-migration] alitokmen commented on pull request #15: Add integration tests to the Apache Tomcat Migration Tool for Jakarta EE

2021-03-09 Thread GitBox


alitokmen commented on pull request #15:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/15#issuecomment-793611505


   @martin-g and others - My work is now done, I modified the Travis build and 
also added some "non transformation" tests, in particular that the XML parsing 
(which remains in javax) is working after the Jakarta EE migration tool has 
done its work.
   
   Will someone merge this PR? Or does this require further work / approval?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65177] New: org.apache.tomcat.util.net.TestSsl fails with OutOfMemoryError on 32-bit JVM

2021-03-09 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65177

Bug ID: 65177
   Summary: org.apache.tomcat.util.net.TestSsl fails with
OutOfMemoryError on 32-bit JVM
   Product: Tomcat 8
   Version: 8.5.63
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com
  Target Milestone: 

Testing 8.5.64 release candidate, one unit test fails with OutOfMemoryError
when running with a 32-bit JVM. It completes successfully with a 64-bit one.

The failing test:
org.apache.tomcat.util.net.TestSsl

Testcase: testPost took 12,641 sec
    FAILED
expected:<0> but was:<2>
junit.framework.AssertionFailedError: expected:<0> but was:<2>
    at org.apache.tomcat.util.net.TestSsl.testPost(TestSsl.java:160)

It fails in the same way with all 3 connectors. Here is an output from running
with NIO connector and Java 7u80 (Oracle):

[[[
09-Mar-2021 08:42:25.819 INFO [main]
org.apache.catalina.startup.LoggingBaseTest.setUp Starting test case [testPost]
09-Mar-2021 08:42:25.824 INFO [main] org.apache.coyote.AbstractProtocol.init
Initializing ProtocolHandler ["https-jsse-nio-127.0.0.1-auto-3"]
09-Mar-2021 08:42:25.826 INFO [main]
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
selector for servlet write/read
09-Mar-2021 08:42:25.827 INFO [main]
org.apache.catalina.core.StandardService.startInternal Starting service
[Tomcat]
09-Mar-2021 08:42:25.827 INFO [main]
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine:
Apache Tomcat/8.5.64
09-Mar-2021 08:42:25.842 INFO [main] org.apache.coyote.AbstractProtocol.start
Starting ProtocolHandler ["https-jsse-nio-127.0.0.1-auto-3-59015"]
09-Mar-2021 08:42:26.475 SEVERE [https-jsse-nio-127.0.0.1-auto-3-exec-5]
org.apache.coyote.AbstractProtocol$ConnectionHandler.process Failed to complete
processing of a request
java.lang.OutOfMemoryError: Java heap space
at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:77)
at
org.apache.tomcat.util.net.TestSsl$SimplePostServlet.doPost(TestSsl.java:300)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:364)
at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1629)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
09-Mar-2021 08:42:26.555 SEVERE [https-jsse-nio-127.0.0.1-auto-3-exec-6]
org.apache.coyote.AbstractProtocol$ConnectionHandler.process Failed to complete
processing of a request
java.lang.OutOfMemoryError: Java heap space
at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:77)
at
org.apache.tomcat.util.net.TestSsl$SimplePostServlet.doPost(TestSsl.java:300)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at
org.apache.catalina.authenticator.AuthenticatorBase.i

Re: [VOTE] Release Apache Tomcat 8.5.64

2021-03-09 Thread Konstantin Kolinko
пт, 5 мар. 2021 г. в 02:49, Mark Thomas :
>
> The proposed Apache Tomcat 8.5.64 release is now available for voting.
>
> The notable changes compared to the 8.5.63 release are:
>
> - Improvements to Async and non-blocking IO error handling
>
> - Improvements to handling of OpenSSL errors
>
> - Align the behaviour when null is passed to the ServletResponse
>methods setCharacterEncoding(), setContentType() and setLocale()
>with the recent clarification from the Jakarta Servlet project of
>the expected behaviour in these cases.
>
> Along with lots of other bug fixes and improvements.
>
> For full details, see the changelog:
> https://ci.apache.org/projects/tomcat/tomcat85/docs/changelog.html
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-8/v8.5.64/
>
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1302/
>
> The tag is:
> https://github.com/apache/tomcat/tree/8.5.64
> c47f86adea090175669df8b2ca04c93050bcaf8c
>
> The proposed 8.5.64 release is:
> [ ] Broken - do not release
> [x] Stable - go ahead and release as 8.5.64

All unit tests are OK with 32-bit Oracle Java 7u80 on Windows 10,
except one test that fails with an OutOfMemoryError.

org.apache.tomcat.util.net.TestSsl - testPost

It is not an issue with Tomcat, but with the test itself. I filed an
issue into Bugzilla:
https://bz.apache.org/bugzilla/show_bug.cgi?id=65177

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



JRE networking bug - JDK-8263243

2021-03-09 Thread Mark Thomas

Hi Rory,

I have spent a lot of time of the last few days investigating some 
networking issues with Tomcat and it looks like the root cause is in the 
JRE. I have opened the following issue:


https://bugs.openjdk.java.net/browse/JDK-8263243

TL;DR it appears that ServerSocketChannel.accept() can return multiple, 
valid SocketChannel instances for the same client connection. Start 
trying to use those duplicate SocketChannel instances with a Selector 
and stuff starts failing.


If the bug report is valid, it could be the root cause of all sorts of 
strange networking bugs. I'd appreciate anything you can do to get the 
right folks looking at the report. I am happy to provide any additional 
information that may be required and/or test nay proposed fixes.


Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [External] : JRE networking bug - JDK-8263243

2021-03-09 Thread Rory O'Donnell

Hi Mark,

Thanks for the bug, I noticed interest already in the issue.

I've added a label, will keep an eye on it.

Rgds,Rory

On 09/03/2021 12:06, Mark Thomas wrote:

Hi Rory,

I have spent a lot of time of the last few days investigating some 
networking issues with Tomcat and it looks like the root cause is in 
the JRE. I have opened the following issue:


https://bugs.openjdk.java.net/browse/JDK-8263243

TL;DR it appears that ServerSocketChannel.accept() can return 
multiple, valid SocketChannel instances for the same client 
connection. Start trying to use those duplicate SocketChannel 
instances with a Selector and stuff starts failing.


If the bug report is valid, it could be the root cause of all sorts of 
strange networking bugs. I'd appreciate anything you can do to get the 
right folks looking at the report. I am happy to provide any 
additional information that may be required and/or test nay proposed 
fixes.


Mark


--
Rgds, Rory O'Donnell
Quality Engineering Manager
Oracle EMEA, Dublin, Ireland


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: JRE networking bug - JDK-8263243

2021-03-09 Thread Rémy Maucherat
On Tue, Mar 9, 2021 at 1:06 PM Mark Thomas  wrote:

> Hi Rory,
>
> I have spent a lot of time of the last few days investigating some
> networking issues with Tomcat and it looks like the root cause is in the
> JRE. I have opened the following issue:
>
> https://bugs.openjdk.java.net/browse/JDK-8263243
>
> TL;DR it appears that ServerSocketChannel.accept() can return multiple,
> valid SocketChannel instances for the same client connection. Start
> trying to use those duplicate SocketChannel instances with a Selector
> and stuff starts failing.
>
> If the bug report is valid, it could be the root cause of all sorts of
> strange networking bugs. I'd appreciate anything you can do to get the
> right folks looking at the report. I am happy to provide any additional
> information that may be required and/or test nay proposed fixes.
>

I don't get what the "wrk" test client is. Anyway, impressive stuff.

I wonder if it happens with NIO2 as well.

Rémy


>
> Mark
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: JRE networking bug - JDK-8263243

2021-03-09 Thread Mark Thomas

On 09/03/2021 13:12, Rémy Maucherat wrote:

On Tue, Mar 9, 2021 at 1:06 PM Mark Thomas  wrote:


Hi Rory,

I have spent a lot of time of the last few days investigating some
networking issues with Tomcat and it looks like the root cause is in the
JRE. I have opened the following issue:

https://bugs.openjdk.java.net/browse/JDK-8263243

TL;DR it appears that ServerSocketChannel.accept() can return multiple,
valid SocketChannel instances for the same client connection. Start
trying to use those duplicate SocketChannel instances with a Selector
and stuff starts failing.

If the bug report is valid, it could be the root cause of all sorts of
strange networking bugs. I'd appreciate anything you can do to get the
right folks looking at the report. I am happy to provide any additional
information that may be required and/or test nay proposed fixes.



I don't get what the "wrk" test client is. Anyway, impressive stuff.


https://github.com/wg/wrk


I wonder if it happens with NIO2 as well.


Good question. The NIO2 acceptor is a little more complex but it should 
be possible to tweak the test case to check.


Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Fix BZ 65177 reduce memory footprint to avoid OOME on 32-bit JVMs

2021-03-09 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new bc8d75b  Fix BZ 65177 reduce memory footprint to avoid OOME on 32-bit 
JVMs
bc8d75b is described below

commit bc8d75b488961ef963efef430c30bcbab2ca4564
Author: Mark Thomas 
AuthorDate: Tue Mar 9 14:12:42 2021 +

Fix BZ 65177 reduce memory footprint to avoid OOME on 32-bit JVMs

https://bz.apache.org/bugzilla/show_bug.cgi?id=65177
---
 test/org/apache/tomcat/util/net/TestSsl.java | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/TestSsl.java 
b/test/org/apache/tomcat/util/net/TestSsl.java
index 1f70b8f..d7881cf 100644
--- a/test/org/apache/tomcat/util/net/TestSsl.java
+++ b/test/org/apache/tomcat/util/net/TestSsl.java
@@ -80,6 +80,12 @@ public class TestSsl extends TomcatBaseTest {
 }
 
 private static final int POST_DATA_SIZE = 16 * 1024 * 1024;
+private static final byte[] POST_DATA;
+static {
+POST_DATA = new byte[POST_DATA_SIZE]; // 16MB
+Arrays.fill(POST_DATA, (byte) 1);
+
+}
 
 @Test
 public void testPost() throws Exception {
@@ -107,15 +113,12 @@ public class TestSsl extends TomcatBaseTest {
 
 OutputStream os = socket.getOutputStream();
 
-byte[] bytes = new byte[POST_DATA_SIZE]; // 16MB
-Arrays.fill(bytes, (byte) 1);
-
 os.write("POST /post HTTP/1.1\r\n".getBytes());
 os.write("Host: localhost\r\n".getBytes());
-os.write(("Content-Length: " + 
Integer.valueOf(bytes.length) + "\r\n\r\n").getBytes());
+os.write(("Content-Length: " + 
Integer.valueOf(POST_DATA.length) + "\r\n\r\n").getBytes());
 // Write in 128KB blocks
-for (int i = 0; i < bytes.length / (128 * 1024); i++) {
-os.write(bytes, 0, 1024 * 128);
+for (int i = 0; i < POST_DATA.length / (128 * 1024); 
i++) {
+os.write(POST_DATA, 0, 1024 * 128);
 Thread.sleep(10);
 }
 os.flush();
@@ -139,11 +142,11 @@ public class TestSsl extends TomcatBaseTest {
 }
 }
 
-for (int i = 0; i < bytes.length; i++) {
+for (int i = 0; i < POST_DATA.length; i++) {
 int read = is.read();
-if (bytes[i] != read) {
+if (POST_DATA[i] != read) {
 System.err.println("Byte in position [" + i + 
"] had value [" + read +
-"] rather than [" + 
Byte.toString(bytes[i]) + "]");
+"] rather than [" + 
Byte.toString(POST_DATA[i]) + "]");
 errorCount.incrementAndGet();
 break;
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Increment version for next development cycle

2021-03-09 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 480a3be  Increment version for next development cycle
480a3be is described below

commit 480a3be7508983374d4f540a7aaabe43c6b5905a
Author: Mark Thomas 
AuthorDate: Tue Mar 9 14:15:50 2021 +

Increment version for next development cycle
---
 build.properties.default | 2 +-
 res/maven/mvn.properties.default | 2 +-
 webapps/docs/changelog.xml   | 4 +++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 4d2a90a..3e6b261 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -25,7 +25,7 @@
 # - Version Control Flags -
 version.major=10
 version.minor=0
-version.build=4
+version.build=5
 version.patch=0
 version.suffix=-dev
 
diff --git a/res/maven/mvn.properties.default b/res/maven/mvn.properties.default
index 17137d8..85174ae 100644
--- a/res/maven/mvn.properties.default
+++ b/res/maven/mvn.properties.default
@@ -39,7 +39,7 @@ 
maven.asf.release.repo.url=https://repository.apache.org/service/local/staging/d
 maven.asf.release.repo.repositoryId=apache.releases.https
 
 # Release version info
-maven.asf.release.deploy.version=10.0.4
+maven.asf.release.deploy.version=10.0.5
 
 #Where do we load the libraries from
 tomcat.lib.path=../../output/build/lib
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 967aaa7..6aeec4f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -103,7 +103,9 @@
   They eventually become mixed with the numbered issues (i.e., numbered
   issues do not "pop up" wrt. others).
 -->
-
+
+
+
   
 
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated (f92fe57 -> 28a732f)

2021-03-09 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from f92fe57  Add the option for distributions to disable dependency 
downloads
 add 28a732f  Fix BZ 65177 reduce memory footprint to avoid OOME on 32-bit 
JVMs

No new revisions were added by this update.

Summary of changes:
 test/org/apache/tomcat/util/net/TestSsl.java | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Fix BZ 65177 reduce memory footprint to avoid OOME on 32-bit JVMs

2021-03-09 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 506495b  Fix BZ 65177 reduce memory footprint to avoid OOME on 32-bit 
JVMs
506495b is described below

commit 506495bd5cd8464f6fa2966cf31d3265643173d3
Author: Mark Thomas 
AuthorDate: Tue Mar 9 14:12:42 2021 +

Fix BZ 65177 reduce memory footprint to avoid OOME on 32-bit JVMs

https://bz.apache.org/bugzilla/show_bug.cgi?id=65177
---
 test/org/apache/tomcat/util/net/TestSsl.java | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/TestSsl.java 
b/test/org/apache/tomcat/util/net/TestSsl.java
index d489537..dbc9c36 100644
--- a/test/org/apache/tomcat/util/net/TestSsl.java
+++ b/test/org/apache/tomcat/util/net/TestSsl.java
@@ -79,6 +79,12 @@ public class TestSsl extends TomcatBaseTest {
 }
 
 private static final int POST_DATA_SIZE = 16 * 1024 * 1024;
+private static final byte[] POST_DATA;
+static {
+POST_DATA = new byte[POST_DATA_SIZE]; // 16MB
+Arrays.fill(POST_DATA, (byte) 1);
+
+}
 
 @Test
 public void testPost() throws Exception {
@@ -106,15 +112,12 @@ public class TestSsl extends TomcatBaseTest {
 
 OutputStream os = socket.getOutputStream();
 
-byte[] bytes = new byte[POST_DATA_SIZE]; // 16MB
-Arrays.fill(bytes, (byte) 1);
-
 os.write("POST /post HTTP/1.1\r\n".getBytes());
 os.write("Host: localhost\r\n".getBytes());
-os.write(("Content-Length: " + 
Integer.valueOf(bytes.length) + "\r\n\r\n").getBytes());
+os.write(("Content-Length: " + 
Integer.valueOf(POST_DATA.length) + "\r\n\r\n").getBytes());
 // Write in 128KB blocks
-for (int i = 0; i < bytes.length / (128 * 1024); i++) {
-os.write(bytes, 0, 1024 * 128);
+for (int i = 0; i < POST_DATA.length / (128 * 1024); 
i++) {
+os.write(POST_DATA, 0, 1024 * 128);
 Thread.sleep(10);
 }
 os.flush();
@@ -138,11 +141,11 @@ public class TestSsl extends TomcatBaseTest {
 }
 }
 
-for (int i = 0; i < bytes.length; i++) {
+for (int i = 0; i < POST_DATA.length; i++) {
 int read = is.read();
-if (bytes[i] != read) {
+if (POST_DATA[i] != read) {
 System.err.println("Byte in position [" + i + 
"] had value [" + read +
-"] rather than [" + 
Byte.toString(bytes[i]) + "]");
+"] rather than [" + 
Byte.toString(POST_DATA[i]) + "]");
 errorCount.incrementAndGet();
 break;
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Document error handling for OpenSSL

2021-03-09 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 6c3797c  Document error handling for OpenSSL
6c3797c is described below

commit 6c3797c6014901a5cd118baec0b125e8b0a6ecf3
Author: remm 
AuthorDate: Tue Mar 9 15:17:25 2021 +0100

Document error handling for OpenSSL

Also log all errors on the stack as debug.
---
 .../tomcat/util/net/openssl/OpenSSLEngine.java | 40 +++---
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java 
b/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
index 4700c2a..f17ca3a 100644
--- a/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
+++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
@@ -940,34 +940,50 @@ public final class OpenSSLEngine extends SSLEngine 
implements SSLUtil.ProtocolIn
 }
 
 private void checkLastError() throws SSLException {
-long error = SSL.getLastErrorNumber();
-if (error != SSL.SSL_ERROR_NONE) {
-String err = SSL.getErrorString(error);
-if (logger.isDebugEnabled()) {
-logger.debug(sm.getString("engine.openSSLError", 
Long.toString(error), err));
-}
+String sslError = getLastError();
+if (sslError != null) {
 // Many errors can occur during handshake and need to be reported
 if (!handshakeFinished) {
 sendHandshakeError = true;
 } else {
-throw new SSLException(err);
+throw new SSLException(sslError);
 }
 }
 }
 
 
-/*
+/**
+ * Clear out any errors, but log a warning.
+ */
+private static void clearLastError() {
+getLastError();
+}
+
+/**
  * Many calls to SSL methods do not check the last error. Those that do
  * check the last error need to ensure that any previously ignored error is
  * cleared prior to the method call else errors may be falsely reported.
+ * @return the first error in the stack
+ *
+ * TODO: Improve error handling. Ideally, before any SSL_read, SSL_write,
+ *  clearLastError should always be called, and getLastError should be 
called
+ *  after on any negative result.
  *
- * TODO: Check last error after every call to an SSL method and respond
- *   appropriately.
  */
-private static void clearLastError() {
-while (SSL.getLastErrorNumber() != SSL.SSL_ERROR_NONE) {
+private static String getLastError() {
+String sslError = null;
+long error;
+while ((error = SSL.getLastErrorNumber()) != SSL.SSL_ERROR_NONE) {
 // Loop until getLastErrorNumber() returns SSL_ERROR_NONE
+String err = SSL.getErrorString(error);
+if (sslError == null) {
+sslError = err;
+}
+if (logger.isDebugEnabled()) {
+logger.debug(sm.getString("engine.openSSLError", 
Long.toString(error), err));
+}
 }
+return sslError;
 }
 
 private SSLEngineResult.Status getEngineStatus() {


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65177] org.apache.tomcat.util.net.TestSsl fails with OutOfMemoryError on 32-bit JVM

2021-03-09 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65177

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 OS||All

--- Comment #1 from Mark Thomas  ---
Fixed in:
- 10.0.x for 10.0.5 onwards
- 9.0.x for 9.0.45 onwards
- 8.5.x for 8.5.65 onwards

I opted for the shared array approach.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



buildbot failure in on tomcat-85-trunk

2021-03-09 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-85-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-85-trunk/builds/2638

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-85-commit' 
triggered this build
Build Source Stamp: [branch 8.5.x] 506495bd5cd8464f6fa2966cf31d3265643173d3
Blamelist: Mark Thomas 

BUILD FAILED: failed shell_8

Sincerely,
 -The Buildbot




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65177] org.apache.tomcat.util.net.TestSsl fails with OutOfMemoryError on 32-bit JVM

2021-03-09 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65177

--- Comment #2 from Konstantin Kolinko  ---
Ack.

Testing current 8.5.x with Java 7u80 32-bit (Windows 10), the test now
completes successfully.

Testcase: testPost took 14,948 sec

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org