https://issuetracker.google.com/issues/292138960
异常log:
libc++abi: termination with uncaught exception of type NSt3__112system_errorE: condition_variable timed_wait failed: Invalid argument.
F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F DEBUG : Build fingerprint:
F DEBUG : Revision: '0'
F DEBUG : ABI: 'arm'
F DEBUG : Timestamp: 1970-01-01 00:00:24.108652169+0000
F DEBUG : Process uptime: 0s
F DEBUG : Cmdline: system_server
F DEBUG : pid: 526, tid: 595, name: Thread-5 >>> system_server <<<
F DEBUG : uid: 1000
F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
F DEBUG : Abort message: 'terminating with uncaught exception of type NSt3__112system_errorE: condition_variable timed_wait failed: Invalid argument'
F DEBUG : r0 00000000 r1 00000253 r2 00000006 r3 75f67fc8
F DEBUG : r4 75f67fdc r5 75f67fc0 r6 0000020e r7 0000016b
F DEBUG : r8 75f67fc8 r9 75f67fd8 r10 75f67ff8 r11 75f67fe8
F DEBUG : ip 00000253 sp 75f67f98 lr a33d50c9 pc a33d50dc
F DEBUG : backtrace:
F DEBUG : #00 pc 000610dc /apex/com.android.runtime/lib/bionic/libc.so (abort+172) (BuildId: 460a1e81ab9c39eaba7bac395e1f241c)
F DEBUG : #01 pc 0001dfb1 /apex/com.android.os.statsd/lib/libstatspull.so (abort_message+92) (BuildId: 961ffc2b332d5bd2f416d2f0e31567de)
F DEBUG : #02 pc 000202f3 /apex/com.android.os.statsd/lib/libstatspull.so (demangling_terminate_handler()+142) (BuildId: 961ffc2b332d5bd2f416d2f0e31567de)
F DEBUG : #03 pc 0001efcf /apex/com.android.os.statsd/lib/libstatspull.so (std::__terminate(void (*)())+2) (BuildId: 961ffc2b332d5bd2f416d2f0e31567de)
F DEBUG : #04 pc 0001ef87 /apex/com.android.os.statsd/lib/libstatspull.so (std::terminate()+46) (BuildId: 961ffc2b332d5bd2f416d2f0e31567de)
F DEBUG : #05 pc 0001e01d /apex/com.android.os.statsd/lib/libstatspull.so (__clang_call_terminate+4) (BuildId: 961ffc2b332d5bd2f416d2f0e31567de)
I incfs : Initial API level of the device: 31
Analyze:
1.Through log analysis, the reason for the system error crash is: libc++abi: termination with uncaught exception of type NSt3__112system_errorE: condition_variable timed_wait failed: Invalid argument.
2.Analyze the code and locate the location where the problem occurs:android/frameworks/base/services/incremental/ServiceWrappers.cpp runTimers().
3.Through analysis and experiments, it is initially believed that the problem caused by the parameter "nextJobTs" passed to "mCondition.wait_until" is too large. We divide the initial value of the "static constexpr TimePoint kInfinityTs" by 2 and the problem no longer occurs.