mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8214975: No hs-err file if fatal error is raised during dynamic initialization
Reviewed-by: dholmes, dcubed
This commit is contained in:
parent
ef3532fc67
commit
6d4de736d8
4 changed files with 157 additions and 20 deletions
|
@ -92,6 +92,21 @@ static void* g_assertion_context = NULL;
|
|||
# endif
|
||||
#endif // PRODUCT
|
||||
|
||||
#ifdef ASSERT
|
||||
// This is to test that error reporting works if we assert during dynamic
|
||||
// initialization of the hotspot. See JDK-8214975.
|
||||
struct Crasher {
|
||||
Crasher() {
|
||||
// Using getenv - no other mechanism would work yet.
|
||||
const char* s = ::getenv("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION");
|
||||
if (s != NULL && ::strcmp(s, "1") == 0) {
|
||||
fatal("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION");
|
||||
}
|
||||
}
|
||||
};
|
||||
static Crasher g_crasher;
|
||||
#endif // ASSERT
|
||||
|
||||
ATTRIBUTE_PRINTF(1, 2)
|
||||
void warning(const char* format, ...) {
|
||||
if (PrintWarnings) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue