JDK-6585429 : LoggerTraceListener causes infinite loop under some circumstances
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-07-25
  • Updated: 2011-01-27
  • Resolved: 2010-07-06
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
6u10Fixed 7 betaFixed
Description
The LoggerTraceListener causes infinite loops in debugging output when the user's jre/lib/logging.properties is modified to increase the amount of output processed by the ConsoleHandler:

java.util.logging.ConsoleHandler.level = FINEST

Roughly, what happens is that some logger causes output to be printed to its implicit ConsoleHandler. The deployment code's interception of stdout and stderr in the Trace code causes this output to be handed to each TraceListener. The LoggerTraceListener receives the output and passes it to its internal Logger, which causes it to be printed to its implicit ConsoleHandler, and the process repeats.

This prevents logging from working effectively in the context of the deployment technologies (Java Web Start and the Java Plug-In) since much logging code in the Java SE workspace is sent at a lower level than the default INFO level the logging ConsoleHandler is set to.

Thanks to ###@###.### for pointing out approximately where in the code the problem was.

Comments
SUGGESTED FIX *** /tmp/geta15733 Wed Jul 25 14:43:51 2007 --- LoggerTraceListener.java Wed Jul 25 14:35:37 2007 *************** *** 24,29 **** --- 24,33 ---- // Create logger object logger = Logger.getLogger(loggerName); + // Prevent this logger from sending output to its parent handlers + // to prevent infinite loops when logging and tracing are enabled + // and java.util.logging.ConsoleHandler.level is below a certain level + logger.setUseParentHandlers(false); try { handler = new FileHandler(filename, (Config.getIntProperty(Config.MAX_SIZE_FILE_KEY) * 1048576 ), 1);
25-07-2007

EVALUATION The internal Logger object the LoggingTraceListener creates should not send its output to its parent handlers, and from there implicitly the ConsoleHandler.
25-07-2007