src/share/vm/utilities/vmError.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -796,10 +796,12 @@
 # undef END
 }
 
 VMError* volatile VMError::first_error = NULL;
 volatile jlong VMError::first_error_tid = -1;
+fdStream VMError::out(defaultStream::output_fd());
+fdStream VMError::log; // error log used by VMError::report_and_die()
 
 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */
 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) {
   int fd = -1;
   if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) {

@@ -856,21 +858,19 @@
   // An error could happen before tty is initialized or after it has been
   // destroyed. Here we use a very simple unbuffered fdStream for printing.
   // Only out.print_raw() and out.print_raw_cr() should be used, as other
   // printing methods need to allocate large buffer on stack. To format a
   // string, use jio_snprintf() with a static buffer or use staticBufferStream.
-  static fdStream out(defaultStream::output_fd());
 
   // How many errors occurred in error handler when reporting first_error.
   static int recursive_error_count;
 
   // We will first print a brief message to standard out (verbose = false),
   // then save detailed information in log file (verbose = true).
   static bool out_done = false;         // done printing to standard out
   static bool log_done = false;         // done saving error log
   static bool transmit_report_done = false; // done error reporting
-  static fdStream log;                  // error log
 
   // disble NMT to avoid further exception
   MemTracker::shutdown(MemTracker::NMT_error_reporting);
 
   if (SuppressFatalErrorMessage) {