diff options
author | Elliott Hughes <enh@google.com> | 2013-04-12 11:51:51 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-04-12 11:51:51 -0700 |
commit | 46371593812d966c40e1ec4019e3c7c6613046a6 (patch) | |
tree | 1b0ff346dc79a0755baa48a1cff4087fef7095a4 /vm/Thread.cpp | |
parent | 6cd2e7bfcd0899816be1e5eac4d0a69528764bbe (diff) | |
download | android_dalvik-46371593812d966c40e1ec4019e3c7c6613046a6.tar.gz android_dalvik-46371593812d966c40e1ec4019e3c7c6613046a6.tar.bz2 android_dalvik-46371593812d966c40e1ec4019e3c7c6613046a6.zip |
More native stack dump hardening.
Threads just starting up or shutting down might not have any managed
stack frames, leading to a NULL "currFrame" frame pointer in the
interpreter stack.
Bug: 8596028
Change-Id: Ie24c8d5f8e78a5abe882a9e639046c03abb91649
Diffstat (limited to 'vm/Thread.cpp')
-rw-r--r-- | vm/Thread.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vm/Thread.cpp b/vm/Thread.cpp index aba98ab73..cfc43486d 100644 --- a/vm/Thread.cpp +++ b/vm/Thread.cpp @@ -3330,7 +3330,12 @@ static bool shouldShowNativeStack(Thread* thread) { // state THREAD_SUSPENDED if they're calling back into the VM, or THREAD_MONITOR // if they're blocked on a monitor, or one of the thread-startup states if // it's early enough in their life cycle (http://b/7432159). - const Method* currentMethod = SAVEAREA_FROM_FP(thread->interpSave.curFrame)->method; + u4* fp = thread->interpSave.curFrame; + if (fp == NULL) { + // The thread has no managed frames, so native frames are all there is. + return true; + } + const Method* currentMethod = SAVEAREA_FROM_FP(fp)->method; return currentMethod != NULL && dvmIsNativeMethod(currentMethod); } |