Deadlock problem between unregisterClassLoader and normal classloader usage
---------------------------------------------------------------------------
Key: JBCL-26
URL:
https://jira.jboss.org/jira/browse/JBCL-26
Project: JBoss ClassLoader
Issue Type: Bug
Components: ClassLoaderSystem
Affects Versions: JBossCL.2.0.0.Beta12
Reporter: Adrian Brock
Assignee: Adrian Brock
Fix For: JBossCL.2.0.0.CR1
There's a deadlock problem between ClassLoaderDomain.unregisterClassLoader()
and normal classloader usage, as shown by this thread dump during SHUTDOWN:
Found one Java-level deadlock:
=============================
"JBoss Shutdown Hook":
waiting to lock monitor 0x09314444 (object 0xaef03488, a
org.jboss.classloader.spi.base.BaseClassLoader),
which is held by "main"
"main":
waiting to lock monitor 0x09314484 (object 0xaef029b8, a
org.jboss.classloader.spi.ClassLoaderDomain),
which is held by "JBoss Shutdown Hook"
Java stack information for the threads listed above:
===================================================
"JBoss Shutdown Hook":
at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:395)
at
org.jboss.classloader.spi.ClassLoaderDomain.unregisterClassLoaderMBean(ClassLoaderDomain.java:685)
at
org.jboss.classloader.spi.ClassLoaderDomain.beforeUnregisterClassLoader(ClassLoaderDomain.java:643)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.unregisterClassLoader(BaseClassLoaderDomain.java:1236)
- locked <0xaef029b8> (a org.jboss.classloader.spi.ClassLoaderDomain)
at
org.jboss.classloader.spi.base.BaseClassLoaderSystem.unregisterClassLoaderPolicy(BaseClassLoaderSystem.java:147)
at
org.jboss.classloader.spi.ClassLoaderSystem.unregisterClassLoaderPolicy(ClassLoaderSystem.java:470)
at
org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule.removeClassLoader(ClassLoaderPolicyModule.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
at
org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
at
org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at
org.jboss.beans.info.plugins.AbstractBeanInfo.invoke(AbstractBeanInfo.java:300)
at
org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext.invoke(AbstractKernelControllerContext.java:279)
at
org.jboss.kernel.plugins.dispatch.InvokeDispatchHelper.invoke(InvokeDispatchHelper.java:104)
at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.doUninstalls(InstallsAwareAction.java:214)
at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.doUninstalls(InstallsAwareAction.java:170)
at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:156)
at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:42)
at
org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleUninstallAction(SimpleControllerContextAction.java:79)
at
org.jboss.dependency.plugins.action.AccessControllerContextAction.uninstall(AccessControllerContextAction.java:131)
at
org.jboss.dependency.plugins.AbstractControllerContextActions.uninstall(AbstractControllerContextActions.java:58)
at
org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
at
org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1406)
at
org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1064)
at
org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:986)
at
org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:513)
at
org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:470)
at
org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.undeployBean(AbstractKernelDeployer.java:406)
at
org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.undeployBeans(AbstractKernelDeployer.java:385)
at
org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.undeploy(AbstractKernelDeployer.java:162)
at
org.jboss.kernel.plugins.deployment.BasicKernelDeployer.undeploy(BasicKernelDeployer.java:88)
at
org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.undeploy(BasicXMLDeployer.java:95)
at
org.jboss.kernel.plugins.deployment.BasicKernelDeployer.shutdown(BasicKernelDeployer.java:102)
at org.jboss.bootstrap.microcontainer.ServerImpl.doShutdown(ServerImpl.java:165)
at
org.jboss.bootstrap.AbstractServerImpl.shutdownServer(AbstractServerImpl.java:523)
at
org.jboss.bootstrap.AbstractServerImpl$ShutdownHook.run(AbstractServerImpl.java:827)
"main":
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.getClassLoaderSystem(BaseClassLoaderDomain.java:103)
- waiting to lock <0xaef029b8> (a
org.jboss.classloader.spi.ClassLoaderDomain)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.findLoader(BaseClassLoaderDomain.java:246)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:190)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1009)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:728)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:372)
- locked <0xaef03488> (a org.jboss.classloader.spi.base.BaseClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
- locked <0xaef03488> (a org.jboss.classloader.spi.base.BaseClassLoader)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:502)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:462)
at java.security.AccessController.doPrivileged(Native Method)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:460)
- locked <0xaef03488> (a org.jboss.classloader.spi.base.BaseClassLoader)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:437)
at
org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
at
org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
at
org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452)
at
org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:254)
at
org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:148)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:196)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1009)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:728)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:372)
- locked <0xaef03488> (a org.jboss.classloader.spi.base.BaseClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
- locked <0xaef03488> (a org.jboss.classloader.spi.base.BaseClassLoader)
at
org.jboss.system.microcontainer.ServiceControllerContextActions.getLifecycleOnly(ServiceControllerContextActions.java:75)
at
org.jboss.system.microcontainer.ServiceControllerContext.<init>(ServiceControllerContext.java:88)
at
org.jboss.system.microcontainer.ServiceControllerContext.<init>(ServiceControllerContext.java:76)
at org.jboss.system.ServiceController.postRegister(ServiceController.java:612)
at
org.jboss.mx.server.AbstractMBeanInvoker.invokePostRegister(AbstractMBeanInvoker.java:974)
at
org.jboss.mx.server.AbstractMBeanInvoker.postRegister(AbstractMBeanInvoker.java:681)
at
org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
at org.jboss.system.server.jmx.JMXKernel.start(JMXKernel.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
at
org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
at
org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at
org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
at
org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
at
org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
at
org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
at
org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
at
org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at
org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at
org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:624)
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:442)
at
org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:331)
at
org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:309)
at
org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
at
org.jboss.kernel.plugins.deployment.BasicKernelDeployer.deploy(BasicKernelDeployer.java:76)
at
org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:88)
at
org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:158)
at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:117)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:398)
at org.jboss.Main.boot(Main.java:209)
at org.jboss.Main$1.run(Main.java:544)
at java.lang.Thread.run(Thread.java:595)
Found 1 deadlock.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira