# HG changeset patch # User coleenp # Date 1297107386 18000 # Node ID 1b3ccddac0ab0c9bce1e2742e9ba6ab58c3e5497 # Parent 77eb272084d95b72a3ceb10322c1763401e17f90 6472925: OutOfMemoryError fails to generate stack trace as it now ought Summary: Print an additional message for OOM during stack trace printing Reviewed-by: dholmes, phh, acorn, kamg, dcubed diff -r 77eb272084d9 -r 1b3ccddac0ab hotspot/src/share/vm/runtime/thread.cpp --- a/hotspot/src/share/vm/runtime/thread.cpp Thu Feb 03 20:30:19 2011 -0800 +++ b/hotspot/src/share/vm/runtime/thread.cpp Mon Feb 07 14:36:26 2011 -0500 @@ -1611,7 +1611,15 @@ 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; + } } }