提交 5750eb96 编写于 作者: Z zgu

7198529: NPG: assert with NMT code in Thread destructor

Summary: Thread stack's base address can be NULL if it is not started or exited before recording the base
Reviewed-by: kvn, fparain
上级 eeb5bf67
...@@ -328,8 +328,14 @@ Thread::~Thread() { ...@@ -328,8 +328,14 @@ Thread::~Thread() {
// Reclaim the objectmonitors from the omFreeList of the moribund thread. // Reclaim the objectmonitors from the omFreeList of the moribund thread.
ObjectSynchronizer::omFlush (this) ; ObjectSynchronizer::omFlush (this) ;
// stack_base can be NULL if the thread is never started or exited before
// record_stack_base_and_size called. Although, we would like to ensure
// that all started threads do call record_stack_base_and_size(), there is
// not proper way to enforce that.
if (_stack_base != NULL) {
address low_stack_addr = stack_base() - stack_size(); address low_stack_addr = stack_base() - stack_size();
MemTracker::release_thread_stack(low_stack_addr, stack_size(), this); MemTracker::release_thread_stack(low_stack_addr, stack_size(), this);
}
// deallocate data structures // deallocate data structures
delete resource_area(); delete resource_area();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册