hotspot/src/share/vm/utilities/vmError.hpp
changeset 46284 ad578adff5df
parent 38266 aa3dbc37ede9
child 46560 388aa8d67c80
equal deleted inserted replaced
46283:09e328af295a 46284:ad578adff5df
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    72   // When coredump_status is set to true this will contain the name/path to the core/minidump,
    72   // When coredump_status is set to true this will contain the name/path to the core/minidump,
    73   // if coredump_status if false, this will (hopefully) contain a useful error explaining why
    73   // if coredump_status if false, this will (hopefully) contain a useful error explaining why
    74   // no core/minidump has been written to disk
    74   // no core/minidump has been written to disk
    75   static char coredump_message[O_BUFLEN];
    75   static char coredump_message[O_BUFLEN];
    76 
    76 
       
    77   // Timeout handling:
       
    78   // Timestamp at which error reporting started; -1 if no error reporting in progress.
       
    79   static volatile jlong _reporting_start_time;
       
    80   // Whether or not error reporting did timeout.
       
    81   static volatile bool _reporting_did_timeout;
       
    82   // Timestamp at which the last error reporting step started; -1 if no error reporting
       
    83   //   in progress.
       
    84   static volatile jlong _step_start_time;
       
    85   // Whether or not the last error reporting step did timeout.
       
    86   static volatile bool _step_did_timeout;
    77 
    87 
    78   // set signal handlers on Solaris/Linux or the default exception filter
    88   // set signal handlers on Solaris/Linux or the default exception filter
    79   // on Windows, to handle recursive crashes.
    89   // on Windows, to handle recursive crashes.
    80   static void reset_signal_handlers();
    90   static void reset_signal_handlers();
    81 
    91 
   101                              void* context, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(6, 7);
   111                              void* context, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(6, 7);
   102   static void report_and_die(const char* message, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(2, 3);
   112   static void report_and_die(const char* message, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(2, 3);
   103 
   113 
   104   static fdStream out;
   114   static fdStream out;
   105   static fdStream log; // error log used by VMError::report_and_die()
   115   static fdStream log; // error log used by VMError::report_and_die()
       
   116 
       
   117   // Timeout handling.
       
   118   // Hook functions for platform dependend functionality:
       
   119   static void reporting_started();
       
   120   static void interrupt_reporting_thread();
       
   121 
       
   122   // Helper function to get the current timestamp.
       
   123   static jlong get_current_timestamp();
       
   124 
       
   125   // Accessors to get/set the start times for step and total timeout.
       
   126   static void record_reporting_start_time();
       
   127   static jlong get_reporting_start_time();
       
   128   static void record_step_start_time();
       
   129   static jlong get_step_start_time();
   106 
   130 
   107 public:
   131 public:
   108 
   132 
   109   // return a string to describe the error
   133   // return a string to describe the error
   110   static char* error_string(char* buf, int buflen);
   134   static char* error_string(char* buf, int buflen);
   145 
   169 
   146   // check to see if fatal error reporting is in progress
   170   // check to see if fatal error reporting is in progress
   147   static bool fatal_error_in_progress() { return first_error_tid != -1; }
   171   static bool fatal_error_in_progress() { return first_error_tid != -1; }
   148 
   172 
   149   static intptr_t get_first_error_tid() { return first_error_tid; }
   173   static intptr_t get_first_error_tid() { return first_error_tid; }
       
   174 
       
   175   // Called by the WatcherThread to check if error reporting has timed-out.
       
   176   //  Returns true if error reporting has not completed within the ErrorLogTimeout limit.
       
   177   static bool check_timeout();
       
   178 
   150 };
   179 };
   151 
   180 
   152 #endif // SHARE_VM_UTILITIES_VMERROR_HPP
   181 #endif // SHARE_VM_UTILITIES_VMERROR_HPP