--- old/src/os/solaris/vm/os_solaris.cpp 2014-10-14 18:24:00.203815836 +0900 +++ new/src/os/solaris/vm/os_solaris.cpp 2014-10-14 18:24:00.068816800 +0900 @@ -6048,6 +6048,36 @@ return strlen(buffer); } +// Check core dump limit and report possible place where core can be found +void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) { + int n; + struct rlimit rlim; + bool success; + + n = get_core_path(buffer, bufferSize); + + if (getrlimit(RLIMIT_CORE, &rlim) != 0) { + jio_snprintf(buffer + n, bufferSize - n, "/core or core.%d (may not exist)", current_process_id()); + success = true; + } else { + switch(rlim.rlim_cur) { + case RLIM_INFINITY: + jio_snprintf(buffer + n, bufferSize - n, "/core or core.%d", current_process_id()); + success = true; + break; + case 0: + jio_snprintf(buffer, bufferSize, "Core dumps have been disabled. To enable core dumping, try \"ulimit -c unlimited\" before starting Java again"); + success = false; + break; + default: + jio_snprintf(buffer + n, bufferSize - n, "/core or core.%d (max size %lu kB). To ensure a full core dump, try \"ulimit -c unlimited\" before starting Java again", current_process_id(), (unsigned long)(rlim.rlim_cur >> 10)); + success = true; + break; + } + } + VMError::report_coredump_status(buffer, success); +} + #ifndef PRODUCT void TestReserveMemorySpecial_test() { // No tests available for this platform