michael-o commented on pull request #456:
URL: https://github.com/apache/tomcat/pull/456#issuecomment-954947125


   > 
   > 
   > > [...] so the second Tomcat now shuts down APR globally, releasing the 
global structures. The first Tomcat is now shutting down, its `AprConnector` 
tries to use a sub APR pool/object from a pool which has already been released.
   > 
   > There is no `AprConnector`. 
   I actually meant the connector using the APR Protocol with the APR endpoint.
   
   Where is the Java call which eventually goes down into native to cause this 
problem? As the AprLifecycleListener is stopping, it should not try to use any 
APR pool. Perhaps the other connector is still trying to actually use pool 
objects in some other way. If that's the case, the problem isn't with 
double-shutdown. It's with shutdown-while-trying-to-still-do-stuff.
   > 
   > So can we get a Java stack trace for where this is crashing? It should be 
simple to check to see if APR has been killed at some point and at least not 
crash the JVM.
   
   How does this actually matter?  If APR has been globally terminated any 
subsequent operation to any APR object is deemed to fail and that this what 
happens here. The problem is just init and destroy and wrong points in time. 
That's it.
   
   ```
   Stack: [0x00007fffdcccc000,0x00007fffdcdcc000],  sp=0x00007fffdcdcae70,  
free space=1019k
   Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native 
code)
   C  [libapr-1.so.0+0x336fa]  signed char+0x1a
   C  [libtcnative-1.so.0.2.24+0x19a06]  
Java_org_apache_tomcat_jni_Address_get+0x36
   j  org.apache.tomcat.jni.Address.get(IJ)J+0
   j  
org.apache.tomcat.util.net.AprEndpoint.getLocalAddress()Ljava/net/InetSocketAddress;+15
   j  org.apache.tomcat.util.net.AbstractEndpoint.unlockAccept()V+26
   j  
org.apache.tomcat.util.net.AbstractEndpoint.closeServerSocketGraceful()V+23
   j  org.apache.coyote.AbstractProtocol.closeServerSocketGraceful()V+4
   j  org.apache.catalina.core.StandardService.stopInternal()V+35
   j  org.apache.catalina.util.LifecycleBase.stop()V+214
   j  org.apache.catalina.core.StandardServer.stopInternal()V+82
   j  org.apache.catalina.util.LifecycleBase.stop()V+214
   j  org.apache.catalina.startup.Tomcat.stop()V+9
   j  
org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stopTomcat()V+29
   j  org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stop()V+32
   j  
org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.stop()V+4
   j  org.springframework.context.SmartLifecycle.stop(Ljava/lang/Runnable;)V+1
   ```
   
   This is from the main Tomcat instance and shutdown time. The management one 
is already gone.


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

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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

Reply via email to