Array length: behaves like a metadata or a field?

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Alex Otenko
If you can’t catch it, you can’t observe it wasn’t thrown.

Alex

On 30 Mar 2017, at 09:41, Viktor Klang <[hidden email]> wrote:



On Thu, Mar 30, 2017 at 10:33 AM, Alex Otenko <[hidden email]> wrote:
JVM spec allows for undefined behaviour.

Yes—otherwise there wouldn't be a need to crash it ;-)
 
They don’t have to throw SOE or OOME. 

 
People shouldn’t catch all Throwables, if they want JVM to crash.

Absolutely agreed—problem is that they do. All over the place. OOMEs and SOEs can be thrown virtually everywhere, which means that if they are triggered under a "catch( Throwable t) { /* yolo */ }" the JVM will keep on chugging along but with unknown internal damage.

Personally, I love this part of the java.lang.Error javadoc:

«An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.»

With 20/20 hindsight, perhaps catch should operate, not on Throwable but rather on Catchable—and some Throwables should never have been Catchable.



Alex


On 30 Mar 2017, at 09:08, Viktor Klang <[hidden email]> wrote:

IMO, Errors which may leave the JVM in an inconsistent state should always crash the JVM hard.

On Thu, Mar 30, 2017 at 9:18 AM, Alex Otenko <[hidden email]> wrote:
The holder may have moved on. Watch for stack overflows in history. When hard errors occur, the behaviour of the JVM is not guaranteed, and stack unwinding can miss finally statements, thus miss lock releases.

Alex

> On 30 Mar 2017, at 06:28, Gang Yan <[hidden email]> wrote:
>
> Hi all:
>
> I have a problem:
>
> 75 threads wait same lock, but not found hold lock thread from thread dump. someone recommend add option" -XX:+PrintConcurrentLocks" but affect performance. How to find out who hold lock ?
>
> "[STUCK] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'" id=571 idx=0x2f8 tid=19406 prio=1 alive, parked, native_blocked, daemon
>         -- Parking to wait for: java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync@0x8646d730
>         at jrockit/vm/Locks.park0(J)V(Native Method)
>         at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
>         at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
>         at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:941)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1261)[inlined]
>         at java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:695)[optimized]
>         at oracle/security/jps/az/common/util/JpsLock.lock(JpsLock.java:81)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:850)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:810)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getGrantedAppRoles(PolicyUtil.java:3042)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1977)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1922)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:152)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:143)
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:254)[inlined]
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:268)[optimized]
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.getAppRoles(SubjectResolverComputor.java:143)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.compute(SubjectResolverComputor.java:123)
>         at oracle/security/jps/internal/core/util/SubjectResolverCacheImpl.computeJpsSubject(SubjectResolverCacheImpl.java:207)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.computeJpsSubject(PDPServiceImpl.java:2396)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveJpsSubject(JpsAbsSubjectResolver.java:216)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveSubject(JpsAbsSubjectResolver.java:175)
>         at oracle/security/jps/ee/ejb/JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:123)
>         at oracle/security/jps/ee/ejb/JpsInterceptor.intercept(JpsInterceptor.java:113)
>         at sun/reflect/GeneratedMethodAccessor1293.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
>         at sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[optimized]
>         at java/lang/reflect/Method.invoke(Method.java:597)[optimized]
>         at com/bea/core/repackaged/springframework/aop/support/AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
>         at com/oracle/pitchfork/intercept/JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/oracle/pitchfork/spi/MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
>        at weblogic/ejb/container/injection/EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
>         at com/oracle/pitchfork/spi/EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/interceptor/ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/framework/JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>         at com/sun/proxy/$Proxy344.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.__WL_invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source)
>         at weblogic/ejb/container/internal/SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi/spi/OutboundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(Unknown Source)
>         at weblogic/rmi/internal/BasicServerRef.invoke(BasicServerRef.java:674)[optimized]
>         at weblogic/rmi/cluster/ClusterableServerRef.invoke(ClusterableServerRef.java:230)
>         at weblogic/rmi/internal/BasicServerRef$1.run(BasicServerRef.java:526)[inlined]
>         at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)[inlined]
>         at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:146)[inlined]
>         at weblogic/rmi/internal/BasicServerRef.handleRequest(BasicServerRef.java:523)[inlined]
>         at weblogic/rmi/internal/wls/WLSExecuteRequest.run(WLSExecuteRequest.java:118)[optimized]
>         at weblogic/work/ExecuteThread.execute(ExecuteThread.java:268)[optimized]
>         at weblogic/work/ExecuteThread.run(ExecuteThread.java:226)
>         at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest



-- 
Cheers,




-- 
Cheers,


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

David Holmes-6
In reply to this post by Alex Otenko
Alex Otenko writes:
>
> The holder may have moved on. Watch for stack overflows in history. When
> hard errors occur, the behaviour of the JVM is not guaranteed, and stack
> unwinding can miss finally statements, thus miss lock releases.

The VM may abort but I'm not aware of any case where stack unwinding will miss finally statements. Of course statements in finally blocks can generate secondary exceptions.

David
-------
 

> Alex
>
> > On 30 Mar 2017, at 06:28, Gang Yan <[hidden email]> wrote:
> >
> > Hi all:
> >
> > I have a problem:
> >
> > 75 threads wait same lock, but not found hold lock thread from thread
> dump. someone recommend add option" -XX:+PrintConcurrentLocks" but
> affect performance. How to find out who hold lock ?
> >
> > "[STUCK] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-
> tuning)'" id=571 idx=0x2f8 tid=19406 prio=1 alive, parked, native_blocked,
> daemon
> >         -- Parking to wait for:
> java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync@0x8646d7
> 30
> >         at jrockit/vm/Locks.park0(J)V(Native Method)
> >         at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
> >         at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
> >         at
> java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
> >         at
> java/util/concurrent/locks/AbstractQueuedSynchronizer.parkAndCheckInter
> rupt(AbstractQueuedSynchronizer.java:811)[inlined]
> >         at
> java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireShared(A
> bstractQueuedSynchronizer.java:941)[inlined]
> >         at
> java/util/concurrent/locks/AbstractQueuedSynchronizer.acquireShared(Abst
> ractQueuedSynchronizer.java:1261)[inlined]
> >         at
> java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.lock(Reentra
> ntReadWriteLock.java:695)[optimized]
> >         at oracle/security/jps/az/common/util/JpsLock.lock(JpsLock.java:81)
> >         at
> oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicati
> onPolicy(PDPServiceImpl.java:850)
> >         at
> oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicati
> onPolicy(PDPServiceImpl.java:810)
> >         at
> oracle/security/jps/internal/policystore/PolicyUtil.getGrantedAppRoles(Polic
> yUtil.java:3042)
> >         at
> oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.
> java:1977)
> >         at
> oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.
> java:1922)
> >         at
> oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(Subj
> ectResolverComputor.java:152)
> >         at
> oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(Subj
> ectResolverComputor.java:143)
> >         at
> jrockit/vm/AccessController.doPrivileged(AccessController.java:254)[inlined]
> >         at
> jrockit/vm/AccessController.doPrivileged(AccessController.java:268)[optimiz
> ed]
> >         at
> oracle/security/jps/internal/core/util/SubjectResolverComputor.getAppRole
> s(SubjectResolverComputor.java:143)
> >         at
> oracle/security/jps/internal/core/util/SubjectResolverComputor.compute(S
> ubjectResolverComputor.java:123)
> >         at
> oracle/security/jps/internal/core/util/SubjectResolverCacheImpl.computeJp
> sSubject(SubjectResolverCacheImpl.java:207)
> >         at
> oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.computeJp
> sSubject(PDPServiceImpl.java:2396)
> >         at
> oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveJpsSubject(J
> psAbsSubjectResolver.java:216)
> >         at
> oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveSubject(Jps
> AbsSubjectResolver.java:175)
> >         at
> oracle/security/jps/ee/ejb/JpsAbsInterceptor.intercept(JpsAbsInterceptor.j
> ava:123)
> >         at
> oracle/security/jps/ee/ejb/JpsInterceptor.intercept(JpsInterceptor.java:113
> )
> >         at
> sun/reflect/GeneratedMethodAccessor1293.invoke(Ljava/lang/Object;[Ljav
> a/lang/Object;)Ljava/lang/Object;(Unknown Source)
> >         at
> sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)[optimized]
> >         at java/lang/reflect/Method.invoke(Method.java:597)[optimized]
> >         at
> com/bea/core/repackaged/springframework/aop/support/AopUtils.invokeJ
> oinpointUsingReflection(AopUtils.java:310)
> >         at
> com/oracle/pitchfork/intercept/JeeInterceptorInterceptor.invoke(JeeInterc
> eptorInterceptor.java:68)
> >         at
> com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
> thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >         at
> com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
> uctionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
> >         at
> com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
> uctionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
> >         at
> com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
> thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >         at
> com/oracle/pitchfork/spi/MethodInvocationVisitorImpl.visit(MethodInvocati
> onVisitorImpl.java:34)
> >        at
> weblogic/ejb/container/injection/EnvironmentInterceptorCallbackImpl.callb
> ack(EnvironmentInterceptorCallbackImpl.java:54)
> >         at
> com/oracle/pitchfork/spi/EnvironmentInterceptor.invoke(EnvironmentInter
> ceptor.java:42)
> >         at
> com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
> thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >         at
> com/bea/core/repackaged/springframework/aop/interceptor/ExposeInvoca
> tionInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >         at
> com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
> thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >         at
> com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
> uctionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
> >         at
> com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
> uctionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
> >         at
> com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
> thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >         at
> com/bea/core/repackaged/springframework/aop/framework/JdkDynamicA
> opProxy.invoke(JdkDynamicAopProxy.java:204)
> >         at
> com/sun/proxy/$Proxy344.destroyWorkflowContext(Loracle/bpel/services/
> workflow/verification/IWorkflowContext;)V(Unknown Source)
> >         at
> oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImp
> l.__WL_invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(U
> nknown Source)
> >         at
> weblogic/ejb/container/internal/SessionRemoteMethodInvoker.invoke(Ses
> sionRemoteMethodInvoker.java:40)
> >         at
> oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImp
> l.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWo
> rkflowContext;)V(Unknown Source)
> >         at
> oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImp
> l_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi/spi/Out
> boundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(
> Unknown Source)
> >         at
> weblogic/rmi/internal/BasicServerRef.invoke(BasicServerRef.java:674)[opti
> mized]
> >         at
> weblogic/rmi/cluster/ClusterableServerRef.invoke(ClusterableServerRef.jav
> a:230)
> >         at
> weblogic/rmi/internal/BasicServerRef$1.run(BasicServerRef.java:526)[inlined
> ]
> >         at
> weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSu
> bject.java:363)[inlined]
> >         at
> weblogic/security/service/SecurityManager.runAs(SecurityManager.java:146
> )[inlined]
> >         at
> weblogic/rmi/internal/BasicServerRef.handleRequest(BasicServerRef.java:52
> 3)[inlined]
> >         at
> weblogic/rmi/internal/wls/WLSExecuteRequest.run(WLSExecuteRequest.jav
> a:118)[optimized]
> >         at
> weblogic/work/ExecuteThread.execute(ExecuteThread.java:268)[optimized]
> >         at weblogic/work/ExecuteThread.run(ExecuteThread.java:226)
> >         at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
> > _______________________________________________
> > Concurrency-interest mailing list
> > [hidden email]
> > http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Alex Otenko
Right. I never dug to the exact cause, but Lock.unlock() in finally surely can hit SOE while recovering from SOE.


Alex


On 30 Mar 2017, at 10:00, David Holmes <[hidden email]> wrote:

Alex Otenko writes:

The holder may have moved on. Watch for stack overflows in history. When
hard errors occur, the behaviour of the JVM is not guaranteed, and stack
unwinding can miss finally statements, thus miss lock releases.

The VM may abort but I'm not aware of any case where stack unwinding will miss finally statements. Of course statements in finally blocks can generate secondary exceptions.

David
-------

Alex

On 30 Mar 2017, at 06:28, Gang Yan <[hidden email]> wrote:

Hi all:

I have a problem:

75 threads wait same lock, but not found hold lock thread from thread
dump. someone recommend add option" -XX:+PrintConcurrentLocks" but
affect performance. How to find out who hold lock ?

"[STUCK] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-
tuning)'" id=571 idx=0x2f8 tid=19406 prio=1 alive, parked, native_blocked,
daemon
       -- Parking to wait for:
java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync@0x8646d7
30
       at jrockit/vm/Locks.park0(J)V(Native Method)
       at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
       at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
       at
java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
       at
java/util/concurrent/locks/AbstractQueuedSynchronizer.parkAndCheckInter
rupt(AbstractQueuedSynchronizer.java:811)[inlined]
       at
java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireShared(A
bstractQueuedSynchronizer.java:941)[inlined]
       at
java/util/concurrent/locks/AbstractQueuedSynchronizer.acquireShared(Abst
ractQueuedSynchronizer.java:1261)[inlined]
       at
java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.lock(Reentra
ntReadWriteLock.java:695)[optimized]
       at oracle/security/jps/az/common/util/JpsLock.lock(JpsLock.java:81)
       at
oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicati
onPolicy(PDPServiceImpl.java:850)
       at
oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicati
onPolicy(PDPServiceImpl.java:810)
       at
oracle/security/jps/internal/policystore/PolicyUtil.getGrantedAppRoles(Polic
yUtil.java:3042)
       at
oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.
java:1977)
       at
oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.
java:1922)
       at
oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(Subj
ectResolverComputor.java:152)
       at
oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(Subj
ectResolverComputor.java:143)
       at
jrockit/vm/AccessController.doPrivileged(AccessController.java:254)[inlined]
       at
jrockit/vm/AccessController.doPrivileged(AccessController.java:268)[optimiz
ed]
       at
oracle/security/jps/internal/core/util/SubjectResolverComputor.getAppRole
s(SubjectResolverComputor.java:143)
       at
oracle/security/jps/internal/core/util/SubjectResolverComputor.compute(S
ubjectResolverComputor.java:123)
       at
oracle/security/jps/internal/core/util/SubjectResolverCacheImpl.computeJp
sSubject(SubjectResolverCacheImpl.java:207)
       at
oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.computeJp
sSubject(PDPServiceImpl.java:2396)
       at
oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveJpsSubject(J
psAbsSubjectResolver.java:216)
       at
oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveSubject(Jps
AbsSubjectResolver.java:175)
       at
oracle/security/jps/ee/ejb/JpsAbsInterceptor.intercept(JpsAbsInterceptor.j
ava:123)
       at
oracle/security/jps/ee/ejb/JpsInterceptor.intercept(JpsInterceptor.java:113
)
       at
sun/reflect/GeneratedMethodAccessor1293.invoke(Ljava/lang/Object;[Ljav
a/lang/Object;)Ljava/lang/Object;(Unknown Source)
       at
sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)[optimized]
       at java/lang/reflect/Method.invoke(Method.java:597)[optimized]
       at
com/bea/core/repackaged/springframework/aop/support/AopUtils.invokeJ
oinpointUsingReflection(AopUtils.java:310)
       at
com/oracle/pitchfork/intercept/JeeInterceptorInterceptor.invoke(JeeInterc
eptorInterceptor.java:68)
       at
com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
uctionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
       at
com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
uctionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
       at
com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
com/oracle/pitchfork/spi/MethodInvocationVisitorImpl.visit(MethodInvocati
onVisitorImpl.java:34)
      at
weblogic/ejb/container/injection/EnvironmentInterceptorCallbackImpl.callb
ack(EnvironmentInterceptorCallbackImpl.java:54)
       at
com/oracle/pitchfork/spi/EnvironmentInterceptor.invoke(EnvironmentInter
ceptor.java:42)
       at
com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
com/bea/core/repackaged/springframework/aop/interceptor/ExposeInvoca
tionInterceptor.invoke(ExposeInvocationInterceptor.java:89)
       at
com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
uctionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
       at
com/bea/core/repackaged/springframework/aop/support/DelegatingIntrod
uctionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
       at
com/bea/core/repackaged/springframework/aop/framework/ReflectiveMe
thodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
com/bea/core/repackaged/springframework/aop/framework/JdkDynamicA
opProxy.invoke(JdkDynamicAopProxy.java:204)
       at
com/sun/proxy/$Proxy344.destroyWorkflowContext(Loracle/bpel/services/
workflow/verification/IWorkflowContext;)V(Unknown Source)
       at
oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImp
l.__WL_invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(U
nknown Source)
       at
weblogic/ejb/container/internal/SessionRemoteMethodInvoker.invoke(Ses
sionRemoteMethodInvoker.java:40)
       at
oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImp
l.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWo
rkflowContext;)V(Unknown Source)
       at
oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImp
l_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi/spi/Out
boundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(
Unknown Source)
       at
weblogic/rmi/internal/BasicServerRef.invoke(BasicServerRef.java:674)[opti
mized]
       at
weblogic/rmi/cluster/ClusterableServerRef.invoke(ClusterableServerRef.jav
a:230)
       at
weblogic/rmi/internal/BasicServerRef$1.run(BasicServerRef.java:526)[inlined
]
       at
weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSu
bject.java:363)[inlined]
       at
weblogic/security/service/SecurityManager.runAs(SecurityManager.java:146
)[inlined]
       at
weblogic/rmi/internal/BasicServerRef.handleRequest(BasicServerRef.java:52
3)[inlined]
       at
weblogic/rmi/internal/wls/WLSExecuteRequest.run(WLSExecuteRequest.jav
a:118)[optimized]
       at
weblogic/work/ExecuteThread.execute(ExecuteThread.java:268)[optimized]
       at weblogic/work/ExecuteThread.run(ExecuteThread.java:226)
       at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Andrew Haley
On 30/03/17 10:12, Alex Otenko wrote:
> Right. I never dug to the exact cause, but Lock.unlock() in finally surely can hit SOE while recovering from SOE.

Should be fixed:

https://bugs.openjdk.java.net/browse/JDK-8046936

Andrew.

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Viktor Klang
In reply to this post by Alex Otenko
Of course you can--outside of the program.
Throwing something that thr JVM can catch, log and exit abnormally is much cleaner than relying on all previous stack frames to behave well. ^^

--
Cheers,

On Mar 30, 2017 10:53, "Alex Otenko" <[hidden email]> wrote:
If you can’t catch it, you can’t observe it wasn’t thrown.

Alex

On 30 Mar 2017, at 09:41, Viktor Klang <[hidden email]> wrote:



On Thu, Mar 30, 2017 at 10:33 AM, Alex Otenko <[hidden email]> wrote:
JVM spec allows for undefined behaviour.

Yes—otherwise there wouldn't be a need to crash it ;-)
 
They don’t have to throw SOE or OOME. 

 
People shouldn’t catch all Throwables, if they want JVM to crash.

Absolutely agreed—problem is that they do. All over the place. OOMEs and SOEs can be thrown virtually everywhere, which means that if they are triggered under a "catch( Throwable t) { /* yolo */ }" the JVM will keep on chugging along but with unknown internal damage.

Personally, I love this part of the java.lang.Error javadoc:

«An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.»

With 20/20 hindsight, perhaps catch should operate, not on Throwable but rather on Catchable—and some Throwables should never have been Catchable.



Alex


On 30 Mar 2017, at 09:08, Viktor Klang <[hidden email]> wrote:

IMO, Errors which may leave the JVM in an inconsistent state should always crash the JVM hard.

On Thu, Mar 30, 2017 at 9:18 AM, Alex Otenko <[hidden email]> wrote:
The holder may have moved on. Watch for stack overflows in history. When hard errors occur, the behaviour of the JVM is not guaranteed, and stack unwinding can miss finally statements, thus miss lock releases.

Alex

> On 30 Mar 2017, at 06:28, Gang Yan <[hidden email]> wrote:
>
> Hi all:
>
> I have a problem:
>
> 75 threads wait same lock, but not found hold lock thread from thread dump. someone recommend add option" -XX:+PrintConcurrentLocks" but affect performance. How to find out who hold lock ?
>
> "[STUCK] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'" id=571 idx=0x2f8 tid=19406 prio=1 alive, parked, native_blocked, daemon
>         -- Parking to wait for: java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync@0x8646d730
>         at jrockit/vm/Locks.park0(J)V(Native Method)
>         at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
>         at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
>         at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:941)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1261)[inlined]
>         at java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:695)[optimized]
>         at oracle/security/jps/az/common/util/JpsLock.lock(JpsLock.java:81)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:850)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:810)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getGrantedAppRoles(PolicyUtil.java:3042)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1977)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1922)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:152)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:143)
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:254)[inlined]
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:268)[optimized]
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.getAppRoles(SubjectResolverComputor.java:143)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.compute(SubjectResolverComputor.java:123)
>         at oracle/security/jps/internal/core/util/SubjectResolverCacheImpl.computeJpsSubject(SubjectResolverCacheImpl.java:207)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.computeJpsSubject(PDPServiceImpl.java:2396)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveJpsSubject(JpsAbsSubjectResolver.java:216)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveSubject(JpsAbsSubjectResolver.java:175)
>         at oracle/security/jps/ee/ejb/JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:123)
>         at oracle/security/jps/ee/ejb/JpsInterceptor.intercept(JpsInterceptor.java:113)
>         at sun/reflect/GeneratedMethodAccessor1293.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
>         at sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[optimized]
>         at java/lang/reflect/Method.invoke(Method.java:597)[optimized]
>         at com/bea/core/repackaged/springframework/aop/support/AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
>         at com/oracle/pitchfork/intercept/JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/oracle/pitchfork/spi/MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
>        at weblogic/ejb/container/injection/EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
>         at com/oracle/pitchfork/spi/EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/interceptor/ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/framework/JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>         at com/sun/proxy/$Proxy344.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.__WL_invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source)
>         at weblogic/ejb/container/internal/SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi/spi/OutboundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(Unknown Source)
>         at weblogic/rmi/internal/BasicServerRef.invoke(BasicServerRef.java:674)[optimized]
>         at weblogic/rmi/cluster/ClusterableServerRef.invoke(ClusterableServerRef.java:230)
>         at weblogic/rmi/internal/BasicServerRef$1.run(BasicServerRef.java:526)[inlined]
>         at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)[inlined]
>         at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:146)[inlined]
>         at weblogic/rmi/internal/BasicServerRef.handleRequest(BasicServerRef.java:523)[inlined]
>         at weblogic/rmi/internal/wls/WLSExecuteRequest.run(WLSExecuteRequest.java:118)[optimized]
>         at weblogic/work/ExecuteThread.execute(ExecuteThread.java:268)[optimized]
>         at weblogic/work/ExecuteThread.run(ExecuteThread.java:226)
>         at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest



-- 
Cheers,




-- 
Cheers,


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Alex Otenko
Some JVMs offer command-line arguments to behave like that.

Alex

On 30 Mar 2017, at 11:23, Viktor Klang <[hidden email]> wrote:

Of course you can--outside of the program.
Throwing something that thr JVM can catch, log and exit abnormally is much cleaner than relying on all previous stack frames to behave well. ^^

--
Cheers,

On Mar 30, 2017 10:53, "Alex Otenko" <[hidden email]> wrote:
If you can’t catch it, you can’t observe it wasn’t thrown.

Alex

On 30 Mar 2017, at 09:41, Viktor Klang <[hidden email]> wrote:



On Thu, Mar 30, 2017 at 10:33 AM, Alex Otenko <[hidden email]> wrote:
JVM spec allows for undefined behaviour.

Yes—otherwise there wouldn't be a need to crash it ;-)
 
They don’t have to throw SOE or OOME. 

 
People shouldn’t catch all Throwables, if they want JVM to crash.

Absolutely agreed—problem is that they do. All over the place. OOMEs and SOEs can be thrown virtually everywhere, which means that if they are triggered under a "catch( Throwable t) { /* yolo */ }" the JVM will keep on chugging along but with unknown internal damage.

Personally, I love this part of the java.lang.Error javadoc:

«An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.»

With 20/20 hindsight, perhaps catch should operate, not on Throwable but rather on Catchable—and some Throwables should never have been Catchable.



Alex


On 30 Mar 2017, at 09:08, Viktor Klang <[hidden email]> wrote:

IMO, Errors which may leave the JVM in an inconsistent state should always crash the JVM hard.

On Thu, Mar 30, 2017 at 9:18 AM, Alex Otenko <[hidden email]> wrote:
The holder may have moved on. Watch for stack overflows in history. When hard errors occur, the behaviour of the JVM is not guaranteed, and stack unwinding can miss finally statements, thus miss lock releases.

Alex

> On 30 Mar 2017, at 06:28, Gang Yan <[hidden email]> wrote:
>
> Hi all:
>
> I have a problem:
>
> 75 threads wait same lock, but not found hold lock thread from thread dump. someone recommend add option" -XX:+PrintConcurrentLocks" but affect performance. How to find out who hold lock ?
>
> "[STUCK] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'" id=571 idx=0x2f8 tid=19406 prio=1 alive, parked, native_blocked, daemon
>         -- Parking to wait for: java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync@0x8646d730
>         at jrockit/vm/Locks.park0(J)V(Native Method)
>         at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
>         at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
>         at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:941)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1261)[inlined]
>         at java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:695)[optimized]
>         at oracle/security/jps/az/common/util/JpsLock.lock(JpsLock.java:81)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:850)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:810)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getGrantedAppRoles(PolicyUtil.java:3042)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1977)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1922)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:152)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:143)
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:254)[inlined]
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:268)[optimized]
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.getAppRoles(SubjectResolverComputor.java:143)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.compute(SubjectResolverComputor.java:123)
>         at oracle/security/jps/internal/core/util/SubjectResolverCacheImpl.computeJpsSubject(SubjectResolverCacheImpl.java:207)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.computeJpsSubject(PDPServiceImpl.java:2396)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveJpsSubject(JpsAbsSubjectResolver.java:216)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveSubject(JpsAbsSubjectResolver.java:175)
>         at oracle/security/jps/ee/ejb/JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:123)
>         at oracle/security/jps/ee/ejb/JpsInterceptor.intercept(JpsInterceptor.java:113)
>         at sun/reflect/GeneratedMethodAccessor1293.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
>         at sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[optimized]
>         at java/lang/reflect/Method.invoke(Method.java:597)[optimized]
>         at com/bea/core/repackaged/springframework/aop/support/AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
>         at com/oracle/pitchfork/intercept/JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/oracle/pitchfork/spi/MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
>        at weblogic/ejb/container/injection/EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
>         at com/oracle/pitchfork/spi/EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/interceptor/ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/framework/JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>         at com/sun/proxy/$Proxy344.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.__WL_invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source)
>         at weblogic/ejb/container/internal/SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi/spi/OutboundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(Unknown Source)
>         at weblogic/rmi/internal/BasicServerRef.invoke(BasicServerRef.java:674)[optimized]
>         at weblogic/rmi/cluster/ClusterableServerRef.invoke(ClusterableServerRef.java:230)
>         at weblogic/rmi/internal/BasicServerRef$1.run(BasicServerRef.java:526)[inlined]
>         at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)[inlined]
>         at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:146)[inlined]
>         at weblogic/rmi/internal/BasicServerRef.handleRequest(BasicServerRef.java:523)[inlined]
>         at weblogic/rmi/internal/wls/WLSExecuteRequest.run(WLSExecuteRequest.java:118)[optimized]
>         at weblogic/work/ExecuteThread.execute(ExecuteThread.java:268)[optimized]
>         at weblogic/work/ExecuteThread.run(ExecuteThread.java:226)
>         at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest



-- 
Cheers,




-- 
Cheers,



_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Viktor Klang
Yes, but as you say, it is jvm-specific and not something which can be encoded as program behavior.

--
Cheers,

On Mar 30, 2017 12:26, "Alex Otenko" <[hidden email]> wrote:
Some JVMs offer command-line arguments to behave like that.

Alex

On 30 Mar 2017, at 11:23, Viktor Klang <[hidden email]> wrote:

Of course you can--outside of the program.
Throwing something that thr JVM can catch, log and exit abnormally is much cleaner than relying on all previous stack frames to behave well. ^^

--
Cheers,

On Mar 30, 2017 10:53, "Alex Otenko" <[hidden email]> wrote:
If you can’t catch it, you can’t observe it wasn’t thrown.

Alex

On 30 Mar 2017, at 09:41, Viktor Klang <[hidden email]> wrote:



On Thu, Mar 30, 2017 at 10:33 AM, Alex Otenko <[hidden email]> wrote:
JVM spec allows for undefined behaviour.

Yes—otherwise there wouldn't be a need to crash it ;-)
 
They don’t have to throw SOE or OOME. 

 
People shouldn’t catch all Throwables, if they want JVM to crash.

Absolutely agreed—problem is that they do. All over the place. OOMEs and SOEs can be thrown virtually everywhere, which means that if they are triggered under a "catch( Throwable t) { /* yolo */ }" the JVM will keep on chugging along but with unknown internal damage.

Personally, I love this part of the java.lang.Error javadoc:

«An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.»

With 20/20 hindsight, perhaps catch should operate, not on Throwable but rather on Catchable—and some Throwables should never have been Catchable.



Alex


On 30 Mar 2017, at 09:08, Viktor Klang <[hidden email]> wrote:

IMO, Errors which may leave the JVM in an inconsistent state should always crash the JVM hard.

On Thu, Mar 30, 2017 at 9:18 AM, Alex Otenko <[hidden email]> wrote:
The holder may have moved on. Watch for stack overflows in history. When hard errors occur, the behaviour of the JVM is not guaranteed, and stack unwinding can miss finally statements, thus miss lock releases.

Alex

> On 30 Mar 2017, at 06:28, Gang Yan <[hidden email]> wrote:
>
> Hi all:
>
> I have a problem:
>
> 75 threads wait same lock, but not found hold lock thread from thread dump. someone recommend add option" -XX:+PrintConcurrentLocks" but affect performance. How to find out who hold lock ?
>
> "[STUCK] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'" id=571 idx=0x2f8 tid=19406 prio=1 alive, parked, native_blocked, daemon
>         -- Parking to wait for: java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync@0x8646d730
>         at jrockit/vm/Locks.park0(J)V(Native Method)
>         at jrockit/vm/Locks.park(Locks.java:2230)[inlined]
>         at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined]
>         at java/util/concurrent/locks/LockSupport.park(LockSupport.java:156)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:941)[inlined]
>         at java/util/concurrent/locks/AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1261)[inlined]
>         at java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:695)[optimized]
>         at oracle/security/jps/az/common/util/JpsLock.lock(JpsLock.java:81)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:850)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.getApplicationPolicy(PDPServiceImpl.java:810)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getGrantedAppRoles(PolicyUtil.java:3042)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1977)
>         at oracle/security/jps/internal/policystore/PolicyUtil.getJpsAppRoles(PolicyUtil.java:1922)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:152)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor$1.run(SubjectResolverComputor.java:143)
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:254)[inlined]
>         at jrockit/vm/AccessController.doPrivileged(AccessController.java:268)[optimized]
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.getAppRoles(SubjectResolverComputor.java:143)
>         at oracle/security/jps/internal/core/util/SubjectResolverComputor.compute(SubjectResolverComputor.java:123)
>         at oracle/security/jps/internal/core/util/SubjectResolverCacheImpl.computeJpsSubject(SubjectResolverCacheImpl.java:207)
>         at oracle/security/jps/az/internal/runtime/service/PDPServiceImpl.computeJpsSubject(PDPServiceImpl.java:2396)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveJpsSubject(JpsAbsSubjectResolver.java:216)
>         at oracle/security/jps/internal/jaas/JpsAbsSubjectResolver.resolveSubject(JpsAbsSubjectResolver.java:175)
>         at oracle/security/jps/ee/ejb/JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:123)
>         at oracle/security/jps/ee/ejb/JpsInterceptor.intercept(JpsInterceptor.java:113)
>         at sun/reflect/GeneratedMethodAccessor1293.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
>         at sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[optimized]
>         at java/lang/reflect/Method.invoke(Method.java:597)[optimized]
>         at com/bea/core/repackaged/springframework/aop/support/AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
>         at com/oracle/pitchfork/intercept/JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/oracle/pitchfork/spi/MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
>        at weblogic/ejb/container/injection/EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
>         at com/oracle/pitchfork/spi/EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/interceptor/ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
>         at com/bea/core/repackaged/springframework/aop/support/DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
>         at com/bea/core/repackaged/springframework/aop/framework/ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at com/bea/core/repackaged/springframework/aop/framework/JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>         at com/sun/proxy/$Proxy344.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.__WL_invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source)
>         at weblogic/ejb/container/internal/SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl.destroyWorkflowContext(Loracle/bpel/services/workflow/verification/IWorkflowContext;)V(Unknown Source)
>         at oracle/bpel/services/workflow/query/ejb/TaskQueryService_oz1ipg_EOImpl_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi/spi/OutboundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(Unknown Source)
>         at weblogic/rmi/internal/BasicServerRef.invoke(BasicServerRef.java:674)[optimized]
>         at weblogic/rmi/cluster/ClusterableServerRef.invoke(ClusterableServerRef.java:230)
>         at weblogic/rmi/internal/BasicServerRef$1.run(BasicServerRef.java:526)[inlined]
>         at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)[inlined]
>         at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:146)[inlined]
>         at weblogic/rmi/internal/BasicServerRef.handleRequest(BasicServerRef.java:523)[inlined]
>         at weblogic/rmi/internal/wls/WLSExecuteRequest.run(WLSExecuteRequest.java:118)[optimized]
>         at weblogic/work/ExecuteThread.execute(ExecuteThread.java:268)[optimized]
>         at weblogic/work/ExecuteThread.run(ExecuteThread.java:226)
>         at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest



-- 
Cheers,




-- 
Cheers,



_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Justin Sampson
In reply to this post by Andrew Haley
Ooh, neat! I had asked this list whether something like that would be possible, right around the same time that issue was filed, and there was some heated debate around it:

http://cs.oswego.edu/pipermail/concurrency-interest/2015-January/thread.html#13864

Exciting to see progress. :)

Cheers,
Justin


On 3/30/17, 3:19 AM, "Concurrency-interest on behalf of Andrew Haley" <[hidden email] on behalf of [hidden email]> wrote:

    On 30/03/17 10:12, Alex Otenko wrote:
    > Right. I never dug to the exact cause, but Lock.unlock() in finally surely can hit SOE while recovering from SOE.
   
    Should be fixed:
   
    https://bugs.openjdk.java.net/browse/JDK-8046936
   
    Andrew.
 

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Andrew Haley
On 30/03/17 17:59, Justin Sampson wrote:
> Ooh, neat! I had asked this list whether something like that would be possible, right around the same time that issue was filed, and there was some heated debate around it:
>
> http://cs.oswego.edu/pipermail/concurrency-interest/2015-January/thread.html#13864
>
> Exciting to see progress. :)

It's better, but still flaky.

http://mail.openjdk.java.net/pipermail/hotspot-dev/2017-January/025728.html

Andrew.

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Justin Sampson
And apparently it doesn't work on Windows yet:

https://bugs.openjdk.java.net/browse/JDK-8067946

Details, details.

-Justin


On 3/30/17, 10:18 AM, "Andrew Haley" <[hidden email]> wrote:

    On 30/03/17 17:59, Justin Sampson wrote:
    > Ooh, neat! I had asked this list whether something like that would be possible, right around the same time that issue was filed, and there was some heated debate around it:
    >
    > http://cs.oswego.edu/pipermail/concurrency-interest/2015-January/thread.html#13864
    >
    > Exciting to see progress. :)
   
    It's better, but still flaky.
   
    http://mail.openjdk.java.net/pipermail/hotspot-dev/2017-January/025728.html
   
    Andrew.
   
   

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: hold lock thread in thread dump

Andrew Haley
On 30/03/17 18:30, Justin Sampson wrote:
> And apparently it doesn't work on Windows yet:
>
> https://bugs.openjdk.java.net/browse/JDK-8067946
>
> Details, details.

Well, it doesn't really work anywhere if the protected method happens
to be inlined, which it often will be.  The test case in the HotSpot
testsuite solves the problem in a very nice way by disabling inlining.

Andrew.

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
12