Android 高级分析在自动垃圾收集期间崩溃

Posted

技术标签:

【中文标题】Android 高级分析在自动垃圾收集期间崩溃【英文标题】:Android advanced profiling crashed during automatic Garbage Collection 【发布时间】:2020-06-12 05:55:01 【问题描述】:

1、android Studio 4.0 2、华为P20P(安卓10.0)

这是调用堆栈。

2020-06-12 13:35:55.748 30951-30990/com.xxxx A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 30990 (HeapTaskDaemon), pid 30951 (xxxx)
2020-06-12 13:35:55.816 31608-31608/? I/crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2020-06-12 13:35:55.817 889-889/? I//system/bin/tombstoned: received crash request for pid 30990
2020-06-12 13:35:55.818 31608-31608/? I/crash_dump32: performing dump of process 30951 (target tid = 30990)
2020-06-12 13:35:55.840 31608-31608/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-06-12 13:35:55.840 31608-31608/? A/DEBUG: Build fingerprint: 'HUAWEI/CLT-AL01/HWCLT:10/HUAWEICLT-AL01/10.0.0.172C00:user/release-keys'
2020-06-12 13:35:55.840 31608-31608/? A/DEBUG: Revision: '0'
2020-06-12 13:35:55.840 31608-31608/? A/DEBUG: ABI: 'arm'
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG: SYSVMTYPE: Maple
    APPVMTYPE: Art
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG: Timestamp: 2020-06-12 13:35:55+0800
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG: pid: 30951, tid: 30990, name: HeapTaskDaemon  >>> com.xxxx <<<
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG: uid: 10574
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG: Cause: null pointer dereference
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG:     r0  00000000  r1  bcf915e0  r2  00000004  r3  42c00000
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG:     r4  00001030  r5  6fefed38  r6  704cda14  r7  704cea30
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG:     r8  704cda00  r9  bcf915e0  r10 e772c17c  r11 00001c1c
2020-06-12 13:35:55.841 31608-31608/? A/DEBUG:     ip  80000000  sp  bcf91580  lr  e6856ccf  pc  e6856cb2
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG: backtrace:
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #00 pc 0018dcb2  /apex/com.android.runtime/lib/libart.so (_ZN3art6mirror6Object15VisitReferencesILb1ELNS_17VerifyObjectFlagsE0ELNS_17ReadBarrierOptionE1ENS_2gc9collector17ConcurrentCopying16RefFieldsVisitorILb0EEES9_EEvRKT2_RKT3_+2046) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #01 pc 00181d2f  /apex/com.android.runtime/lib/libart.so (art::gc::collector::ConcurrentCopying::ImmuneSpaceScanObjVisitor::Callback(art::mirror::Object*, void*)+70) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #02 pc 0017515f  /apex/com.android.runtime/lib/libart.so (art::gc::accounting::ModUnionTableReferenceCache::VisitObjects(void (*)(art::mirror::Object*, void*), void*)+218) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #03 pc 0017e157  /apex/com.android.runtime/lib/libart.so (art::gc::collector::ConcurrentCopying::CopyingPhase()+758) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #04 pc 0017ca33  /apex/com.android.runtime/lib/libart.so (art::gc::collector::ConcurrentCopying::RunPhases()+910) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #05 pc 00192e37  /apex/com.android.runtime/lib/libart.so (art::gc::collector::GarbageCollector::Run(art::gc::GcCause, bool)+222) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #06 pc 001aa049  /apex/com.android.runtime/lib/libart.so (art::gc::Heap::CollectGarbageInternal(art::gc::collector::GcType, art::gc::GcCause, bool)+2544) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #07 pc 001b8007  /apex/com.android.runtime/lib/libart.so (art::gc::Heap::ConcurrentGC(art::Thread*, art::gc::GcCause, bool)+66) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #08 pc 001bc23b  /apex/com.android.runtime/lib/libart.so (art::gc::Heap::ConcurrentGCTask::Run(art::Thread*)+18) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #09 pc 001dd6bb  /apex/com.android.runtime/lib/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+30) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #10 pc 0006593b  /system/framework/arm/boot-core-libart.oat (art_jni_trampoline+74) (BuildId: b9f15cb0eeaf6d1251d7b3ec2abc135d8ca77371)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #11 pc 000e1bc5  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #12 pc 0044cd4b  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+250) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #13 pc 000e9ff5  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+160) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #14 pc 0021b15f  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+274) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #15 pc 002172c7  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+802) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #16 pc 00441f01  /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtual+584) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.954 31608-31608/? A/DEBUG:       #17 pc 000dc814  /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual+20) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #18 pc 001b47c2  /apex/com.android.runtime/javalib/core-libart.jar (java.lang.Daemons$HeapTaskDaemon.runInternal+38)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #19 pc 00442159  /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtual+1184) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #20 pc 000dc814  /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual+20) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #21 pc 001b3fa6  /apex/com.android.runtime/javalib/core-libart.jar (java.lang.Daemons$Daemon.run+50)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #22 pc 00443675  /apex/com.android.runtime/lib/libart.so (MterpInvokeInterface+1468) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #23 pc 000dca14  /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_interface+20) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #24 pc 000eac04  /apex/com.android.runtime/javalib/core-oj.jar (java.lang.Thread.run+8)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #25 pc 001f75b3  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.6866433496563190725+194) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #26 pc 001fbc25  /apex/com.android.runtime/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+120) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #27 pc 00431c2d  /apex/com.android.runtime/lib/libart.so (artQuickToInterpreterBridge+832) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #28 pc 000e65a1  /apex/com.android.runtime/lib/libart.so (art_quick_to_interpreter_bridge+32) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #29 pc 000e1bc5  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #30 pc 0044cd4b  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+250) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #31 pc 000e9ff5  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+160) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #32 pc 00388fc3  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+54) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #33 pc 00389ccd  /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+300) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #34 pc 003bb2fb  /apex/com.android.runtime/lib/libart.so (art::Thread::CreateCallback(void*)+966) (BuildId: 2f1da2282ed9ab3ce5c8d66b2440693c)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #35 pc 0009c1b7  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: a4512dbc201a034f375ebdf7a21495c8)
2020-06-12 13:35:55.955 31608-31608/? A/DEBUG:       #36 pc 00055657  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: a4512dbc201a034f375ebdf7a21495c8)

我检查了主题: app will be crash when i want use Android Profiler 它对我不起作用。

观察者之后,每次打开内存分析图上没有GC图标的应用,就OK了, 如果GC图标出现,则应用GC时会很快崩溃。

我想如果我真的可以关闭“启用高级分析”选项,情况会更好。

谁能给我一些建议?

【问题讨论】:

这个问题你解决了吗? 【参考方案1】:

Windows 中的 Android Studio 4.1.2 已解决华为设备中的问题分析器崩溃问题。

在 Apple Computer 中使用 Android Studio,profiler 可以很好地工作。

【讨论】:

以上是关于Android 高级分析在自动垃圾收集期间崩溃的主要内容,如果未能解决你的问题,请参考以下文章

JVM高级特性-垃圾收集算法

CMS垃圾收集器——重新标记的讨论

java垃圾是怎么回收的,回收算法

如果允许JVM在垃圾收集期间移动堆内存,那么垃圾收集如何不因移动指针而导致JNI爆炸?

垃圾回收简介

JVM高级特性-垃圾收集之判断对象存活算法