1 Reply Latest reply: May 11, 2012 7:44 PM by 685037 RSS

    Tomcat thread gets stuck at AccessController.getStackAccessControlContext

    685037
      We're noticing a very peculiar problem on Win 7 / 64 bit / JDK 6_30 where a servlet tries to spawn a new thread but gets stuck in the new Thread's constructor. It happens consistently on 1 machine but not on other apparently identical setups. Any help would be appreciated.

      (I hope this is the right forum for this error report)

      Thread dump below:
      "HTTP-NIO-Worker-1-2" prio=6 tid=0x000000000712c000 nid=0x1b50 runnable [0x00000000159cd000]
         java.lang.Thread.State: RUNNABLE
                      at java.security.AccessController.getStackAccessControlContext(Native Method)
                      at java.security.AccessController.getContext(AccessController.java:484)
                      at java.lang.Thread.init(Thread.java:358)
                      at java.lang.Thread.<init>(Thread.java:488)
                      ... .snip . ..
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
                      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
                      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
                      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
                      ... .snip . ..
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
                      at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:313)
                      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
                      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1544)
                      - locked <0x00000007822cfa10> (a org.apache.tomcat.util.net.NioChannel)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                      at java.lang.Thread.run(Thread.java:662)
      While searching on Google we found a few other recent incidents but none of them seem to have found a resolution:
      - http://scn.sap.com/thread/2071927
      - https://groups.google.com/forum/#!msg/google-appengine/js5CeRWLQZ0/6IbZMM5SrmsJ

      There are also quite a few old reports about JVMs crashing at this line but on older JDK 6 builds:
      - http://netbeans.org/bugzilla/attachment.cgi?id=109493&action=edit
      - https://issues.jboss.org/secure/attachment/12333561/hs_err_pid8616.log?_sscc=t
      - http://www.coderanch.com/t/449308/Tomcat/Tomcat-crash-when-running-native
        • 1. Re: Tomcat thread gets stuck at AccessController.getStackAccessControlContext
          685037
          I used ProcessExplorer to peek into the native part of the stack of that method. It seems that the method is doing work - mostly resolving classes.

          Here are the stack dumps at various times...goes on for ever but the thread is still doing some work:
          ntdll.dll!NtWaitForSingleObject+0xa
          KERNELBASE.dll!WaitForSingleObjectEx+0x9c
          jvm.dll!JVM_FindSignal+0x29fd
          jvm.dll!JVM_ResolveClass+0x1ce3b
          jvm.dll!JVM_ResolveClass+0x1d4b7
          jvm.dll!JVM_ResolveClass+0x2ecf5
          jvm.dll!JVM_GetStackAccessControlContext+0x653
          jvm.dll!JVM_FindSignal+0x15d720
          jvm.dll!JVM_FindSignal+0x53b7f
          jvm.dll!JVM_FindSignal+0x54005
          jvm.dll!JVM_FindSignal+0x54117
          jvm.dll!JVM_GetStackAccessControlContext+0x2a1
          jvm.dll!JVM_FindSignal+0x15d720
          jvm.dll+0x5401e
          jvm.dll!JVM_FindSignal+0x53ff9
          jvm.dll!JVM_FindSignal+0x54117
          jvm.dll!JVM_GetStackAccessControlContext+0x2a1
          jvm.dll+0xdd10a
          jvm.dll+0x38546
          jvm.dll!JVM_GetStackAccessControlContext+0x2c1