Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-3953

Deadlock in classloaders

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • framework-4.2.0
    • None
    • None
    • None
    • JDK 6

    Description

      The two threads seem to deadlock

      "pool-org.fusesource.patch.patch-core-7.2.0.redhat-012-thread-1" prio=6 tid=0x32f60400 nid=0x1110 in Object.wait() [0x3b55e000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	- waiting on <0x25e09670> (a java.util.HashMap)
      	at java.lang.Object.wait(Object.java:485)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2050)
      	- locked <0x25e09670> (a java.util.HashMap)
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1472)
      	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1923)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2228)
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1472)
      	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1923)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1862)
      	at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:419)
      	at org.apache.aries.blueprint.container.BlueprintRepository.loadClass(BlueprintRepository.java:410)
      	at org.apache.aries.blueprint.container.GenericType.parse(GenericType.java:113)
      	at org.apache.aries.blueprint.di.AbstractRecipe.doLoadType(AbstractRecipe.java:168)
      	at org.apache.aries.blueprint.di.AbstractRecipe.loadType(AbstractRecipe.java:161)
      	at org.apache.aries.blueprint.container.BeanRecipe.loadClass(BeanRecipe.java:249)
      	at org.apache.aries.blueprint.container.BeanRecipe.getType(BeanRecipe.java:895)
      	at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:323)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
      	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
      	at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)
      	at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:282)
      	at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:249)
      	at org.apache.aries.blueprint.container.ServiceRecipe.internalCreate(ServiceRecipe.java:146)
      	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
      	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)
      	at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:667)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:370)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
      	- locked <0x26a0b280> (a java.util.concurrent.atomic.AtomicBoolean)
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:265)
      	at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:228)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)
      	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)
      	at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)
      	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)
      	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4580)
      	at org.apache.felix.framework.Felix$4.run(Felix.java:2115)
      	at org.apache.felix.framework.Felix$5.run(Felix.java:2159)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	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)
      
      "pool-org.fusesource.patch.patch-commands-7.2.0.redhat-012-thread-1" prio=6 tid=0x32f5fc00 nid=0x19fc waiting for monitor entry [0x3b4ce000]
         java.lang.Thread.State: BLOCKED (on object monitor)
      	at java.lang.ClassLoader.checkCerts(ClassLoader.java:782)
      	- waiting to lock <0x25e09390> (a org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5)
      	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)
      	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:625)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2228)
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1472)
      	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1923)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1357)
      	at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1521)
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1467)
      	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1923)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1862)
      	at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:419)
      	at org.apache.aries.blueprint.container.GenericType.parse(GenericType.java:115)
      	at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.loadType(AbstractServiceReferenceRecipe.java:281)
      	at org.apache.aries.blueprint.di.AbstractRecipe.loadClass(AbstractRecipe.java:149)
      	at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.getInterfaceClass(AbstractServiceReferenceRecipe.java:381)
      	at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:96)
      	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
      	at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)
      	at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:933)
      	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)
      	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
      	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
      	at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)
      	at org.apache.aries.blueprint.di.CollectionRecipe.internalCreate(CollectionRecipe.java:90)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)
      	at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:933)
      	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)
      	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)
      	at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:282)
      	at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:249)
      	at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:236)
      	at org.apache.aries.blueprint.container.ServiceRecipe.getClasses(ServiceRecipe.java:375)
      	at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:183)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:689)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:369)
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
      	- locked <0x2698d5b0> (a java.util.concurrent.atomic.AtomicBoolean)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
      	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)
      
      

      It may only happen with JDK 6 because the ClassLoader in JDK 6 is different and does not support concurrent class loads.

      I'm not sure yet why this happen though.

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              gnodet Guillaume Nodet
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: