From 1777e00ccac09b897c0782ec3e57b35198b48688 Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Wed, 18 Nov 2015 10:46:02 -0600 Subject: [PATCH] 8141641: Runtime: implement range for ErrorLogTimeout Implement range=(0, jlong_max/1000) Reviewed-by: coleenp, ddmitriev, dholmes --- hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 3 ++- hotspot/src/share/vm/runtime/thread.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp b/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp index b25f7ccdd28..ef45b27f0c6 100644 --- a/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp +++ b/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp @@ -279,7 +279,7 @@ void emit_range_double(const char* name, double min, double max) { // Generate func argument to pass into emit_range_xxx functions #define EMIT_RANGE_CHECK(a, b) , a, b -#define INITIAL_RANGES_SIZE 204 +#define INITIAL_RANGES_SIZE 205 GrowableArray* CommandLineFlagRangeList::_ranges = NULL; // Check the ranges of all flags that have them diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index fb61f555307..eeb61ea36a6 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1031,9 +1031,10 @@ public: product(bool, CreateCoredumpOnCrash, true, \ "Create core/mini dump on VM fatal error") \ \ - product(uintx, ErrorLogTimeout, 2 * 60, \ + product(uint64_t, ErrorLogTimeout, 2 * 60, \ "Timeout, in seconds, to limit the time spent on writing an " \ "error log in case of a crash.") \ + range(0, (uint64_t)max_jlong/1000) \ \ product_pd(bool, UseOSErrorReporting, \ "Let VM fatal error propagate to the OS (ie. WER on Windows)") \ diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index de7c4139059..5291b8025fa 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1299,7 +1299,7 @@ void WatcherThread::run() { if (!ShowMessageBoxOnError && (OnError == NULL || OnError[0] == '\0') && Arguments::abort_hook() == NULL) { - os::sleep(this, ErrorLogTimeout * 60 * 1000, false); + os::sleep(this, (jlong)ErrorLogTimeout * 1000, false); // in seconds fdStream err(defaultStream::output_fd()); err.print_raw_cr("# [ timer expired, abort... ]"); // skip atexit/vm_exit/vm_abort hooks