blocked with no lock record ?
David Holmes
david.holmes at oracle.com
Thu Mar 8 02:13:52 PST 2012
On 8/03/2012 5:05 PM, David Holmes wrote:
> <I added a subject line >
>
> On 8/03/2012 4:57 PM, Le Huy wrote:
>> Can some one explain me why in stacktrace of hotspot I see a thread
>> blocked without any information about lock record by mean what is
>> blocking it.
>>
>> e.g.
>>
>> ---
>>
>> 3 "ajp-0.0.0.0-8029-1082" daemon prio=10 tid=0x63721000 nid=0x2cba
>> waiting for monitor entry [0x4e619000]
>> 4 java.lang.Thread.State: BLOCKED (on object monitor)
>> 5 at java.lang.Class.forName0(Native Method)
>
> Most likely the forName call is triggering class initialization and the
> thread is blocked on the monitor used to guard that (it is not a monitor
> associated with a Java level object hence no information in the
> stacktrace). Check if another thread is executing in the <clinit> for
> that class.
Nope it's note that case. When that happens the thread blocks in wait()
on the monitor eg:
"Thread-0" prio=6 tid=0x1807ac00 nid=0x1b64 in Object.wait() [0x189ff000]
java.lang.Thread.State: RUNNABLE
at ClinitBlock$Test$1.run(ClinitBlock.java:7)
There is a very narrow window of time where it would actually block
acquiring the monitor.
David
-----
> David Holmes
> -----------
>
>> 6 at java.lang.Class.forName(Class.java:186)
>> 7 at
>> com.my.security.SecurityMethodInterceptor$Rule.isAllowed(SecurityMethodInterceptor.java:102)
>>
>> 8 at
>> com.my.security.SecurityMethodInterceptor.isAllowed(SecurityMethodInterceptor.java:163)
>>
>> 9 at
>> com.my.security.SecurityMethodInterceptor.invoke(SecurityMethodInterceptor.java:140)
>>
>> 10 at
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>
>> 11 at
>> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>
>> 12 at
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>
>> 13 at
>> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>>
>> 14 at $Proxy53.setPINValidated(Unknown Source)
>> 15 at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
>> 16 at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> 17 at java.lang.reflect.Method.invoke(Method.java:616)
>> 18 at
>> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
>>
>> 19 at
>> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
>>
>> 20 at
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
>>
>> 21 at
>> org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>>
>> 22 at
>> org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>>
>> 23 at
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>
>> 24 at
>> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>>
>> ...
>> removed because it is not relevant
>> ---
>>
>> Huy
More information about the hotspot-dev
mailing list