comparison src/share/vm/runtime/thread.cpp @ 6768:716e6ef4482a

7190089: NMT ON: NMT failed assertion on thread's stack base address Summary: Solaris only, record stack info to NMT after stack size adjustment was made for primordial threads Reviewed-by: kvn, acorn, coleenp
author zgu
date Mon, 17 Sep 2012 10:20:04 -0400
parents 6dfc6a541338
children c088e2e95e69
comparison
equal deleted inserted replaced
6765:15ba0e7a3ff4 6768:716e6ef4482a
306 // method to complete because it may need to allocate memory to 306 // method to complete because it may need to allocate memory to
307 // store information for the new thread. 307 // store information for the new thread.
308 308
309 // initialize structure dependent on thread local storage 309 // initialize structure dependent on thread local storage
310 ThreadLocalStorage::set_thread(this); 310 ThreadLocalStorage::set_thread(this);
311
312 // set up any platform-specific state.
313 os::initialize_thread();
314 } 311 }
315 312
316 void Thread::record_stack_base_and_size() { 313 void Thread::record_stack_base_and_size() {
317 set_stack_base(os::current_stack_base()); 314 set_stack_base(os::current_stack_base());
318 set_stack_size(os::current_stack_size()); 315 set_stack_size(os::current_stack_size());
319 316 // CR 7190089: on Solaris, primordial thread's stack is adjusted
320 // record thread's native stack, stack grows downward 317 // in initialize_thread(). Without the adjustment, stack size is
321 address low_stack_addr = stack_base() - stack_size(); 318 // incorrect if stack is set to unlimited (ulimit -s unlimited).
322 MemTracker::record_thread_stack(low_stack_addr, stack_size(), this, 319 // So far, only Solaris has real implementation of initialize_thread().
323 CURRENT_PC); 320 //
321 // set up any platform-specific state.
322 os::initialize_thread(this);
323
324 // record thread's native stack, stack grows downward
325 if (MemTracker::is_on()) {
326 address stack_low_addr = stack_base() - stack_size();
327 MemTracker::record_thread_stack(stack_low_addr, stack_size(), this,
328 CURRENT_PC);
329 }
324 } 330 }
325 331
326 332
327 Thread::~Thread() { 333 Thread::~Thread() {
328 // Reclaim the objectmonitors from the omFreeList of the moribund thread. 334 // Reclaim the objectmonitors from the omFreeList of the moribund thread.