一. phone.info 确认重启原因:
[ro.bootmode]: [unknown]
unknown正常情况下代表是正常重启,所以需要确认下是不是电量耗光了
二.kernel log搜battery l
Line 514534: 073[01-01 07:09:40.463] <12>[21834.135015] c2 healthd: battery l=99 v=4353 t=37.0 h=2 st=2 c=75 fc=3220000 chg=u
Line 527109: 648[01-01 07:10:32.372] <12>[21886.006168] c0 healthd: battery l=99 v=4354 t=36.8 h=2 st=2 c=80 fc=3220000 chg=u
Line 529732: 271[01-01 07:10:40.456] <12>[21894.128703] c0 healthd: battery l=99 v=4354 t=36.8 h=2 st=2 c=80 fc=3220000 chg=u
Line 543489: 028[01-01 07:11:40.460] <12>[21954.131323] c2 healthd: battery l=99 v=4355 t=36.8 h=2 st=2 c=80 fc=3220000 chg=u
Line 543850: 389[01-01 07:11:47.932] <12>[21961.202123] c3 healthd: battery l=99 v=4355 t=36.6 h=2 st=2 c=70 fc=3220000 chg=u
Line 554514: 053[01-01 07:12:40.467] <12>[22014.135709] c2 healthd: battery l=99 v=4356 t=36.6 h=2 st=2 c=57 fc=3220000 chg=u
Line 556975: 514[01-01 07:12:47.714] <12>[22021.378662] c0 healthd: battery l=99 v=4355 t=36.8 h=2 st=2 c=75 fc=3220000 chg=u
Line 564258: 797[01-01 07:13:17.871] <12>[22051.438349] c0 healthd: battery l=99 v=4356 t=36.6 h=2 st=2 c=73 fc=3220000 chg=u
Line 570774: 313[01-01 07:13:40.462] <12>[22074.134098] c0 healthd: battery l=99 v=4356 t=36.6 h=2 st=2 c=72 fc=3220000 chg=u
Line 573005: 544[01-01 07:13:48.578] <12>[22081.521574] c2 healthd: battery l=99 v=4357 t=36.4 h=2 st=2 c=61 fc=3220000 chg=u
Line 583521: 060[01-01 07:14:40.464] <12>[22134.133233] c2 healthd: battery l=99 v=4355 t=36.4 h=2 st=2 c=68 fc=3220000 chg=u
Line 594094: 633[01-01 07:15:18.149] <12>[22171.768587] c2 healthd: battery l=99 v=4357 t=36.6 h=2 st=2 c=73 fc=3220000 chg=u
battery很正常,所以需要一步步排查android下log了
三.0000.log分析
看到如下异常,错误堆栈如下,
原因是由于多线程操作,导致AutoFillServiceInfo中会出现对象被析构后重新引用的情况.
解决是调整相关逻辑的执行时序.
C336444 01-01 09:03:34.039 3519 3519 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
C336445 01-01 09:03:34.039 3519 3519 F DEBUG : Native Crash TIME: 28667704
C336446 01-01 09:03:34.039 3519 3519 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
C336447 01-01 09:03:34.039 3519 3519 F DEBUG : Build fingerprint: 'Masscom/Masstel_X5/Masstel_X5:8.1.0/OPM2.171019.012/42111:userdebug/test-keys'
C336448 01-01 09:03:34.040 3519 3519 F DEBUG : Revision: '0'
C336449 01-01 09:03:34.040 3519 3519 F DEBUG : ABI: 'arm'
C33644A 01-01 09:03:34.040 3519 3519 F DEBUG : pid: 643, tid: 702, name: android.bg >>> system_server <<<
C33644B 01-01 09:03:34.040 3519 3519 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x14
C33644C 01-01 09:03:34.040 3519 3519 F DEBUG : Cause: null pointer dereference
C33644D 01-01 09:03:34.040 3519 3519 F DEBUG : r0 8bf105a8 r1 00000000 r2 99bc1248 r3 00000005
C33644E 01-01 09:03:34.041 3519 3519 F DEBUG : r4 746e6f63 r5 8bf105a8 r6 00000005 r7 1424c120
C33644F 01-01 09:03:34.041 3519 3519 F DEBUG : r8 00000001 r9 a817d200 sl 8bf105a8 fp 00000000
C336450 01-01 09:03:34.041 3519 3519 F DEBUG : ip 143995a0 sp 99bc1230 lr b27ce157 pc b51a545c cpsr a0040030
S336451 01-01 09:03:34.180 8499 8508 W YLOG : [01-01 09:03:34.180] ylog<critical> android cacheline write wrong 24667 -> 5966
M336452 01-01 09:03:34.426 303 1326 D LIBGPS : watchdog_open PowerState:GE2 CP SLEEP readcount:3937
M336453 01-01 09:03:34.426 303 1326 D LIBGPS : libgps monitor, PowerState: GE2 CP SLEEP
S336454 01-01 09:03:34.702 8499 8501 I YLOG : logmon::0.000 0-0-0-0 t:3599805 c:0 ts:0k 0.000[3,3599809,3599806,105294][0]
C336455 01-01 09:03:35.433 3519 3519 F DEBUG :
01-01 09:03:35.433 3519 3519 F DEBUG : backtrace:
C336456 01-01 09:03:35.434 3519 3519 F DEBUG : #00 pc 0002445c /system/lib/libandroidfw.so (android::ResStringPool::string8At(unsigned int, unsigned int*) const+31)
C336457 01-01 09:03:35.434 3519 3519 F DEBUG : #01 pc 000c0153 /system/lib/libandroid_runtime.so (android::android_content_StringBlock_nativeGetString(_JNIEnv*, _jobject*, long long, int)+30)
C336458 01-01 09:03:35.434 3519 3519 F DEBUG : #02 pc 009aa2f1 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.content.res.StringBlock.nativeGetString [DEDUPED]+112)
C336459 01-01 09:03:35.434 3519 3519 F DEBUG : #03 pc 009aa5d3 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.content.res.StringBlock.get+362)
C33645A 01-01 09:03:35.434 3519 3519 F DEBUG : #04 pc 009ab083 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.content.res.TypedArray.loadStringValueAt+146)
C33645B 01-01 09:03:35.434 3519 3519 F DEBUG : #05 pc 009ae4a7 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.content.res.TypedArray.getString+110)
C33645C 01-01 09:03:35.435 3519 3519 F DEBUG : #06 pc 00e86907 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.service.autofill.AutofillServiceInfo.<init>+230)
C33645D 01-01 09:03:35.435 3519 3519 F DEBUG : #07 pc 00e867f1 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.service.autofill.AutofillServiceInfo.<init>+80)
C33645E 01-01 09:03:35.435 3519 3519 F DEBUG : #08 pc 00ccb553 /system/framework/oat/arm/services.odex (offset 0x607000) (com.android.server.autofill.AutofillManagerServiceImpl.updateLocked+1346)
C33645F 01-01 09:03:35.435 3519 3519 F DEBUG : #09 pc 00cbe2eb /system/framework/oat/arm/services.odex (offset 0x607000) (com.android.server.autofill.AutofillManagerService$2.onSomePackagesChanged+234)
C336460 01-01 09:03:35.435 3519 3519 F DEBUG : #10 pc 0115643d /system/framework/arm/boot-framework.oat (offset 0x5de000) (com.android.internal.content.PackageMonitor.onReceive+2956)
C336461 01-01 09:03:35.435 3519 3519 F DEBUG : #11 pc 0075860b /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52697+858)
C336462 01-01 09:03:35.436 3519 3519 F DEBUG : #12 pc 00647e2d /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run+180)
C336463 01-01 09:03:35.436 3519 3519 F DEBUG : #13 pc 006667ab /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.os.Handler.dispatchMessage+66)
C336464 01-01 09:03:35.437 3519 3519 F DEBUG : #14 pc 00d7a425 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.os.Looper.loop+1068)
C336465 01-01 09:03:35.437 3519 3519 F DEBUG : #15 pc 00abd515 /system/framework/arm/boot-framework.oat (offset 0x5de000) (android.os.HandlerThread.run+532)
C336466 01-01 09:03:35.437 3519 3519 F DEBUG : #16 pc 00409175 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
C336467 01-01 09:03:35.437 3519 3519 F DEBUG : #17 pc 0040e2e7 /system/lib/libart.so (art_quick_invoke_stub+230)
C336468 01-01 09:03:35.437 3519 3519 F DEBUG : #18 pc 000b06b7 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+138)
C336469 01-01 09:03:35.438 3519 3519 F DEBUG : #19 pc 0035c545 /system/lib/libart.so (art::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::ArgArray*, art::JValue*, char const*)+52)
C33646A 01-01 09:03:35.438 3519 3519 F DEBUG : #20 pc 0035d34f /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+318)
C33646B 01-01 09:03:35.438 3519 3519 F DEBUG : #21 pc 0037b14f /system/lib/libart.so (art::Thread::CreateCallback(void*)+894)
C33646C 01-01 09:03:35.438 3519 3519 F DEBUG : #22 pc 0004790b /system/lib/libc.so (__pthread_start(void*)+22)
C33646D 01-01 09:03:35.439 3519 3519 F DEBUG : #23 pc 0001add3 /system/lib/libc.so (__start_thread+32)