提交 0d5ac5f9 编写于 作者: C coleenp

6583275: Hotspot crash in vm_perform_shutdown_actions due to uninitialized TLS...

6583275: Hotspot crash in vm_perform_shutdown_actions due to uninitialized TLS during out of memory handling
Summary: Call get_thread_slow() in vm_perform_shutdown actions and add null check.
Reviewed-by: kvn, dholmes, jcoomes
上级 f151bc24
...@@ -515,8 +515,8 @@ void before_exit(JavaThread * thread) { ...@@ -515,8 +515,8 @@ void before_exit(JavaThread * thread) {
} }
void vm_exit(int code) { void vm_exit(int code) {
Thread* thread = ThreadLocalStorage::thread_index() == -1 ? NULL Thread* thread = ThreadLocalStorage::is_initialized() ?
: ThreadLocalStorage::get_thread_slow(); ThreadLocalStorage::get_thread_slow() : NULL;
if (thread == NULL) { if (thread == NULL) {
// we have serious problems -- just exit // we have serious problems -- just exit
vm_direct_exit(code); vm_direct_exit(code);
...@@ -553,8 +553,9 @@ void vm_perform_shutdown_actions() { ...@@ -553,8 +553,9 @@ void vm_perform_shutdown_actions() {
// Calling 'exit_globals()' will disable thread-local-storage and cause all // Calling 'exit_globals()' will disable thread-local-storage and cause all
// kinds of assertions to trigger in debug mode. // kinds of assertions to trigger in debug mode.
if (is_init_completed()) { if (is_init_completed()) {
Thread* thread = Thread::current(); Thread* thread = ThreadLocalStorage::is_initialized() ?
if (thread->is_Java_thread()) { ThreadLocalStorage::get_thread_slow() : NULL;
if (thread != NULL && thread->is_Java_thread()) {
// We are leaving the VM, set state to native (in case any OS exit // We are leaving the VM, set state to native (in case any OS exit
// handlers call back to the VM) // handlers call back to the VM)
JavaThread* jt = (JavaThread*)thread; JavaThread* jt = (JavaThread*)thread;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册