Menu

#194 Deadlock in gate application

HEAD
closed-out-of-date
nobody
None
5
2018-05-31
2015-01-20
Yan
No

Hi,

I've found deadlock when run duplicated CorpusController in several threads.
The reason is that in class gate.creole.AbstractResource
access to static field beanInfoCache is not synchronized.

Here is threads dump for deadlock:

Found one Java-level deadlock:

"IndexingThread-4[57]":
waiting to lock monitor 0x0000000002aa5198 (object 0x000000077bfc21f8, a gate.util.GateClassLoader),
which is held by "IndexingThread-2[55]"
"IndexingThread-2[55]":
waiting to lock monitor 0x0000000002aa6168 (object 0x000000077c086df0, a gate.util.GateClassLoader),
which is held by "IndexingThread-1[54]"
"IndexingThread-1[54]":
waiting to lock monitor 0x0000000002aa5198 (object 0x000000077bfc21f8, a gate.util.GateClassLoader),
which is held by "IndexingThread-2[55]"

Java stack information for the threads listed above:

"IndexingThread-4[57]":
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:103)
at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:93)
at com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66)
at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:438)
at java.beans.Introspector.<init>(Introspector.java:388)
at java.beans.Introspector.getBeanInfo(Introspector.java:252)
at java.beans.Introspector.getBeanInfo(Introspector.java:214)
at gate.creole.AbstractResource.getBeanInfo(AbstractResource.java:493)
at gate.creole.AbstractResource.removeResourceListeners(AbstractResource.java:333)
at gate.creole.ConditionalSerialController.runComponent(ConditionalSerialController.java:182)
at gate.creole.SerialController.executeImpl(SerialController.java:157)
at gate.creole.ConditionalSerialAnalyserController.executeImpl(ConditionalSerialAnalyserController.java:244)
at gate.creole.ConditionalSerialAnalyserController.execute(ConditionalSerialAnalyserController.java:139)
at org.apache.nutch.data2life.index.MimirIndexWriter$IndexingThread.run(MimirIndexWriter.java:251)
"IndexingThread-2[55]":
at java.lang.ClassLoader.loadClass(ClassLoader.java:404)
- waiting to lock <0x000000077c086df0> (a gate.util.GateClassLoader)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:199)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:239)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:216)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:139)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:103)
at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:93)
at com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66)
at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:438)
at java.beans.Introspector.<init>(Introspector.java:388)
at java.beans.Introspector.getBeanInfo(Introspector.java:252)
at java.beans.Introspector.getBeanInfo(Introspector.java:214)
at gate.creole.AbstractResource.getBeanInfo(AbstractResource.java:493)
at gate.creole.AbstractResource.removeResourceListeners(AbstractResource.java:333)
at gate.creole.ConditionalSerialController.runComponent(ConditionalSerialController.java:182)
at gate.creole.SerialController.executeImpl(SerialController.java:157)
at gate.creole.ConditionalSerialAnalyserController.executeImpl(ConditionalSerialAnalyserController.java:244)
at gate.creole.ConditionalSerialAnalyserController.execute(ConditionalSerialAnalyserController.java:139)
at org.apache.nutch.data2life.index.MimirIndexWriter$IndexingThread.run(MimirIndexWriter.java:251)
"IndexingThread-1[54]":
at java.lang.ClassLoader.loadClass(ClassLoader.java:404)
- waiting to lock <0x000000077bfc21f8> (a gate.util.GateClassLoader)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:199)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:239)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:216)
at gate.util.GateClassLoader.loadClass(GateClassLoader.java:139)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:103)
at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:93)
at com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66)
at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:438)
at java.beans.Introspector.<init>(Introspector.java:388)
at java.beans.Introspector.getBeanInfo(Introspector.java:252)
at java.beans.Introspector.getBeanInfo(Introspector.java:214)
at gate.creole.AbstractResource.getBeanInfo(AbstractResource.java:493)
at gate.creole.AbstractResource.setResourceListeners(AbstractResource.java:295)
at gate.creole.ConditionalSerialController.runComponent(ConditionalSerialController.java:149)
at gate.creole.SerialController.executeImpl(SerialController.java:157)
at gate.creole.ConditionalSerialAnalyserController.executeImpl(ConditionalSerialAnalyserController.java:244)
at gate.creole.ConditionalSerialAnalyserController.execute(ConditionalSerialAnalyserController.java:139)
at org.apache.nutch.data2life.index.MimirIndexWriter$IndexingThread.run(MimirIndexWriter.java:251)

Found 1 deadlock.

Discussion

  • Jan  Dedek

    Jan Dedek - 2015-05-18

    I can confirm the bug. See my post at gate users:
    https://sourceforge.net/p/gate/mailman/message/34109423/

    It seems that making the method gate.creole.AbstractResource.getBeanInfo(Class<? extends Resource>) synchronized could solve the problem.

     
  • Avishay

    Avishay - 2016-03-20

    hi... i'm using gate 7 ... and upgrading to gate 8 is impossible right now for us.... and we are facing a problem with the above bug .... is there any patch for it ?

     
  • Mark Greenwood

    Mark Greenwood - 2018-05-31
    • status: open --> closed-out-of-date
     

Log in to post a comment.