diff src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @ 2095:36c186bcc085

6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places. Summary: enhance the error reporting mechanism to help user to fix the problem rather than making it look like a VM error. Reviewed-by: kvn, kamg
author coleenp
date Mon, 03 Jan 2011 14:09:11 -0500
parents 828eafbd85cc
children d70fe6ab4436
line wrap: on
line diff
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Tue Dec 28 09:54:09 2010 -0500
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Mon Jan 03 14:09:11 2011 -0500
@@ -585,6 +585,13 @@
   sigaddset(&newset, sig);
   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 
+  // Determine which sort of error to throw.  Out of swap may signal
+  // on the thread stack, which could get a mapping error when touched.
+  address addr = (address) info->si_addr;
+  if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) {
+    vm_exit_out_of_memory(0, "Out of swap space to map in thread stack.");
+  }
+
   VMError err(t, sig, pc, info, ucVoid);
   err.report_and_die();