mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8314263: Signed jars triggering Logger finder recursion and StackOverflowError
Co-authored-by: Daniel Fuchs <dfuchs@openjdk.org> Reviewed-by: dfuchs
This commit is contained in:
parent
6701eba736
commit
7daae1fb42
12 changed files with 829 additions and 29 deletions
|
@ -68,6 +68,7 @@ import java.util.function.Supplier;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import jdk.internal.logger.LoggerFinderLoader.TemporaryLoggerFinder;
|
||||
import jdk.internal.misc.CarrierThreadLocal;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
import jdk.internal.util.StaticProperty;
|
||||
|
@ -1766,13 +1767,16 @@ public final class System {
|
|||
// We do not need to synchronize: LoggerFinderLoader will
|
||||
// always return the same instance, so if we don't have it,
|
||||
// just fetch it again.
|
||||
if (service == null) {
|
||||
LoggerFinder finder = service;
|
||||
if (finder == null) {
|
||||
PrivilegedAction<LoggerFinder> pa =
|
||||
() -> LoggerFinderLoader.getLoggerFinder();
|
||||
service = AccessController.doPrivileged(pa, null,
|
||||
finder = AccessController.doPrivileged(pa, null,
|
||||
LOGGERFINDER_PERMISSION);
|
||||
if (finder instanceof TemporaryLoggerFinder) return finder;
|
||||
service = finder;
|
||||
}
|
||||
return service;
|
||||
return finder;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue