< prev index next >

src/share/vm/runtime/thread.cpp

Print this page
rev 13436 : 8186286: [BSD] Primary thread's stack size is reported incorrectly

@@ -2512,10 +2512,13 @@
 void JavaThread::create_stack_guard_pages() {
   if (!os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) { return; }
   address low_addr = stack_end();
   size_t len = stack_guard_zone_size();
 
+  assert((((uintx)(low_addr)) & (((uintx)(os::vm_page_size())) - 1)) == 0, "Stack base should be the start of a page");
+  assert((((uintx)(len)) & (((uintx)(os::vm_page_size())) - 1)) == 0, "Stack size should be a multiple of page size");
+
   int must_commit = os::must_commit_stack_guard_pages();
   // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len);
 
   if (must_commit && !os::create_stack_guard_pages((char *) low_addr, len)) {
     log_warning(os, thread)("Attempt to allocate stack guard pages failed.");
< prev index next >