United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6873605 Missing finishedDispatch() call in ORBImpl causes test failures after 5u20 b04
JDK-6873605 : Missing finishedDispatch() call in ORBImpl causes test failures after 5u20 b04

Details
Type:
Bug
Submit Date:
2009-08-19
Status:
Closed
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2009-09-21
Component:
other-libs
OS:
generic
Sub-Component:
corba:idl
CPU:
generic
Priority:
P1
Resolution:
Fixed
Affected Versions:
5.0u20-rev
Fixed Versions:
5.0u21-rev (b03)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
Following JCK tests starts to fail starting from jdk 5u20 b04:

api/org_omg/PortableServer/POA/index.html#NetDistributed
api/org_omg/PortableInterceptor/ServerRequestInfo/index.html#SIMethods
api/org_omg/PortableInterceptor/ORBInitInfo/index.html#add
api/org_omg/PortableInterceptor/ServerRequestInterceptor/index.html#distributed
api/org_omg/PortableInterceptor/ClientRequestInterceptor/index.html#exception
api/org_omg/PortableInterceptor/ServerRequestInterceptor/index.html#exception
api/javax_rmi/CORBA/Util/copyObject.html#CopyObjTests0001
api/javax_rmi/CORBA/Util/copyObjects.html#CopyObjs0001
api/javax_rmi/CORBA/Util/registerTarget.html#RegTgt0001
api/javax_rmi/PortableRemoteObject/unexportObject.html#UnexportObject0001

Tests below just hangs due to the same reason:
api/org_omg/PortableServer/POA/index.html#fromTo
api/javax_rmi/PortableRemoteObject/narrow.html#Narrow0003
api/javax_rmi/PortableRemoteObject/toStub.html#ToStub0001
api/javax_rmi/PortableRemoteObject/toStub.html#ToStub0002
api/javax_rmi/CORBA/Util/unexportObject.html#UnexObj0002
api/javax_rmi/CORBA/Util/copyObject.html#CopyObjTests0001
api/javax_rmi/CORBA/Util/copyObjects.html#CopyObjs0001
api/javax_rmi/CORBA/Util/registerTarget.html#RegTgt0001
api/javax_rmi/PortableRemoteObject/connect.html#Connect0001

Possibly this failure is connected with CR 6763340.

Tests fails with the message like:

Aug 19, 2009 7:14:26 PM com.sun.corba.se.impl.oa.poa.POAImpl destroy
WARNING: "IOP01611002: (BAD_INV_ORDER) Request to wait for POA destruction while servicing request would deadlock"
org.omg.CORBA.BAD_INV_ORDER:   vmcid: SUN  minor code: 1002  completed: No
        at com.sun.corba.se.impl.logging.POASystemException.destroyDeadlock(POASystemException.java:98)
        at com.sun.corba.se.impl.logging.POASystemException.destroyDeadlock(POASystemException.java:120)
        at com.sun.corba.se.impl.oa.poa.POAImpl.destroy(POAImpl.java:942)
        at javasoft.sqe.jck.lib.CORBATest$1.run(CORBATest.java:113)
        at javasoft.sqe.jck.lib.SecurityTestRunner.runTestWithTCKSM(SecurityTestRunner.java:278)
        at javasoft.sqe.jck.lib.SecurityTestRunner.runTestWithPermissions(SecurityTestRunner.java:235)
        at javasoft.sqe.jck.lib.SecurityTestRunner.runTestWithAllPermissions(SecurityTestRunner.java:157)
        at javasoft.sqe.jck.lib.AllPermissionSM.testRun(AllPermissionSM.java:86)
        at javasoft.sqe.jck.lib.CORBATest.invokeTestCase(CORBATest.java:129)
        at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
        at javasoft.sqe.jck.lib.CORBATest.run(CORBATest.java:69)
        at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:127)
        at javasoft.sqe.tests.api.org.omg.PortableInterceptor.ORBInitInfo.addTests.main(addTests.java:253)
Aug 19, 2009 7:14:29 PM com.sun.corba.se.impl.orb.ORBImpl shutdown
WARNING: "IOP01600003: (BAD_INV_ORDER) Operation would deadlock"
org.omg.CORBA.BAD_INV_ORDER:   vmcid: OMG  minor code: 3  completed: No
        at com.sun.corba.se.impl.logging.OMGSystemException.shutdownWaitForCompletionDeadlock(OMGSystemException.java:196)
        at com.sun.corba.se.impl.logging.OMGSystemException.shutdownWaitForCompletionDeadlock(OMGSystemException.java:218)
        at com.sun.corba.se.impl.orb.ORBImpl.shutdown(ORBImpl.java:1223)
        at javasoft.sqe.tests.api.org.omg.PortableInterceptor.ORBInitInfo.addTests.add0003(addTests.java:393)
        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:592)
        at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:399)
        at javasoft.sqe.jck.lib.CORBATest.access$001(CORBATest.java:43)
        at javasoft.sqe.jck.lib.CORBATest$1.run(CORBATest.java:100)
        at javasoft.sqe.jck.lib.SecurityTestRunner.runTestWithTCKSM(SecurityTestRunner.java:278)
        at javasoft.sqe.jck.lib.SecurityTestRunner.runTestWithPermissions(SecurityTestRunner.java:235)
        at javasoft.sqe.jck.lib.SecurityTestRunner.runTestWithAllPermissions(SecurityTestRunner.java:157)
        at javasoft.sqe.jck.lib.AllPermissionSM.testRun(AllPermissionSM.java:86)
        at javasoft.sqe.jck.lib.CORBATest.invokeTestCase(CORBATest.java:129)
        at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
        at javasoft.sqe.jck.lib.CORBATest.run(CORBATest.java:69)
        at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:127)
        at javasoft.sqe.tests.api.org.omg.PortableInterceptor.ORBInitInfo.addTests.main(addTests.java:253)

Please see comments for more information. Please see jtr files attached.

                                    

Comments
SUGGESTED FIX

src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java

    public void releaseOrDecrementInvocationInfo()
 ...
        clientInvocationInfo.decrementEntryCount();
        entryCount = clientInvocationInfo.getEntryCount();
        if (clientInvocationInfo.getEntryCount() == 0) {
            // 6763340: don't pop if this is a retry!
            if (!clientInvocationInfo.isRetryInvocation()) {
              invocationInfoStack.pop();
            }
            finishedDispatch();
        }
    }
                                     
2009-08-21
EVALUATION

What we are hitting:

// This is to avoid deadlock
if (wait_for_completion && getORB().isDuringDispatch()) {
     throw lifecycleWrapper().destroyDeadlock() ; // <--------------- 942
}

is because ORBImpl's "isDuringDispatch()" is true.  This true value
comes from the ThreadLocal isProcessingInvocation which is set true 
by startingDispatch() called from createOrIncrementInvocationInfo().

In the fix for 6763340 we have missed the corresponding call to 
finishedDispatch().
                                     
2009-08-21
SUGGESTED FIX

Note: this fix applies _after_ 6763340.
                                     
2009-09-03
EVALUATION

http://hg.openjdk.java.net/jdk7/build/corba/rev/cff5a173ec1e
                                     
2010-12-04



Hardware and Software, Engineered to Work Together