Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.17, 2.0.18, 2.0.19
-
None
-
Applicable to all platforms
Description
The problem occurs when we have a security manager enabled with restrictions.
After writing a request to LdapNetworkConnection, we wait for the completion of the request. For every
writeFuture.awaitUninterruptibly
it checks for deadlock DefaultIoFuture#checkDeadLock() which is code that requires security permissions and throws following exception:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect")
A proposed solution would be to ignore Java security manager exception (SME) similar to Class not found exception(CNFE). For CNFE, we ignore the exception and continue as we are just testing for deadlocks.
for (StackTraceElement s : stackTrace) { try { Class<?> cls = DefaultIoFuture.class.getClassLoader().loadClass(s.getClassName()); if (IoProcessor.class.isAssignableFrom(cls)) { throw new IllegalStateException("DEAD LOCK: " + IoFuture.class.getSimpleName() + ".await() was invoked from an I/O processor thread. " + "Please use " + IoFutureListener.class.getSimpleName() + " or configure a proper thread model alternatively."); } } catch (ClassNotFoundException cnfe) { // Ignore } }