Skip to content

com.sun.corba.ee.impl.oa.poa.POAImpl.find_POA release of readlock causes exception #241

@clintsb111

Description

@clintsb111

} finally {
if (readLocked) { readUnlock() ; } // Issue 14917: was unlock()
}

Should read

                } finally {
                    if (readLocked) { readUnlock() ; **readLocked = false ;** } // Issue 14917: was unlock()
                }

By not setting readLocked to false the cleanUpLocks call will throw the exception. Throughout the find_POA method every time a lock is released the corresponding flag is updated, except this one case.
cleanUpLocks( child, readLocked, writeLocked, childReadLocked ) ;

Example exception:

java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread
	at java.base/java.util.concurrent.locks.ReentrantReadWriteLock$Sync.unmatchedUnlockException(ReentrantReadWriteLock.java:448)
	at java.base/java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:432)
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1146)
	at java.base/java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:897)
	at com.sun.corba.ee.impl.oa.poa.POAImpl.readUnlock(POAImpl.java:388)
	at com.sun.corba.ee.impl.oa.poa.POAImpl.**cleanUpLocks**(POAImpl.java:1089)
	at com.sun.corba.ee.impl.oa.poa.POAImpl.**find_POA**(POAImpl.java:1010)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions