base: PhantomProcessList: Correctly handle orphan procs
The null check AOSP does here is logically flawed and throws a: java.lang.IllegalArgumentException: Comparison method violates its general contract! It'll never be transitive this way. Just sort the nulls separately. This crashed ActivityManager which crashed system server. Bad. Log: E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager E AndroidRuntime: java.lang.IllegalArgumentException: Comparison method violates its general contract! E AndroidRuntime: at java.util.TimSort.mergeLo(TimSort.java:781) E AndroidRuntime: at java.util.TimSort.mergeAt(TimSort.java:518) E AndroidRuntime: at java.util.TimSort.mergeCollapse(TimSort.java:448) E AndroidRuntime: at java.util.TimSort.sort(TimSort.java:245) E AndroidRuntime: at java.util.Arrays.sort(Arrays.java:1351) E AndroidRuntime: at java.util.ArrayList.sort(ArrayList.java:1738) E AndroidRuntime: at java.util.Collections.sort(Collections.java:208) E AndroidRuntime: at com.android.server.am.PhantomProcessList.trimPhantomProcessesIfNecessary(PhantomProcessList.java:436) E AndroidRuntime: at com.android.server.am.ActivityManagerConstants$$ExternalSyntheticLambda1.run(R8$$SyntheticClass:0) ...
Loading
Please register or sign in to comment