JDK-6406485 : Setting some parameters (PrintMallocFree / PrintCommandLineFlags) fails an assert
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-30
  • Updated: 2012-10-08
  • Resolved: 2006-04-19
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
6 b80Fixed
Related Reports
Relates :  
Relates :  
Description
My fix for CR 6395139 introduced a problem. When some command line parameters are passed to the VM (the ones I know of are -XX:+PrintMallocFree and -XX:+PrintCommandLineFlags) an assert happens for debug and fastdebug builds.

Comments
EVALUATION This is what the Threads::create_vm() method does: // Initialize the output stream module ostream_init(); ... // Parse arguments jint parse_result = Arguments::parse(args); if (parse_result != JNI_OK) return parse_result; ... // Initialize output stream logging ostream_init_log(); In the Arguments::parse() method, when a string needs to be malloced, and if -XX:+PrintMallocFree is set, the malloc call needs to be logged. This forces the log to be initialized and the fix for CR 6395139 uses tty->time_stamp().milliseconds() during the log initialization. However, tty->time_stamp() is actually initialized in ostream_init_log(), which is called after Arguments::parse(). Hence the assertion failure. The scenario is similar when -XX:+PrintCommandLineFlags is set.
30-03-2006

SUGGESTED FIX The fix moves one line, the one that initializes tty->time_stamp(), from the ostream_init_log() method to the ostream_init() method.
30-03-2006