Foreground:Yes Pid:58538 Uid:20020182 Reason:LIFECYCLE_TIMEOUT sysfreeze: com.example.xxx LIFECYCLE_TIMEOUT at 20250415172204 DisplayPowerInfo:powerState:AWAKE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DOMAIN:AAFWK STRINGID:LIFECYCLE_TIMEOUT TIMESTAMP:2025/04/15-17:22:04:290 PID:58538 UID:20020182 PACKAGE_NAME:com.example.xxx PROCESS_NAME:com.example.xxx ******************************************* start time: 2025/04/15-17:22:01:711 DOMAIN = AAFWK EVENTNAME = LIFECYCLE_HALF_TIMEOUT TIMESTAMP = 2025/04/15-17:22:01:703 PID = 58538 UID = 20020182 TID = 58538 PACKAGE_NAME = com.example.xxx PROCESS_NAME = com.example.xxx eventLog_action = pb:1:r,t eventLog_interval = 10 MSG = Fault time:2025/04/15-17:22:01 ability:EntryAbility foreground timeout.
查看当前任务已运行时长,排查是否阻塞:dump begin curTime - trigger time,得出block时长5s,大于等于故障检测时长5s。且发现warning和block在执行的当前任务相同,证明此任务阻塞了的当前线程。
mainHandler dump is:
EventHandler dump begin curTime: 2025-04-15 05:22:01.531
Event runner (Thread name = , Thread ID = 58538) is running
Current Running: start at 2025-04-15 05:21:59.031, Event { send thread = 58680, send time = 2025-04-15 05:21:59.031, handle time = 2025-04-15 05:21:59.031, trigger time = 2025-04-15 05:21:59.031, task name = UIAbilityThread:AbilityTransaction, caller = [ui_ability_thread.cpp(ScheduleAbilityTransaction:345)] } mainHandler dump is:
EventHandler dump begin curTime: 2025-04-15 05:22:04.031
Event runner (Thread name = , Thread ID = 58538) is running
Current Running: start at 2025-04-15 05:21:59.030, Event { send thread = 58680, send time = 2025-04-15 05:21:59.030, handle time = 2025-04-15 05:21:59.030, trigger time = 2025-04-15 05:21:59.030, task name = UIAbilityThread:AbilityTransaction, caller = [ui_ability_thread.cpp(ScheduleAbilityTransaction:345)] } Tid:58538, Name:xxx #00 pc 00000000001c9074 /system/lib/ld-musl-aarch64.so.1(writev+64)(e9ff207f4340aee156e36fdd8af0ab22) #01 pc 0000000000020054 /system/lib64/chipset-pub-sdk/libhilog.so(OHOS::HiviewDFX::Socket::WriteV(iovec const*, unsigned int)+44)(14405333e2409816091bcc89cce6534c) #02 pc 000000000001f1b0 /system/lib64/chipset-pub-sdk/libhilog.so(HilogWriteLogMessageBinary+60)(14405333e2409816091bcc89cce6534c) #03 pc 00000000000161a0 /system/lib64/chipset-pub-sdk/libhilog.so(HilogPrintBinary+1588)(14405333e2409816091bcc89cce6534c) #04 pc 000000000001583c /system/lib64/chipset-pub-sdk/libhilog.so(HiLogParamEncoded(LogType, LogLevel, unsigned int, char const*, char const*, std::__va_list, OHOS::HiviewDFX::HiLogEncode::OutBuffer&, DictFlag&)+1712)(14405333e2409816091bcc89cce6534c) #05 pc 0000000000016978 /system/lib64/chipset-pub-sdk/libhilog.so(HiLogPrintDictArgs(LogType, LogLevel, unsigned int, char const*, FmtId const*, char const*, std::__va_list)+440)(14405333e2409816091bcc89cce6534c) #06 pc 0000000000016a9c /system/lib64/chipset-pub-sdk/libhilog.so(HiLogPrintDictNew+128)(14405333e2409816091bcc89cce6534c) #07 pc 000000000000e4d0 /system/lib64/platformsdk/libconsole.z.so(napi_value__* OHOS::JsSysModule::Console::ConsoleLog<(OHOS::JsSysModule::LogLevel)1>(napi_env__*, napi_callback_info__*) (.cfi)+296)(c56dc4a0f51cef03c663b9e06c041e57) #08 pc 000000000003df48 /system/lib64/platformsdk/libace_napi.z.so(panda::JSValueRef ArkNativeFunctionCallBack<true>(panda::JsiRuntimeCallInfo*)+216)(998b53857197a096e5ad930f65e67856) #09 pc 00000000003f3b6c /system/lib64/module/arkcompiler/stub.an(RTStub_PushCallArgsAndDispatchNative+40) #10 at onCreate (entry/src/main/ets/entryability/EntryAbility.ets:13:7) #11 pc 00000000003a4e58 /system/lib64/platformsdk/libark_jsruntime.so(panda::ecmascript::InterpreterAssembly::Execute(panda::ecmascript::EcmaRuntimeCallInfo*)+216)(76359649b760261c0213b7c12fecc049)
Tid:58538, Name:xxx #00 pc 00000000001c9074 /system/lib/ld-musl-aarch64.so.1(writev+64)(e9ff207f4340aee156e36fdd8af0ab22) #01 pc 0000000000020054 /system/lib64/chipset-pub-sdk/libhilog.so(OHOS::HiviewDFX::Socket::WriteV(iovec const*, unsigned int)+44)(14405333e2409816091bcc89cce6534c) #02 pc 000000000001f1b0 /system/lib64/chipset-pub-sdk/libhilog.so(HilogWriteLogMessageBinary+60)(14405333e2409816091bcc89cce6534c) #03 pc 00000000000161a0 /system/lib64/chipset-pub-sdk/libhilog.so(HilogPrintBinary+1588)(14405333e2409816091bcc89cce6534c) #04 pc 000000000001583c /system/lib64/chipset-pub-sdk/libhilog.so(HiLogParamEncoded(LogType, LogLevel, unsigned int, char const*, char const*, std::__va_list, OHOS::HiviewDFX::HiLogEncode::OutBuffer&, DictFlag&)+1712)(14405333e2409816091bcc89cce6534c) #05 pc 0000000000016978 /system/lib64/chipset-pub-sdk/libhilog.so(HiLogPrintDictArgs(LogType, LogLevel, unsigned int, char const*, FmtId const*, char const*, std::__va_list)+440)(14405333e2409816091bcc89cce6534c) #06 pc 0000000000016a9c /system/lib64/chipset-pub-sdk/libhilog.so(HiLogPrintDictNew+128)(14405333e2409816091bcc89cce6534c) #07 pc 000000000000e4d0 /system/lib64/platformsdk/libconsole.z.so(napi_value__* OHOS::JsSysModule::Console::ConsoleLog<(OHOS::JsSysModule::LogLevel)1>(napi_env__*, napi_callback_info__*) (.cfi)+296)(c56dc4a0f51cef03c663b9e06c041e57) #08 pc 000000000003df48 /system/lib64/platformsdk/libace_napi.z.so(panda::JSValueRef ArkNativeFunctionCallBack<true>(panda::JsiRuntimeCallInfo*)+216)(998b53857197a096e5ad930f65e67856) #09 pc 00000000003f3b6c /system/lib64/module/arkcompiler/stub.an(RTStub_PushCallArgsAndDispatchNative+40) #10 at onCreate (entry/src/main/ets/entryability/EntryAbility.ets:13:7) #11 pc 00000000003a4e58 /system/lib64/platformsdk/libark_jsruntime.so(panda::ecmascript::InterpreterAssembly::Execute(panda::ecmascript::EcmaRuntimeCallInfo*)+216)(76359649b760261c0213b7c12fecc049)
发现应用一直在循环输出打印相同的内容,说明发生了死循环或重复调用,导致应用超时,启动失败。
catcher cmd: hilog -z 1000 -P 04-15 17:22:05.130 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞 04-15 17:22:05.130 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞 04-15 17:22:05.130 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞 04-15 17:22:05.130 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞 04-15 17:22:05.130 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞 04-15 17:22:05.130 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞 04-15 17:22:05.130 58538 58538 W A03D00/com.example.xxx/HiLog: write socket failed, 17 line(s) dropped! 04-15 17:22:05.131 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞 04-15 17:22:05.131 58538 58538 W A03D00/com.example.xxx/HiLog: write socket failed, 2 line(s) dropped! 04-15 17:22:05.131 58538 58538 I A03D00/com.example.xxx/JSAPP: 阻塞