JDK-2164285 : Calling LogManager.addLogger() and Logger.getLogger() cause deadlock
  • Type: Backport
  • Backport of: JDK-6487638
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2008-06-24
  • Updated: 2010-05-05
  • Resolved: 2008-07-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u7-rev b08Fixed 7Fixed
Comments
EVALUATION This deadlock between two threads T1 and T2 clearly demonstrates a problem in the logging API which was in the implementation from the beginning. Thanks a lot for the testcase! The following two public methods can be called from different threads concurrently: - synchronized instance method LogManager.addLogger() - synchronized static method Logger.getLogger() T1: Locks the LogManager object, calls LogManager.addLogger() which calls Logger.getLogger() which is waiting to lock the Logger Class object. T2: Locks the Logger Class object, calls Logger.getLogger() which calls LogManager.getLogger() which is waiting to lock the LogManager object. The fix would be to disallow this cyclic dependency between the LogManager and Logger classes.
24-06-2008