./src/os/linux/vm/os_linux.cpp

Print this page
rev 1518 : Added check for -XX:StackShadowPages configuration option.

@@ -3843,10 +3843,15 @@
 // this is called _after_ the global arguments have been parsed
 jint os::init_2(void)
 {
   Linux::fast_thread_clock_init();
 
+  if (StackShadowPages <= 0) {
+    tty->print_cr("\nThe -XX:StackShadowPages parameter must be set to positive value!");
+    return JNI_ERR;
+  }
+
   // Allocate a single page and mark it as readable for safepoint polling
   address polling_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
   guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" );
 
   os::set_polling_page( polling_page );