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

            Bug ID: 57653
           Summary: APR/native crash during HTTP upgrade
           Product: Tomcat 9
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: ma...@apache.org

Created attachment 32539
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=32539&action=edit
Crash log

With the patch below applied (it forces writes onto a separate thread when
using HTTP upgrade) repeated running of the
org.apache.coyote.http11.upgrade.TestUpgrade unit test eventually (after a few
minutes on OSX and Linux) triggers a JVM crash.

I suspect that a socket is closed in one thread while it is still in the
Poller. However, I have not yet been able to identify the code path that
triggers this.

I have attached the crash report.



Index: java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
===================================================================
--- java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java   
(revision 1663237)
+++ java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java   
(working copy)
@@ -21,11 +21,9 @@
 import javax.servlet.ServletOutputStream;
 import javax.servlet.WriteListener;

-import org.apache.coyote.ContainerThreadMarker;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
-import org.apache.tomcat.util.net.DispatchType;
 import org.apache.tomcat.util.net.SocketWrapperBase;
 import org.apache.tomcat.util.res.StringManager;

@@ -114,11 +112,11 @@
         synchronized (registeredLock) {
             registered = true;
             // Container is responsible for first call to onDataAvailable().
-            if (ContainerThreadMarker.isContainerThread()) {
-                socketWrapper.addDispatch(DispatchType.NON_BLOCKING_WRITE);
-            } else {
+            //if (ContainerThreadMarker.isContainerThread()) {
+            //    socketWrapper.addDispatch(DispatchType.NON_BLOCKING_WRITE);
+            //} else {
                 socketWrapper.registerWriteInterest();
-            }
+            //}
         }

         this.listener = listener;

-- 
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

Reply via email to