AspectManager's synch blocks and AM's aop lock enter deadlock state
-------------------------------------------------------------------
Key: JBAOP-717
URL:
https://jira.jboss.org/jira/browse/JBAOP-717
Project: JBoss AOP
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.1.0.CR3
Reporter: Flavia Rainone
Assignee: Flavia Rainone
Fix For: 2.0.2.GA
The order in which synchronization blocks are put in relation to the aop lock calls must
always be consistent on all occurrences inside AspectManager.
This rule is broken on AspectManager's translate method, where the aop lock is
retrived before the synchronization block starts. That enters deadlock state with any
other occurrence of the aop lock in the class, given that other occurrences are happening
inside the syncronization blocks.
An example of this:
Thread-0" prio=1 tid=0x8c60f498 nid=0x2d02 waiting for monitor entry
[0x8bcfd000..0x8bcff0b0]
at org.jboss.aop.AspectManager.translate(AspectManager.java:1052)
- waiting to lock <0x91acefd0> (a org.jboss.aop.AspectManager)
at org.jboss.aop.AspectManager.transform(AspectManager.java:1010)
at org.jboss.aop.standalone.AOPTransformer.aspectTransform(AOPTransformer.java:87)
at org.jboss.aop.standalone.AOPTransformer.transform(AOPTransformer.java:75)
at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
- locked <0x91acf098> (a sun.misc.Launcher$AppClassLoader)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
- locked <0x91acf098> (a sun.misc.Launcher$AppClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
- locked <0x91acf098> (a sun.misc.Launcher$AppClassLoader)
at
org.jboss.test.aop.rebuildingchain.ConstructorExecutionSyncThread.invokeJoinPoint(ConstructorExecutionSyncThread.java:36)
at org.jboss.test.aop.rebuildingchain.SyncThread.run(SyncThread.java:44)
"Thread-1" prio=1 tid=0x8c60f018 nid=0x2d01 at
breakpoint[0x8befe000..0x8befee30]
at org.jboss.aop.AspectManager.removeBinding(AspectManager.java:1382)
- waiting to lock <0x91acefd0> (a org.jboss.aop.AspectManager)
at org.jboss.test.aop.rebuildingchain.RebuildThread.unlinkAdvice(RebuildThread.java:89)
at org.jboss.test.aop.rebuildingchain.RebuildThread.run(RebuildThread.java:54)
"ReaderThread" prio=1 tid=0x8c618348 nid=0x2d00 runnable
[0x8c1fe000..0x8c1fedb0]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
- locked <0xae904988> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
- locked <0xae904988> (a java.io.InputStreamReader)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner$ReaderThread.run(RemoteTestRunner.java:140)
"Low Memory Detector" daemon prio=1 tid=0x0947e8f8 nid=0x2cfd runnable
[0x00000000..0x00000000]
"CompilerThread1" daemon prio=1 tid=0x8d105070 nid=0x2cfc waiting on condition
[0x00000000..0x8c8ee198]
"CompilerThread0" daemon prio=1 tid=0x8d103c50 nid=0x2cfb waiting on condition
[0x00000000..0x8c96f118]
"AdapterThread" daemon prio=1 tid=0x8d101548 nid=0x2cfa waiting on condition
[0x00000000..0x00000000]
"Signal Dispatcher" daemon prio=1 tid=0x09418390 nid=0x2cf9 runnable
[0x00000000..0x00000000]
"JDWP Command Reader" daemon prio=1 tid=0x8d100508 nid=0x2cf3 runnable
[0x00000000..0x00000000]
"JDWP Event Helper Thread" daemon prio=1 tid=0x092fda10 nid=0x2cf2 runnable
[0x00000000..0x00000000]
"JDWP Transport Listener: dt_socket" daemon prio=1 tid=0x092fbd60 nid=0x2cef
runnable [0x00000000..0x8d3aac70]
"Finalizer" daemon prio=1 tid=0x092ed088 nid=0x2ced in Object.wait()
[0x8d62b000..0x8d62beb0]
at java.lang.Object.wait(Native Method)
- waiting on <0x91b054a0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked <0x91b054a0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
"Reference Handler" daemon prio=1 tid=0x092eba18 nid=0x2ceb in Object.wait()
[0x8d6ac000..0x8d6ad030]
at java.lang.Object.wait(Native Method)
- waiting on <0x91ae29e0> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x91ae29e0> (a java.lang.ref.Reference$Lock)
"main" prio=1 tid=0x092463a0 nid=0x2ce1 waiting for monitor entry
[0xbfd41000..0xbfd42728]
at org.jboss.aop.AspectManager.removeBinding(AspectManager.java:1382)
- waiting to lock <0x91acefd0> (a org.jboss.aop.AspectManager)
at org.jboss.test.aop.rebuildingchain.RebuildThread.unlinkAdvice(RebuildThread.java:89)
at org.jboss.test.aop.rebuildingchain.RebuildThread.unlinkAdvice(RebuildThread.java:76)
at
org.jboss.test.aop.rebuildingchain.RebuildingChainTestCase.assertRebuildingChainWithSetDone(RebuildingChainTestCase.java:226)
at
org.jboss.test.aop.rebuildingchain.RebuildingChainTestCase.testConstructorExecutionWithSetDone(RebuildingChainTestCase.java:108)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
"VM Thread" prio=1 tid=0x092e9518 nid=0x2cea runnable
"GC task thread#0 (ParallelGC)" prio=1 tid=0x09260328 nid=0x2ce8 runnable
"GC task thread#1 (ParallelGC)" prio=1 tid=0x09260f78 nid=0x2ce9 runnable
"VM Periodic Task Thread" prio=1 tid=0x09481568 nid=0x2cfe waiting on condition
--
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