From 6c53068f4f048cff372c0dc4045bc0cade60189a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 15 Dec 2010 10:41:18 -0700 Subject: [PATCH] clear Thread::stack before vmInvoke_safeStack in compile-arm.S --- src/compile-arm.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compile-arm.S b/src/compile-arm.S index 555c61476b..c61ebaff37 100644 --- a/src/compile-arm.S +++ b/src/compile-arm.S @@ -96,6 +96,14 @@ GLOBAL(vmInvoke_returnAddress): // restore frame ldr sp, [sp] + + // clear MyThread::stack to avoid confusing another thread calling + // java.lang.Thread.getStackTrace on this one. See + // MyProcess::getStackTrace in compile.cpp for details on how we get + // a reliable stack trace from a thread that might be interrupted at + // any point in its execution. + mov r5,#0 + str r5,[r8,#THREAD_STACK] .globl GLOBAL(vmInvoke_safeStack) GLOBAL(vmInvoke_safeStack):