6472925: OutOfMemoryError fails to generate stack trace as it now ought

Print an additional message for OOM during stack trace printing

Reviewed-by: dholmes, phh, acorn, kamg, dcubed
This commit is contained in:
Coleen Phillimore 2011-02-07 14:36:26 -05:00
parent 2fcd065a0d
commit c4ddbc7c87

View file

@ -1611,7 +1611,15 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
uncaught_exception, // Arg 2
THREAD);
}
CLEAR_PENDING_EXCEPTION;
if (HAS_PENDING_EXCEPTION) {
ResourceMark rm(this);
jio_fprintf(defaultStream::error_stream(),
"\nException: %s thrown from the UncaughtExceptionHandler"
" in thread \"%s\"\n",
Klass::cast(pending_exception()->klass())->external_name(),
get_thread_name());
CLEAR_PENDING_EXCEPTION;
}
}
}