summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-08-28 22:19:37 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-08-28 22:19:38 +0000
commit14515d738dadf88e3e00b7dd1bd69899c4df4b91 (patch)
treecf4cadff03997851247f9be8559cb739e4bb026b
parent79e909bc9d95c3952be85af846ba8bda344531f5 (diff)
parent7895d554d17309db67737b6750c59d8cece213e3 (diff)
downloadandroid_art-14515d738dadf88e3e00b7dd1bd69899c4df4b91.tar.gz
android_art-14515d738dadf88e3e00b7dd1bd69899c4df4b91.tar.bz2
android_art-14515d738dadf88e3e00b7dd1bd69899c4df4b91.zip
Merge "Fix an assert failure in art::DumpNativeStack()."
-rw-r--r--runtime/utils.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 55ecc1e40c..c359e5803c 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -1069,10 +1069,6 @@ std::string GetSchedulerGroupName(pid_t tid) {
void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix,
mirror::ArtMethod* current_method) {
- // We may be called from contexts where current_method is not null, so we must assert this.
- if (current_method != nullptr) {
- Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
- }
#ifdef __linux__
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(BACKTRACE_CURRENT_PROCESS, tid));
if (!backtrace->Unwind(0)) {
@@ -1104,7 +1100,9 @@ void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix,
if (it->func_offset != 0) {
os << "+" << it->func_offset;
}
- } else if (current_method != nullptr && current_method->IsWithinQuickCode(it->pc)) {
+ } else if (current_method != nullptr &&
+ Locks::mutator_lock_->IsSharedHeld(Thread::Current()) &&
+ current_method->IsWithinQuickCode(it->pc)) {
const void* start_of_code = current_method->GetEntryPointFromQuickCompiledCode();
os << JniLongName(current_method) << "+"
<< (it->pc - reinterpret_cast<uintptr_t>(start_of_code));