< prev index next >
src/share/vm/utilities/vmError.hpp
Print this page
rev 12487 : 8166944: Hanging Error Reporting steps may lead to torn error logs.
Reviewed-by: cjplummer, dholmes
Summary: Interupt error reporting if reporting steps hang to enable subsequent reporting steps to run.
rev 12488 : [mq]: 8166944-Hanging-Error-Reporting-2
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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.
@@ -72,10 +72,20 @@
// When coredump_status is set to true this will contain the name/path to the core/minidump,
// if coredump_status if false, this will (hopefully) contain a useful error explaining why
// no core/minidump has been written to disk
static char coredump_message[O_BUFLEN];
+ // Timeout handling:
+ // Timestamp at which error reporting started; -1 if no error reporting in progress.
+ static volatile jlong _reporting_start_time;
+ // Whether or not error reporting did timeout.
+ static volatile bool _reporting_did_timeout;
+ // Timestamp at which the last error reporting step started; -1 if no error reporting
+ // in progress.
+ static volatile jlong _step_start_time;
+ // Whether or not the last error reporting step did timeout.
+ static volatile bool _step_did_timeout;
// set signal handlers on Solaris/Linux or the default exception filter
// on Windows, to handle recursive crashes.
static void reset_signal_handlers();
@@ -102,14 +112,24 @@
static void report_and_die(const char* message, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(2, 3);
static fdStream out;
static fdStream log; // error log used by VMError::report_and_die()
- // Platform dependend helper functions used for timeout handling.
+ // Timeout handling.
+ // Hook functions for platform dependend functionality:
static void reporting_started();
static void interrupt_reporting_thread();
+ // Helper function to get the current timestamp.
+ static jlong get_current_timestamp();
+
+ // Accessors to get/set the start times for step and total timeout.
+ static void record_reporting_start_time();
+ static jlong get_reporting_start_time();
+ static void record_step_start_time();
+ static jlong get_step_start_time();
+
public:
// return a string to describe the error
static char* error_string(char* buf, int buflen);
@@ -150,12 +170,12 @@
// check to see if fatal error reporting is in progress
static bool fatal_error_in_progress() { return first_error_tid != -1; }
static intptr_t get_first_error_tid() { return first_error_tid; }
- // Called by WatcherThread to check if the currently running error reporting did timeout.
- // Returns true if reporting did hit the global ErrorLogTimeout.
+ // Called by the WatcherThread to check if error reporting has timed-out.
+ // Returns true if error reporting has not completed within the ErrorLogTimeout limit.
static bool check_timeout();
};
#endif // SHARE_VM_UTILITIES_VMERROR_HPP
< prev index next >