Several apps causes a phone reboot or boot loop

New versions of some applications are causing reboot or boot loop on some Android versions/flavours. The reboot/boot loop is triggered when the affected application is installed, launched or accessed by some other means (for example during its backup).

Reported Android versions/flavors are:

  • CyanogenMod 13 [1]
  • CyanogenMod 12.1 [2][3]
  • Replicant v6.0 [4]
  • Android 5.0.2 [5]
  • (?) LineageOS 14.1 (build 20171101)

Reported applications so far are:

  • My Expenses 2.8.2 and 2.8.2.1 [1][2]
  • Power Ampache 1.09.39 [1]
  • Twidere from 3.6.29 [2]
  • Yalp Store from 0.29 [2]
  • NyaaPantsu 1.0 [2]
  • Camera Roll 1.0.3 [2]
  • DAVdroid 1.9.1 [3][4]
  • Torrent Client [5]
  • (?) KISS Launcher [5]
  • Odyssey [5]
  • Call Recorder 1.4.7
  • (?) Orgzly v1.6
  • M.A.L.P. 1.1.10
  • Open Camera 1.42
  • Document Viewer 2.8.0

The issue is probably caused by enabled AAPT2 during build. As mentioned in [3]:

If you need to build with (Android Studio & Gradle) 3.0 but are running into this bug you can disable aapt2 using -Pandroid.enableAapt2=false on the command line when doing your build.

Logcat shows that system_server crashes when the affected application is started. Following is from starting Power Ampache 1.09.39:

10-31 08:20:47.145 19215 19741 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.antoniotari.reacti veampacheapp/.ui.activities.SplashActivity bnds=[82,121][160,212] (has extras)} from uid 10005 on display 0 10-31 08:20:47.652 19215 19741 F libc : invalid address or address of corrupt block 0xb passed to dlfree 10-31 08:20:47.653 19215 19741 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdeadbaad in tid 19741 (Binder_4) 10-31 08:20:47.655 259 259 I DEBUG : property debug.db.uid not set; NOT waiting for gdb. 10-31 08:20:47.655 259 259 I DEBUG : HINT: adb shell setprop debug.db.uid 100000 10-31 08:20:47.655 259 259 I DEBUG : HINT: adb forward tcp:5039 tcp:5039 10-31 08:20:47.732 259 259 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 10-31 08:20:47.732 259 259 F DEBUG : Build fingerprint: 'SEMC/SK17i_1254-2184/SK17i:4.0.4/4.1.B.0.587/tL1_3w:user/release-keys' 10-31 08:20:47.733 259 259 F DEBUG : Revision: '0' 10-31 08:20:47.733 259 259 F DEBUG : ABI: 'arm' 10-31 08:20:47.734 259 259 F DEBUG : pid: 19215, tid: 19741, name: Binder_4 >>> system_server <<< 10-31 08:20:47.734 259 259 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xdeadbaad 10-31 08:20:47.785 259 259 F DEBUG : Abort message: 'invalid address or address of corrupt block 0xb passed to dlfree' 10-31 08:20:47.785 259 259 F DEBUG : r0 deadbaad r1 cd26227d r2 00000000 r3 42a3d500 10-31 08:20:47.785 259 259 F DEBUG : r4 0000000b r5 00000013 r6 0000003d r7 596005bc 10-31 08:20:47.785 259 259 F DEBUG : r8 596005b8 r9 596005b4 sl 596005c0 fp 00005804 10-31 08:20:47.785 259 259 F DEBUG : ip 4037461c sp 59600560 lr 4033ec97 pc 4033ec9e cpsr 600f0030 10-31 08:20:47.819 259 259 F DEBUG : 10-31 08:20:47.819 259 259 F DEBUG : backtrace: 10-31 08:20:47.819 259 259 F DEBUG : #00 pc 00033c9e /system/lib/libc.so (dlfree+797) 10-31 08:20:47.819 259 259 F DEBUG : #01 pc 00015d71 /system/lib/libandroidfw.so (android::ResStringPool::uninit()+40) 10-31 08:20:47.819 259 259 F DEBUG : #02 pc 00016ce7 /system/lib/libandroidfw.so (android::ResXMLTree::uninit()+14) 10-31 08:20:47.819 259 259 F DEBUG : #03 pc 00016cc1 /system/lib/libandroidfw.so (android::ResXMLTree::~ResXMLTree()+4) 10-31 08:20:47.819 259 259 F DEBUG : #04 pc 00011e5b /system/lib/libandroidfw.so (android::AssetManager::getPkgName(char const*)+274) 10-31 08:20:47.819 259 259 F DEBUG : #05 pc 00011ed3 /system/lib/libandroidfw.so (android::AssetManager::getBasePackageName(unsigned int)+54) 10-31 08:20:47.819 259 259 F DEBUG : #06 pc 00085da3 /system/lib/libandroid_runtime.so 10-31 08:20:47.820 259 259 F DEBUG : #07 pc 73595009 /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1f5c000) 10-31 08:20:53.651 259 259 F DEBUG : 10-31 08:20:53.651 259 259 F DEBUG : Tombstone written to: /data/tombstones/tombstone_06

References:

  1. https://forum.f-droid.org/t/system-server-crashes-after-upgrading-some-applications/1465
  2. https://forum.f-droid.org/t/several-apps-caused-bootloop-on-cm-12-1/1509
  3. #969 (closed)
  4. #973 (closed)
  5. https://forum.f-droid.org/t/some-app-updates-fail-to-install-and-force-f-droid-to-close/1556

Edit: Added more affected apps and Android 5.0.2.

Edit 2: Added more affected apps and LineageOS 14.1. Some entries have '(?)' tag which means they work for some devices.

Edited by Róbert Čerňanský