/* * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2022 SAP SE. 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. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
static Thread* _thread; // NULL if it's native thread
// additional info for crashes static address _pc; // faulting PC staticvoid* _siginfo; // ExceptionRecord on Windows, // siginfo_t on Solaris/Linux staticvoid* _context; // ContextRecord on Windows, // ucontext_t on Solaris/Linux
// records if VMError::print_native_stack was used to // print the native stack instead of os::platform_print_native_stack staticbool _print_native_stack_used;
// additional info for VM internal errors staticconstchar* _filename; staticint _lineno;
// used by reporting about OOM static size_t _size;
// used by fatal error handler staticint _current_step; staticconstchar* _current_step_info;
// Thread id of the first error. We must be able to handle native thread, // so use thread id instead of Thread* to identify thread. staticvolatile intptr_t _first_error_tid;
// Core dump status, false if we have been unable to write a core/minidump for some reason staticbool coredump_status;
// 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 staticchar coredump_message[O_BUFLEN];
// Timeout handling: // Timestamp at which error reporting started; -1 if no error reporting in progress. staticvolatile jlong _reporting_start_time; // Whether or not error reporting did timeout. staticvolatilebool _reporting_did_timeout; // Timestamp at which the last error reporting step started; -1 if no error reporting // in progress. staticvolatile jlong _step_start_time; // Whether or not the last error reporting step did timeout. staticvolatilebool _step_did_timeout;
// Install secondary signal handler to handle secondary faults during error reporting // (see VMError::crash_handler) staticvoid install_secondary_signal_handler();
// handle -XX:+ShowMessageBoxOnError. buf is used to format the message string staticvoid show_message_box(char* buf, int buflen);
// generate an error report staticvoid report(outputStream* st, bool verbose);
// generate a stack trace staticvoid print_stack_trace(outputStream* st, JavaThread* jt, char* buf, int buflen, bool verbose = false);
// public for use by the internal non-product debugger.
NOT_PRODUCT(public:) // print_source_info: if true, we try to resolve the source information on platforms that support it // (useful but may slow down, timeout or misfunction in error situations) // max_frames: if not -1, overrides StackPrintLimit staticvoid print_native_stack(outputStream* st, frame fr, Thread* t, bool print_source_info, int max_frames, char* buf, int buf_size);
NOT_PRODUCT(private:)
staticconstchar* get_filename_only() { char separator = os::file_separator()[0]; constchar* p = strrchr(_filename, separator); return p ? p+1 : _filename;
}
staticbool should_report_bug(unsignedint id) { return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR);
}
// Write a hint to the stream in case siginfo relates to a segv/bus error // and the offending address points into CDS store. staticvoid check_failing_cds_access(outputStream* st, constvoid* siginfo);
// Timeout handling. // Hook functions for platform dependent functionality: staticvoid reporting_started(); staticvoid 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. staticvoid record_reporting_start_time(); static jlong get_reporting_start_time(); staticvoid record_step_start_time(); static jlong get_step_start_time(); staticvoid clear_step_start_time();
public:
// return a string to describe the error staticchar* error_string(char* buf, int buflen);
// Record status of core/minidump staticvoid record_coredump_status(constchar* message, bool status);
// support for VM.info diagnostic command staticvoid print_vm_info(outputStream* st);
// Called by the WatcherThread to check if error reporting has timed-out. // Returns true if error reporting has not completed within the ErrorLogTimeout limit. staticbool check_timeout();
// Returns true if at least one thread reported a fatal error and // fatal error handling is in process. staticbool is_error_reported();
// Returns true if the current thread reported a fatal error. staticbool is_error_reported_in_current_thread();
DEBUG_ONLY(staticvoid controlled_crash(int how);)
// Non-NULL address guaranteed to generate a SEGV mapping error on read, for test purposes. static constexpr intptr_t segfault_address = (1 * K) AIX_ONLY(+ (4 * K));
// Max value for the ErrorLogPrintCodeLimit flag. staticconstint max_error_log_print_code = 10;
// Needed when printing signal handlers.
NOT_WINDOWS(staticconstvoid* crash_handler_address;)
// Construct file name for a log file and return it's file descriptor. // Name and location depends on pattern, default_pattern params and access // permissions. staticint prepare_log_file(constchar* pattern, constchar* default_pattern, bool overwrite_existing, char* buf, size_t buflen);
}; #endif// SHARE_UTILITIES_VMERROR_HPP
¤ Dauer der Verarbeitung: 0.30 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.