diff options
Diffstat (limited to 'runtime/thread.cc')
| -rw-r--r-- | runtime/thread.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index c0deda82db..ea6c071fa7 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -2881,6 +2881,17 @@ jobjectArray Thread::CreateAnnotatedStackTrace(const ScopedObjectAccessAlreadyRu Handle<mirror::Class> h_aste_class(hs.NewHandle<mirror::Class>( h_aste_array_class->GetComponentType())); + + // Make sure the AnnotatedStackTraceElement.class is initialized, b/76208924 . + class_linker->EnsureInitialized(soa.Self(), + h_aste_class, + /* can_init_fields */ true, + /* can_init_parents */ true); + if (soa.Self()->IsExceptionPending()) { + // This should not fail in a healthy runtime. + return nullptr; + } + ArtField* stack_trace_element_field = h_aste_class->FindField( soa.Self(), h_aste_class.Get(), "stackTraceElement", "Ljava/lang/StackTraceElement;"); DCHECK(stack_trace_element_field != nullptr); |