Details
-
Bug
-
Resolution: Fixed
-
P3
-
8
-
None
-
b82
Description
See old NASHORN-787 in the Kenai repo and NASHORN-844:
787:
This was discovered when the various debug functions in Symbol.java used Context.getErr() instead of System.err. Sometimes there would be no output, and sometimes Nashorn would just silently exit.
I suspect this is a resource management problem with one of the streams - perhaps a try with resources closes the err stream given to Shell to early, or something.
Until this is fixed, I dare not change the new global "print stacktrace on -doe" function in Context: Context#printStackTrace(final Throwable t) to actually pass Context.getErr() as parameter to Throwable#printStackTrace instead of just using the default (System.err).
This failure can be provoked by e.g. using -Dnashorn.trace.symbol=<symbol name of existing symbol> and changing the outputs in Symbol.java to print to Context.getErr() instead of System.err. Right now it baffles me.
844:
There are some issues with log levels. --log=xxx is the preferred way to enable debug output, but those loggers who have corresponding system properties have some outages so that they aren't immediately equivalent to the --log flags. This is basically just a matter of using the Logger.initialize method for system property enabled loggers from the DebugLogger constructor. I have the fix in my branch already.
787:
This was discovered when the various debug functions in Symbol.java used Context.getErr() instead of System.err. Sometimes there would be no output, and sometimes Nashorn would just silently exit.
I suspect this is a resource management problem with one of the streams - perhaps a try with resources closes the err stream given to Shell to early, or something.
Until this is fixed, I dare not change the new global "print stacktrace on -doe" function in Context: Context#printStackTrace(final Throwable t) to actually pass Context.getErr() as parameter to Throwable#printStackTrace instead of just using the default (System.err).
This failure can be provoked by e.g. using -Dnashorn.trace.symbol=<symbol name of existing symbol> and changing the outputs in Symbol.java to print to Context.getErr() instead of System.err. Right now it baffles me.
844:
There are some issues with log levels. --log=xxx is the preferred way to enable debug output, but those loggers who have corresponding system properties have some outages so that they aren't immediately equivalent to the --log flags. This is basically just a matter of using the Logger.initialize method for system property enabled loggers from the DebugLogger constructor. I have the fix in my branch already.