Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since update to 5.22.0 beta Signal is crashing constantly #11569

Closed
4 tasks done
bungabunga opened this issue Aug 25, 2021 · 33 comments
Closed
4 tasks done

Since update to 5.22.0 beta Signal is crashing constantly #11569

bungabunga opened this issue Aug 25, 2021 · 33 comments

Comments

@bungabunga
Copy link

bungabunga commented Aug 25, 2021


Bug description

After updating Signal to 5.22.0 beta Signal is crashing right after opening it or few seconds later. Sending a debug log is not possible. I stil get SMS notifications but not Signal messages ones.

Steps to reproduce

  • update to 5.22.0
  • open Signal
  • wait or try to click somewhere > crash

Device info

Device: Pixel 3
Android version: 11 (GrapheneOS with sandboxed Play Services compatibility layer)
Signal version: 5.22.0 beta

@partacce
Copy link

Similary to me. For me it just crashes when I launch the app.
Version: 5.22.1
Device: Pixel 4a
Android: 11 (GrapheneOS with sandboxed Play Services layer)

Logcat:

2021-08-26 11:19:10.489 11698-11792/? A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 11792 (glide-source-th), pid 11698 (crime.securesms) 2021-08-26 11:19:10.563 11805-11805/? A/DEBUG: pid: 11698, tid: 11792, name: glide-source-th >>> org.thoughtcrime.securesms <<< 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #09 pc 0000000002bb190c /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (org.thoughtcrime.securesms.mms.DecryptableStreamLocalUriFetcher.loadResource+316) 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #10 pc 00000000012669f4 /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (com.bumptech.glide.load.data.FileDescriptorAssetPathFetcher.loadResource [DEDUPED]+52) 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #11 pc 0000000000f16dcc /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (com.bumptech.glide.load.data.LocalUriFetcher.loadData+92) 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #12 pc 0000000000f25e04 /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (com.bumptech.glide.load.engine.SourceGenerator.startNext+884) 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #13 pc 0000000000f1ad68 /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (com.bumptech.glide.load.engine.DecodeJob.runGenerators+248) 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #14 pc 0000000000f1b4c0 /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (com.bumptech.glide.load.engine.DecodeJob.runWrapped+560) 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #15 pc 0000000000f1cb10 /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (com.bumptech.glide.load.engine.DecodeJob.run+176) 2021-08-26 11:19:11.190 11805-11805/? A/DEBUG: #19 pc 0000000000a2e210 /data/app/~~9Gi0iIvrwkT2aJh9ylxpGg==/org.thoughtcrime.securesms-BSzzggL0Bwj1d6DWBqdXCg==/oat/arm64/base.odex (com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run+192)

@Dopamine97
Copy link

Same. Simply just opening crashes. It never crashed before. The only thing that's changed is signal update .

@Graphenesignal2
Copy link

Graphenesignal2 commented Aug 26, 2021

Same with 5.22.1 with Pixel 3 and grapheneOS : instant crash.
But i have managed to make it working.

In the Android recents menu (swipe from bottom to the middle of the screen), there should be a Signal app tile. If i clicked on it, it crashed. But sometimes during 1s, i could see the app and that there was the rating request popup. I reclicked on the signal tile in the recents menu and tried to click the "no thanks" button before it crashes. Done. The app works now.

@inthewaves
Copy link

inthewaves commented Aug 26, 2021

This crash has been happening to me since v5.22.0 on two GrapheneOS devices (Pixel 3a and 3a XL), both of them without Play services installed. Like other users, Signal hasn't crashed like this prior to v5.22.0

  • Crashes regardless of whether it's from official builds (Play Store / Firebase) or self-built debug APKs
  • It would crash on startup regardless of whether it was on an existing installation with a registered account or a new installation.
  • If I open the app enough times (seems to be a random amount), it will reach a point where it doesn't crash until the app is force stopped or killed

From running git bisect, it seems that 214e994 is the commit that introduced this issue. This commit switches Signal to use a fork for SQLCipher: https://github.com/signalapp/maven/tree/e7875158e8027815b8bfe0693c947c351bf3fdef/sqlcipher/release/org/signal/android-database-sqlcipher/4.4.3-S1. When I reverted this commit specifically, the app stopped crashing on startup. (I can’t find a repository containing source code for version 4.4.3-S1 of android-database-sqlcipher)

Logcat output for an existing installation (seems like hardened_malloc is detecting an issue when it tries to purge memory; the first line is from https://github.com/GrapheneOS/hardened_malloc/blob/39526453181babac2ba2ef3d09a406f2b7ff0305/memory.c#L92):

08-26 12:11:03.789 20611 20633 F hardened_malloc: fatal allocator error: non-ENOMEM MADV_DONTNEED madvise failure
08-26 12:11:03.790 20611 20633 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20633 (FinalizerDaemon), pid 20611 (crime.securesms)
08-26 12:11:03.908 20681 20681 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-26 12:11:03.908 20681 20681 F DEBUG   : Build fingerprint: 'google/bonito/bonito:11/RQ3A.210805.001.A1/2021081822:user/release-keys'
08-26 12:11:03.908 20681 20681 F DEBUG   : Revision: 'MP1.0'
08-26 12:11:03.908 20681 20681 F DEBUG   : ABI: 'arm64'
08-26 12:11:03.909 20681 20681 F DEBUG   : Timestamp: 2021-08-26 12:11:03-0700
08-26 12:11:03.909 20681 20681 F DEBUG   : pid: 20611, tid: 20633, name: FinalizerDaemon  >>> org.thoughtcrime.securesms <<<
08-26 12:11:03.909 20681 20681 F DEBUG   : uid: 10113
08-26 12:11:03.909 20681 20681 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
08-26 12:11:03.909 20681 20681 F DEBUG   :     x0  0000000000000000  x1  0000000000005099  x2  0000000000000006  x3  0000006b4a5806f0
08-26 12:11:03.909 20681 20681 F DEBUG   :     x4  fefefefefefefeff  x5  fefefefefefefeff  x6  fefefefefefefeff  x7  7f7f7f7f7f7f7f7f
08-26 12:11:03.909 20681 20681 F DEBUG   :     x8  00000000000000f0  x9  037a5a98eb4dc700  x10 0000000000000000  x11 ffffffc0fffffbdf
08-26 12:11:03.909 20681 20681 F DEBUG   :     x12 0000000000000001  x13 0000000000000018  x14 0000007a6c4ba2e1  x15 002edbb427bafaef
08-26 12:11:03.909 20681 20681 F DEBUG   :     x16 0000006ce4ffbd80  x17 0000006ce4fdc6f0  x18 0000006b497aa000  x19 0000000000005083
08-26 12:11:03.909 20681 20681 F DEBUG   :     x20 0000000000005099  x21 00000000ffffffff  x22 0000006b9775c000  x23 0000006b97cb3e48
08-26 12:11:03.909 20681 20681 F DEBUG   :     x24 0000000000020300  x25 000000000000002a  x26 0000006ce5004000  x27 0000006ce4f64d40
08-26 12:11:03.909 20681 20681 F DEBUG   :     x28 0000006b97ca3e00  x29 0000006b4a580770
08-26 12:11:03.909 20681 20681 F DEBUG   :     lr  0000006ce4f90810  sp  0000006b4a5806d0  pc  0000006ce4f9083c  pst 0000000000000000
08-26 12:11:04.283 20681 20681 F DEBUG   : backtrace:
08-26 12:11:04.283 20681 20681 F DEBUG   :       #00 pc 000000000004b83c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: a15ffa894661e8db2c6d5ee3aba0e5c8)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #01 pc 0000000000042384  /apex/com.android.runtime/lib64/bionic/libc.so (fatal_error+112) (BuildId: a15ffa894661e8db2c6d5ee3aba0e5c8)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #02 pc 0000000000041b00  /apex/com.android.runtime/lib64/bionic/libc.so (memory_purge+72) (BuildId: a15ffa894661e8db2c6d5ee3aba0e5c8)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #03 pc 000000000004052c  /apex/com.android.runtime/lib64/bionic/libc.so (h_malloc_trim+748) (BuildId: a15ffa894661e8db2c6d5ee3aba0e5c8)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #04 pc 0000000000040228  /apex/com.android.runtime/lib64/bionic/libc.so (h_mallopt+16) (BuildId: a15ffa894661e8db2c6d5ee3aba0e5c8)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #05 pc 00000000001dbb04  /system/lib64/libhwui.so (android::Bitmap::~Bitmap()+60) (BuildId: d10cdd502d9f938c2bff93974f72ceff)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #06 pc 00000000001dbbc8  /system/lib64/libhwui.so (android::Bitmap::~Bitmap()+16) (BuildId: d10cdd502d9f938c2bff93974f72ceff)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #07 pc 00000000001ad700  /system/lib64/libhwui.so (android::uirenderer::VectorDrawable::Tree::~Tree()+116) (BuildId: d10cdd502d9f938c2bff93974f72ceff)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #08 pc 00000000006cf608  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+152) (BuildId: 066f2271706400e8d6314f91c6182a6c4ebc9ab6)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #09 pc 000000000282dd8c  /system/framework/arm64/boot-framework.oat (com.android.internal.util.VirtualRefBasePtr.finalize+60) (BuildId: 066f2271706400e8d6314f91c6182a6c4ebc9ab6)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #10 pc 00000000000fef74  /apex/com.android.art/javalib/arm64/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.doFinalize+100) (BuildId: ac023a89d971054a975cf1138f2c010e22afe8be)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #11 pc 00000000000ff1dc  /apex/com.android.art/javalib/arm64/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.runInternal+492) (BuildId: ac023a89d971054a975cf1138f2c010e22afe8be)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #12 pc 00000000000cbf60  /apex/com.android.art/javalib/arm64/boot-core-libart.oat (java.lang.Daemons$Daemon.run+160) (BuildId: ac023a89d971054a975cf1138f2c010e22afe8be)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #13 pc 000000000089ab78  /apex/com.android.art/javalib/arm64/boot.oat (java.lang.Thread.run+72) (BuildId: 829fbd5e82a269a36b7e5e3a2a7ec5948d488db8)
08-26 12:11:04.283 20681 20681 F DEBUG   :       #14 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:11:04.284 20681 20681 F DEBUG   :       #15 pc 00000000001a8ac8  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:11:04.284 20681 20681 F DEBUG   :       #16 pc 000000000055658c  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:11:04.284 20681 20681 F DEBUG   :       #17 pc 00000000005a6030  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:11:04.284 20681 20681 F DEBUG   :       #18 pc 00000000000ad6e4  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: a15ffa894661e8db2c6d5ee3aba0e5c8)
08-26 12:11:04.284 20681 20681 F DEBUG   :       #19 pc 000000000004d6d8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: a15ffa894661e8db2c6d5ee3aba0e5c8)

Logcat output for a new installation:

08-26 12:43:52.063 23283 23283 F hardened_malloc: fatal allocator error: non-ENOMEM MADV_DONTNEED madvise failure
08-26 12:43:52.063 23283 23283 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 23283 (crime.securesms), pid 23283 (crime.securesms)
08-26 12:43:52.182 23343 23343 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-26 12:43:52.182 23343 23343 F DEBUG   : Build fingerprint: 'google/sargo/sargo:11/RQ3A.210805.001.A1/2021.08.09.20:userdebug/test-keys'
08-26 12:43:52.182 23343 23343 F DEBUG   : Revision: 'MP1.0'
08-26 12:43:52.182 23343 23343 F DEBUG   : ABI: 'arm64'
08-26 12:43:52.183 23343 23343 F DEBUG   : Timestamp: 2021-08-26 12:43:52-0700
08-26 12:43:52.183 23343 23343 F DEBUG   : pid: 23283, tid: 23283, name: crime.securesms  >>> org.thoughtcrime.securesms <<<
08-26 12:43:52.183 23343 23343 F DEBUG   : uid: 10187
08-26 12:43:52.183 23343 23343 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
08-26 12:43:52.183 23343 23343 F DEBUG   :     x0  0000000000000000  x1  0000000000005af3  x2  0000000000000006  x3  0000007fd838aab0
08-26 12:43:52.183 23343 23343 F DEBUG   :     x4  fefefefefefefeff  x5  fefefefefefefeff  x6  fefefefefefefeff  x7  7f7f7f7f7f7f7f7f
08-26 12:43:52.183 23343 23343 F DEBUG   :     x8  00000000000000f0  x9  1550301d5f139000  x10 0000000000000000  x11 ffffffc0fffffbdf
08-26 12:43:52.183 23343 23343 F DEBUG   :     x12 0000000000000001  x13 0000000000000018  x14 000001570f191995  x15 000388f7d75ee433
08-26 12:43:52.183 23343 23343 F DEBUG   :     x16 00000068f1127d80  x17 00000068f1108730  x18 00000068f347c000  x19 0000000000005af3
08-26 12:43:52.183 23343 23343 F DEBUG   :     x20 0000000000005af3  x21 00000000ffffffff  x22 00000067cad6b000  x23 00000067cb2b2e48
08-26 12:43:52.183 23343 23343 F DEBUG   :     x24 0000000000020300  x25 000000000000002a  x26 00000068f1131000  x27 00000068f1090d40
08-26 12:43:52.183 23343 23343 F DEBUG   :     x28 00000067cb2b2e00  x29 0000007fd838ab30
08-26 12:43:52.183 23343 23343 F DEBUG   :     lr  00000068f10bc850  sp  0000007fd838aa90  pc  00000068f10bc87c  pst 0000000000000000
08-26 12:43:52.851 23343 23343 F DEBUG   : backtrace:
08-26 12:43:52.851 23343 23343 F DEBUG   :       #00 pc 000000000004b87c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #01 pc 00000000000423b0  /apex/com.android.runtime/lib64/bionic/libc.so (fatal_error+112) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #02 pc 0000000000041b00  /apex/com.android.runtime/lib64/bionic/libc.so (memory_purge+72) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #03 pc 00000000000404f4  /apex/com.android.runtime/lib64/bionic/libc.so (h_malloc_trim+692) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #04 pc 0000000000040228  /apex/com.android.runtime/lib64/bionic/libc.so (h_mallopt+16) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #05 pc 00000000007c3a1c  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+124) (BuildId: eb423e596286354be7efc039e527f48e8e95a892)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #06 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #07 pc 00000000001a8ac8  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #08 pc 000000000031881c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #09 pc 000000000030f4dc  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1840) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #10 pc 0000000000174fe8  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+45680) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #11 pc 000000000013f7d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #12 pc 000000000019f500  /system/framework/framework.jar (android.app.ActivityThread.purgePendingResources)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #13 pc 00000000003061f8  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8315201108025609822)+532) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #14 pc 000000000030e108  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+200) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #15 pc 000000000030f4c0  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1812) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #16 pc 0000000000174fe8  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+45680) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #17 pc 000000000013f7d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #18 pc 0000000000198bc4  /system/framework/framework.jar (android.app.ActivityThread.access$3500)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #19 pc 00000000003061f8  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8315201108025609822)+532) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.851 23343 23343 F DEBUG   :       #20 pc 000000000030e108  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+200) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #21 pc 000000000030eaec  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+948) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #22 pc 0000000000681464  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+552) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #23 pc 000000000012d994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #24 pc 00000000001959ec  /system/framework/framework.jar (android.app.ActivityThread$PurgeIdler.queueIdle+4)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #25 pc 00000000006801a4  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1820) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #26 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #27 pc 00000000003966a6  /system/framework/framework.jar (offset 0x91c000) (android.os.MessageQueue.next+322)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #28 pc 000000000067e74c  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1532) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #29 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #30 pc 000000000039593c  /system/framework/framework.jar (offset 0x91c000) (android.os.Looper.loop+156)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #31 pc 00000000003060f0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8315201108025609822)+268) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #32 pc 000000000030e108  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+200) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #33 pc 000000000030f4c0  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1812) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #34 pc 0000000000177f70  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+57848) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #35 pc 000000000013f7d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #36 pc 000000000019efa0  /system/framework/framework.jar (android.app.ActivityThread.main)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #37 pc 00000000003061f8  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8315201108025609822)+532) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #38 pc 000000000066d030  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+784) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #39 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #40 pc 00000000001337e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #41 pc 00000000001a8ae4  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #42 pc 0000000000557020  /apex/com.android.art/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1372) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #43 pc 00000000004d58a8  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #44 pc 000000000047a054  /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+180) (BuildId: 829fbd5e82a269a36b7e5e3a2a7ec5948d488db8)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #45 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #46 pc 00000000001a8ac8  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #47 pc 000000000031881c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #48 pc 000000000030eb08  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+976) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #49 pc 000000000067e4a4  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+852) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.852 23343 23343 F DEBUG   :       #50 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #51 pc 000000000045ce82  /system/framework/framework.jar (offset 0x1245000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #52 pc 00000000003060f0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8315201108025609822)+268) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #53 pc 000000000066d030  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+784) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #54 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #55 pc 000000000280e81c  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2284) (BuildId: eb423e596286354be7efc039e527f48e8e95a892)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #56 pc 00000000001337e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #57 pc 00000000001a8ae4  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #58 pc 0000000000555a54  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+448) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #59 pc 0000000000555f08  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #60 pc 000000000043932c  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+656) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #61 pc 0000000000099424  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+124) (BuildId: a79127a033caea8435a1a5d603658adc)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #62 pc 00000000000a08b8  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+836) (BuildId: a79127a033caea8435a1a5d603658adc)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #63 pc 0000000000003570  /system/bin/app_process64 (main+1320) (BuildId: ee5e15626548a64dbccfb13b90278bd0)
08-26 12:43:52.853 23343 23343 F DEBUG   :       #64 pc 0000000000046d4c  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)

@thestinger
Copy link

@valldrac has done research into a similar problem with Molly already. SQLCipher has completely broken usage of memory locking. They're trying to lock memory for allocations that aren't page aligned and multiples of the page size. They're also often not unlocking the memory before freeing it. They're using realloc on memory they locked despite it not preserving the locking or removing it for the freed memory. This is completely broken. It results in malloc ending up having freed pages that are memory locked where madvise with MADV_DONTNEED will return EINVAL. Since hardened_malloc is focused on security, it checks the return value of madvise for error codes indicating memory corruption and other serious logic errors in the program.

The best short term solution is likely completely disabling all the broken memory locking support until it's fixed. It's very clearly broken just from a quick glance over it. hardened_malloc is doing the right thing.

We're not going to remove our memory corruption error checking code for madvise and other system calls, although we could disable it for specific broken apps like Signal via hard-wired checks for the application name. It would be very unfortunate if we had to do that because it's an awful hack. The only case we're currently doing something like that is for the Pixel 3 camera service because the drivers have use-after-free bugs. We don't need those kind of hacks for any of the newer devices and we aren't currently doing it for apps.

@thestinger
Copy link

If memory locking is now being enabled, that's probably the issue, because the implementation is thoroughly broken. I strongly recommend disabling it until it's fixed. It's possible there's another cause, but so far this has only occurred with Molly and now apparently also Signal and we've already determined the likely cause. From the madvise man page:

EINVAL advice is MADV_DONTNEED or MADV_REMOVE and the specified address range includes locked, Huge TLB pages, or VM_PFNMAP pages.

It's simply incorrect and broken to free memory that's still memory locked. At best, malloc is going to ignore the errors for madvise and leak memory. For jemalloc in AOSP and the stock OS, it isn't zeroing memory on free and sensitive data is going to end up persisting in memory longer since MADV_DONTNEED isn't working to forcefully deallocate the pages. The difference with jemalloc is that it's treating every error code from madvise as meaning out-of-memory rather than only ENOMEM. If it fails, it just treats the memory as not successfully purged / zeroed.

@inthewaves
Copy link

With the switch back to mainline SQLCipher in 5.22.2 (faa36d4), Signal is no longer crashing for me on 5.22.2

@thestinger
Copy link

Was this switch turning on memory locking? Someone should check, since that's likely the cause.

@bungabunga
Copy link
Author

Working again with 5.22.2 beta.

@thestinger
Copy link

The issue is probably just going to come back if they deploy this again without addressing it though.

@bungabunga
Copy link
Author

@thestinger Do you think I should reopen it and leave it open?

@thestinger
Copy link

Yes.

@bungabunga
Copy link
Author

Waiting for the cause to get resolved.

@bungabunga bungabunga reopened this Aug 27, 2021
@timcappalli
Copy link

Still crashing for me on 5.22.3

@thestinger
Copy link

@timcappalli On GrapheneOS or elsewhere?

@timcappalli
Copy link

@timcappalli On GrapheneOS or elsewhere?

Pixel 5 Android 12b4.1

@thestinger
Copy link

I think you should file a separate issue. It's unlikely to be the same problem as this one which appears to be a bug uncovered by hardened_malloc on GrapheneOS.

@benys
Copy link

benys commented Aug 28, 2021

I have also crashes but diffrent reason? I also reinstal signal with restore backup. It no helps.... (5.22.3)

(Edited, I created: #11572)

@thestinger
Copy link

You should file a new issue. It's not the same problem.

@markusd112
Copy link

markusd112 commented Sep 1, 2021

I have the same problem since today (5.22.5) on a Samsung Galaxy A51 with android 11: directly after starting signal it crashes instantly, it doesn't work any longer
The days before sometimes a message is displayed "I/O error" when using signal... maybe there is relation to the crashes....
@edit2: after activating offline mode (airplane mode) signal doesn't crash any longer. When activating network it crashes again...

@thestinger
Copy link

Should open a new issue. It's not the same cause as this.

@markusd112
Copy link

Thx, I have opened #11583

@valldrac
Copy link
Contributor

valldrac commented Sep 2, 2021

I have verified that the crashes happens when the memory protection is enabled, and SQLCipher does mlock after malloc, but fails to properly munlock before free. So later when the Android framework requests a memory purge, madvice fails with EINVAL for the freed but still locked pages.

Signal disables the memory protection in the postKey callback function with PRAGMA cipher_memory_security = OFF. But this feature is enabled by default, and any library initialization code run before the PRAGMA execution could leave locked pages behind.

A quick fix could be to disable SQLCipher memory protection at compile time.

@inthewaves
Copy link

inthewaves commented Sep 3, 2021

On GrapheneOS (Build fingerprint: 'google/sargo/sargo:11/RQ3A.210805.001.A1/2021.08.09.20:userdebug/test-keys'), the new Signal 5.23.0 beta version makes use of the SQLCipher fork again, although it's using a newer version of their fork (org.signal:android-database-sqlcipher:4.4.3-S2): fa26eb2.

Signal 5.23.0 for me brings back the crashing on startup with the same error line of 09-02 19:29:08.428 19884 19908 F hardened_malloc: fatal allocator error: non-ENOMEM MADV_DONTNEED madvise failure . I've checked that the SQLCipher fork change is causing crashes by reverting fa26eb2 and then retesting to find that the app doesn't crash anymore on startup.

Here's a logcat output from when the app starts to when the app is killed:

09-02 19:29:07.117 19884 19884 W Zygote  : Can't access app profile directory: /data_mirror/cur_profiles/0/org.thoughtcrime.securesms
09-02 19:29:07.226 19884 19884 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 10188 <<<<<<
09-02 19:29:07.230 19884 19884 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.profilebootclasspath"
09-02 19:29:07.230 19884 19884 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.enable_apex_image"
09-02 19:29:07.229 19884 19884 W crime.securesms: type=1400 audit(0.0:7314): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=11550 scontext=u:r:untrusted_app:s0:c188,c256,c512,c768 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0 app=org.thoughtcrime.securesms
09-02 19:29:07.230 19884 19884 I AndroidRuntime: Using default boot image
09-02 19:29:07.230 19884 19884 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.disable_lock_profiling"
09-02 19:29:07.230 19884 19884 I AndroidRuntime: Leaving lock profiling enabled
09-02 19:29:07.230 19884 19884 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.enable_generational_cc"
09-02 19:29:07.234 19884 19884 I org.thoughtcrime.securesms: Core platform API reporting enabled, enforcing=false
09-02 19:29:07.229 19884 19884 W crime.securesms: type=1400 audit(0.0:7315): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=11550 scontext=u:r:untrusted_app:s0:c188,c256,c512,c768 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0 app=org.thoughtcrime.securesms
09-02 19:29:02.451 19884 19884 W audit   : audit_lost=5715 audit_rate_limit=5 audit_backlog_limit=64
09-02 19:29:02.451 19884 19884 E audit   : rate limit exceeded
09-02 19:29:07.229 19884 19884 I chatty  : uid=10188(org.thoughtcrime.securesms) identical 1 line
09-02 19:29:07.229 19884 19884 W crime.securesms: type=1400 audit(0.0:7317): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=11550 scontext=u:r:untrusted_app:s0:c188,c256,c512,c768 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0 app=org.thoughtcrime.securesms
09-02 19:29:07.232 19884 19884 W crime.securesms: type=1400 audit(0.0:7318): avc: denied { lock } for path="/apex/com.android.art/javalib/arm64/boot.art" dev="dm-4" ino=154 scontext=u:r:untrusted_app:s0:c188,c256,c512,c768 tcontext=u:object_r:system_file:s0 tclass=file permissive=0 app=org.thoughtcrime.securesms
09-02 19:29:07.235 19884 19884 W crime.securesms: type=1400 audit(0.0:7319): avc: denied { lock } for path="/apex/com.android.art/javalib/arm64/boot-core-libart.art" dev="dm-4" ino=148 scontext=u:r:untrusted_app:s0:c188,c256,c512,c768 tcontext=u:object_r:system_file:s0 tclass=file permissive=0 app=org.thoughtcrime.securesms
09-02 19:29:07.239 19884 19884 W crime.securesms: type=1400 audit(0.0:7321): avc: denied { lock } for path="/apex/com.android.art/javalib/arm64/boot-okhttp.art" dev="dm-4" ino=151 scontext=u:r:untrusted_app:s0:c188,c256,c512,c768 tcontext=u:object_r:system_file:s0 tclass=file permissive=0 app=org.thoughtcrime.securesms
09-02 19:29:07.340 19884 19884 D org.thoughtcrime.securesms: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
09-02 19:29:07.340 19884 19884 D org.thoughtcrime.securesms: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt66l.dat
09-02 19:29:07.365 19884 19884 W org.thoughtcrime.securesms: JNI RegisterNativeMethods: attempt to register 0 native methods for android.media.AudioAttributes
09-02 19:29:07.372 19884 19884 D AndroidRuntime: Calling main entry com.android.internal.os.ExecInit
09-02 19:29:07.372 19884 19884 D Zygote  : begin preload
09-02 19:29:07.373 19884 19884 I Zygote  : Calling ZygoteHooks.beginPreload()
09-02 19:29:07.378 19884 19884 D ExecInitTiming: BeginPreload took to complete: 5ms
09-02 19:29:07.378 19884 19884 I Zygote  : Preloading shared libraries...
09-02 19:29:07.481 19884 19884 I Zygote  : Called ZygoteHooks.endPreload()
09-02 19:29:07.498 19884 19884 I Zygote  : Installed AndroidKeyStoreProvider in 17ms.
09-02 19:29:07.498 19884 19884 D Zygote  : end preload
09-02 19:29:07.526 19884 19884 I org.thoughtcrime.securesms: The ClassLoaderContext is a special shared library.
09-02 19:29:07.547 19884 19884 I PackageParser: Skipping target and overlay pair com.android.settings and /product/overlay/SettingsOverlayG020G_VN.apk: overlay ignored due to required system property: ro.boot.hardware.sku,ro.boot.hardware.coo with value: G020G,VN
09-02 19:29:07.560 19884 19884 I PackageParser: Skipping target and overlay pair com.android.settings and /product/overlay/SettingsOverlayG020E.apk: overlay ignored due to required system property: ro.boot.hardware.sku with value: G020E
09-02 19:29:07.561 19884 19884 I PackageParser: Skipping target and overlay pair com.android.settings and /product/overlay/SettingsOverlayG020F_VN.apk: overlay ignored due to required system property: ro.boot.hardware.sku,ro.boot.hardware.coo with value: G020F,VN
09-02 19:29:07.563 19884 19884 I PackageParser: Skipping target and overlay pair com.android.settings and /product/overlay/SettingsOverlayG020E_VN.apk: overlay ignored due to required system property: ro.boot.hardware.sku,ro.boot.hardware.coo with value: G020E,VN
09-02 19:29:07.567 19884 19884 I PackageParser: Skipping target and overlay pair com.android.settings and /product/overlay/SettingsOverlayG020F.apk: overlay ignored due to required system property: ro.boot.hardware.sku with value: G020F
09-02 19:29:07.578 19884 19884 I PackageParser: Skipping target and overlay pair com.android.settings and /product/overlay/SettingsOverlayG020H_VN.apk: overlay ignored due to required system property: ro.boot.hardware.sku,ro.boot.hardware.coo with value: G020H,VN
09-02 19:29:07.578 19884 19884 I PackageParser: Skipping target and overlay pair com.android.settings and /product/overlay/SettingsOverlayG020H.apk: overlay ignored due to required system property: ro.boot.hardware.sku with value: G020H
09-02 19:29:07.587 19884 19884 D NetworkSecurityConfig: No Network Security Config specified, using platform default
09-02 19:29:07.587 19884 19884 D NetworkSecurityConfig: No Network Security Config specified, using platform default
09-02 19:29:07.593 19884 19884 I MultiDex: VM with version 2.1.0 has multidex support
09-02 19:29:07.593 19884 19884 I MultiDex: Installing application
09-02 19:29:07.593 19884 19884 I MultiDex: VM has multidex support, MultiDex support library is disabled.
09-02 19:29:07.598 19884 19884 D CompatibilityChangeReporter: Compat change id reported: 1531297613045645771; UID 10188; state: DISABLED
09-02 19:29:07.598 19884 19884 D CompatibilityChangeReporter: Compat change id reported: 7528921493777479941; UID 10188; state: DISABLED
09-02 19:29:07.609 19884 19884 I FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
09-02 19:29:07.619 19884 19884 I FirebaseInitProvider: FirebaseApp initialization successful
09-02 19:29:07.620 19884 19884 I PartProvider: onCreate()
09-02 19:29:07.622 19884 19884 I BlobContentProvider: onCreate()
09-02 19:29:07.660 19884 19884 I ApplicationContext: Installed AesGcmProvider: 1
09-02 19:29:07.675  2076  2227 I com.android.systemui: NativeAlloc concurrent copying GC freed 68526(2887KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 10MB/34MB, paused 65us total 127.367ms
09-02 19:29:07.746 19884 19884 V NativeCrypto: Registering org/conscrypt/NativeCrypto's 284 native methods...
09-02 19:29:07.748  1029  1029 D NotificationService: 0|org.thoughtcrime.securesms|313399|null|10188: granting content://settings/system/notification_sound
09-02 19:29:07.751 19884 19884 I ApplicationContext: Installed Conscrypt provider: 2
09-02 19:29:07.749  1029  1029 I chatty  : uid=1000 system_server identical 2 lines
09-02 19:29:07.750  1029  1029 D NotificationService: 0|org.thoughtcrime.securesms|313399|null|10188: granting content://settings/system/notification_sound
09-02 19:29:07.751  1029  1029 W NotificationHistory: Attempted to add notif for locked/gone/disabled user 0
09-02 19:29:07.762  2076  2076 D InterruptionStateProvider: No bubble up: not allowed to bubble: 0|org.thoughtcrime.securesms|313399|null|10188
09-02 19:29:07.763  2076  2076 D InterruptionStateProvider: No heads up: unimportant notification: 0|org.thoughtcrime.securesms|313399|null|10188
09-02 19:29:07.807 19884 19884 I ApplicationContext: onCreate()
09-02 19:29:07.819 19884 19923 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.819 19884 19884 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.832 19884 19884 I KeyValueDatabase: onOpen()
09-02 19:29:07.833 19884 19884 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.834 19884 19923 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.840 19884 19884 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.862 19884 19923 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.879 19884 19925 D NotificationChannels: ensureCustomChannelConsistency()
09-02 19:29:07.886 19884 19924 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.892 19884 19926 D CompatibilityChangeReporter: Compat change id reported: 147600208; UID 10188; state: ENABLED
09-02 19:29:07.897 19884 19884 D ApplicationMigrations: Not an update. Skipping.
09-02 19:29:07.901 19884 19884 D CallManager: Loading ringrtc library
09-02 19:29:07.905 19884 19884 I CallManager: CallManager.initialize(): (release build)
09-02 19:29:07.906 19884 19884 I org.webrtc.Logging: NativeLibrary: Loading native library: jingle_peerconnection_so
09-02 19:29:07.907 19884 19884 I org.webrtc.Logging: PeerConnectionFactory: PeerConnectionFactory was initialized without an injected Loggable. Any existing Loggable will be deleted.
09-02 19:29:07.908 19884 19884 I CallManager: CallManager.initialize() returned
09-02 19:29:07.911  1029  1054 I ProcessStatsService: Pruning old procstats: /data/system/procstats/state-2021-08-27-08-15-49.bin
09-02 19:29:07.912 19884 19928 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.915 19884 19884 I IncomingMessageObserver: Initializing! (131149857)
09-02 19:29:07.916 19884 19929 I IncomingMessageObserver: Waiting for websocket state change....
09-02 19:29:07.921 19884 19884 D DynamicTheme: Setting to follow system expecting: 32
09-02 19:29:07.922 19884 19884 D CachedInflater: Clearing view cache.
09-02 19:29:07.925 19884 19884 I FeatureFlags: init() {android.animatedStickerMinMemory=193, android.animatedStickerMinTotalMemory=3072, android.automaticSessionReset.2=true, android.automaticSessionResetInterval=3600, android.calling.groupCallRinging=false, android.defaultMaxBackoff=60, android.donate=false, android.internalUser=false, android.mediaQuality.levels=1:2,61:2,81:2,82:2,65:2,31:2,47:2,41:2,32:2,385:2,971:2,974:2,49:2,33:2,*:1, android.okhttpAutomaticRetry=true, android.retryReceiptLifespan=3600000, android.retryReceipts=true, android.retryRespondMaxAge=1209600000, android.senderKey.5=true, android.suggestSmsBlacklist=91, android.usernames=false, cds.syncInterval.seconds=604800, global.calling.maxGroupCallRingSize=16, global.groupsv2.groupSizeHardLimit=1001, global.groupsv2.maxGroupSize=151}
09-02 19:29:07.926 19884 19930 D BlobProvider: No attachment drafts exist. Skipping.
09-02 19:29:07.926 19884 19930 I BlobProvider: Initialized.
09-02 19:29:07.927 19884 19884 D AppStartup: [init] security-provider: 93  sqlcipher-init: 6  logging: 51  crash-handling: 0  rx-init: 0  app-dependencies: 1  notification-channels: 69  first-launch: 0  app-migrations: 19  ring-rtc: 11  mark-registration: 0  lifecycle-observer: 0  message-retriever: 12  dynamic-theme: 3  vector-compat: 0  proxy-init: 0  blob-provider: 0  feature-flags: 2  schedule-non-blocking: 1  total: 268
09-02 19:29:07.927 19884 19884 D ApplicationContext: onCreate() took 271 ms
09-02 19:29:07.933 19884 19928 I JobDatabase: onOpen()
09-02 19:29:07.935 19884 19926 I JobManager: Waiting for initialization...
09-02 19:29:07.935 19884 19930 I PersistentAlarmManagerL: RotateSignedPreKeyListener#onReceive(null)
09-02 19:29:07.937 19884 19930 I PersistentAlarmManagerL: class org.thoughtcrime.securesms.service.RotateSignedPreKeyListener scheduling for: 1630718957449 action: null
09-02 19:29:07.941 19884 19929 I TetheringManager: registerTetheringEventCallback:org.thoughtcrime.securesms
09-02 19:29:07.942 19884 19930 I PersistentAlarmManagerL: DirectoryRefreshListener#onReceive(null)
09-02 19:29:07.943 19884 19930 I PersistentAlarmManagerL: class org.thoughtcrime.securesms.service.DirectoryRefreshListener scheduling for: 1630799958552 action: null
09-02 19:29:07.945 19884 19930 I PersistentAlarmManagerL: RotateSenderCertificateListener#onReceive(null)
09-02 19:29:07.945 19884 19929 D IncomingMessageObserver: Network: true, Foreground: false, FCM: false, Censored: false, Registered: true, Websocket Registered: true, Proxy: false
09-02 19:29:07.946 19884 19929 I IncomingMessageObserver: Making websocket connection....
09-02 19:29:07.946 19884 19930 I PersistentAlarmManagerL: class org.thoughtcrime.securesms.service.RotateSenderCertificateListener scheduling for: 1630721893413 action: null
09-02 19:29:07.948 19884 19928 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.951 19884 19937 D libEGL  : loaded /vendor/lib64/egl/libEGL_adreno.so
09-02 19:29:07.953 19884 19930 I MessageProcessReceiver: Alarm scheduled to repeat at interval 21600000
09-02 19:29:07.967 19884 19929 I WebSocketConnection: [normal:58005634] connect()
09-02 19:29:07.969 19884 19924 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:07.978 19884 19884 I AppStartup: Received first critical render event.
09-02 19:29:07.980 19884 19937 D libEGL  : loaded /vendor/lib64/egl/libGLESv1_CM_adreno.so
09-02 19:29:07.981 19884 19884 D DynamicTheme: Previous night mode has changed previous: 0 now: 32
09-02 19:29:07.981 19884 19884 D CachedInflater: Clearing view cache.
09-02 19:29:07.989 19884 19884 D PassphraseRequiredActiv: routeApplicationState(), state: 0
09-02 19:29:07.989 19884 19884 D BaseActivity: [MainActivity] onCreate()
09-02 19:29:07.990 19884 19937 D libEGL  : loaded /vendor/lib64/egl/libGLESv2_adreno.so
09-02 19:29:07.997 19884 19928 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.008 19884 19924 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.015 19884 19926 I JobManager: Initialization complete.
09-02 19:29:08.032 19884 19933 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.035 19884 19929 I WebSocketConnection: [unidentified:246423302] connect()
09-02 19:29:08.037 19884 19884 D CachedInflater: Clearing view cache.
09-02 19:29:08.042 19884 19884 D BaseActivity: [MainActivity] onStart()
09-02 19:29:08.045 19884 19884 D LoggingFragment: [ConversationListFragmen] onCreate()
09-02 19:29:08.048 19884 19929 D IncomingMessageObserver: Network: true, Foreground: false, FCM: false, Censored: false, Registered: true, Websocket Registered: true, Proxy: false
09-02 19:29:08.048 19884 19929 D IncomingMessageObserver: Reading message...
09-02 19:29:08.064 19884 19925 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.072 19884 19926 I Job     : [JOB::01d9afc2-294e-4859-8989-000b3827d337][FcmRefreshJob] onSubmit() (Time Since Submission: 139 ms, Lifespan: 300000 ms, Run Attempt: 1/1)
09-02 19:29:08.073 19884 19926 D StorageSyncHelper: No need for sync. Last sync was 562353 ms ago.
09-02 19:29:08.098 19884 19934 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.128 19884 19934 D PendingRetryReceiptMana: No pending receipts to schedule.
09-02 19:29:08.134 19884 19944 I JobRunner: [JOB::01d9afc2-294e-4859-8989-000b3827d337][FcmRefreshJob][1] Running job. (Time Since Submission: 117 ms, Lifespan: 300000 ms, Run Attempt: 1/1)
09-02 19:29:08.143 19884 19944 I JobRunner: [JOB::01d9afc2-294e-4859-8989-000b3827d337][FcmRefreshJob][1] Job finished with result SUCCESS in 10 ms. (Time Since Submission: 127 ms, Lifespan: 300000 ms, Run Attempt: 1/1)
09-02 19:29:08.143 19884 19933 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.166 19884 19930 I ApplicationContext: Deleted 0 abandoned attachments.
09-02 19:29:08.169 19884 19930 I JobSchedulerScheduler: JobScheduler enqueue of NETWORK (-1733499378)
09-02 19:29:08.179 19884 19933 I ViewOnceMessageManager: No messages to schedule.
09-02 19:29:08.180 19884 19933 I ViewOnceMessageManager: No messages to schedule.
09-02 19:29:08.200 19884 19951 D ConversationListDataSou: [size(), UnarchivedConversationListDataSource] 10 ms
09-02 19:29:08.203 19884 19950 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.221 19884 19950 I MegaphoneDatabase: onOpen()
09-02 19:29:08.222 19884 19884 D LoggingFragment: [ConversationListFragmen] onStart()
09-02 19:29:08.224 19884 19950 I SQLiteConnection: Database keying operation returned:0
09-02 19:29:08.238 19884 19884 I ApplicationContext: App is now visible.
09-02 19:29:08.251 19884 19884 D FrameRateTracker: Beginning frame rate tracking. Screen refresh rate: 60.00 hz, or 16.67 ms per frame.
09-02 19:29:08.253 19884 19884 D ApplicationContext: onStart() took 15 ms
09-02 19:29:08.253 19884 19930 I FeatureFlags: Skipping remote config refresh. Refreshed 669990 ms ago.
09-02 19:29:08.255 19884 19884 D MediaBrowserCompat: Connecting to a MediaBrowserService.
09-02 19:29:08.257 19884 19930 I RetrieveProfileJob: Too soon to refresh. Did the last refresh 670738 ms ago.
09-02 19:29:08.258 19884 19930 I GroupV1MigrationJob: Too soon to refresh. Did the last refresh 670775 ms ago.
09-02 19:29:08.265 19884 19953 D ConversationListDataSou: [load(0, 6), UnarchivedConversationListDataSource] cursor: 58  cache-recipients: 4  total: 62
09-02 19:29:08.276   822   822 I sensors-hal: batch_physical_sensor:285, android.sensor.accelerometer/11, period=2500000, max_latency=0
09-02 19:29:08.276   822   822 I sensors-hal: batch_physical_sensor:296, android.sensor.accelerometer/11, period=2500000, max_latency=0 request completed
09-02 19:29:08.278   822   822 I sensors-hal: flush_physical_sensor:328, android.sensor.accelerometer/11
09-02 19:29:08.279   822   822 I sensors-hal: flush_physical_sensor:336, android.sensor.accelerometer/11 completed
09-02 19:29:08.284 19884 19924 D LiveRecipientCache: Warming up 6 thread recipients.
09-02 19:29:08.284   822   908 D ASH     : @ 531018.225: SensorType 195 resampler quality 1
09-02 19:29:08.295 19884 19884 I JobManager: onConstraintMet(NetworkConstraintObserv)
09-02 19:29:08.306 19884 19924 D LiveRecipientCache: Warmed up 4 contact recipient.
09-02 19:29:08.306 19884 19924 D LiveRecipientCache: [recipient-warm-up] thread: 31  contact: 20  total: 51
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: QUALCOMM build                   : 781e7d0, I46ff5fc46f
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: Build Date                       : 12/01/20
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.31.04.01
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: Local Branch                     : QPR1
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: Remote Branch                    : 
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: Remote Branch                    : 
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: Reconstruct Branch               : 
09-02 19:29:08.323 19884 19935 I AdrenoGLES-0: Build Config                     : C P 11.0.1 AArch64
09-02 19:29:08.324 19884 19935 I AdrenoGLES-0: Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
09-02 19:29:08.346 19884 19935 I AdrenoGLES-0: PFP: 0x016ee189, ME: 0x00000000
09-02 19:29:08.350 19884 19935 W AdrenoUtils: <ReadGpuID_from_sysfs:197>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model
09-02 19:29:08.350 19884 19935 W AdrenoUtils: <ReadGpuID:221>: Failed to read chip ID from gpu_model. Fallback to use the GSL path
09-02 19:29:08.413 19884 19926 D EmojiFiles: Verifying all name files exist.
09-02 19:29:08.414 19884 19926 D EmojiFiles: All names exist? true
09-02 19:29:08.428 19884 19908 F hardened_malloc: fatal allocator error: non-ENOMEM MADV_DONTNEED madvise failure
09-02 19:29:08.428 19884 19908 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 19908 (FinalizerDaemon), pid 19884 (crime.securesms)
09-02 19:29:08.498  2076  2076 D InterruptionStateProvider: No bubble up: not allowed to bubble: 0|org.thoughtcrime.securesms|313399|null|10188
09-02 19:29:08.499  2076  2076 D InterruptionStateProvider: No heads up: unimportant notification: 0|org.thoughtcrime.securesms|313399|null|10188
09-02 19:29:08.507  2076  2076 D InterruptionStateProvider: No bubble up: not allowed to bubble: 0|org.thoughtcrime.securesms|313399|null|10188
09-02 19:29:08.508  2076  2076 D InterruptionStateProvider: No heads up: unimportant notification: 0|org.thoughtcrime.securesms|313399|null|10188
09-02 19:29:08.523 19961 19961 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
09-02 19:29:08.524   758   758 I tombstoned: received crash request for pid 19908
09-02 19:29:08.525 19961 19961 I crash_dump64: performing dump of process 19884 (target tid = 19908)
09-02 19:29:08.542 19884 19941 I WebSocketConnection: [normal:58005634] onOpen() connected
09-02 19:29:08.542 19884 19943 I WebSocketConnection: [unidentified:246423302] onOpen() connected
09-02 19:29:08.550 19884 19964 W AlarmSleepTimer: Setting alarm to wake up in 55000ms.
09-02 19:29:08.552 19884 19929 I IncomingMessageObserver: Network was newly-drained. Enqueuing a job to listen for decryption draining.
09-02 19:29:08.555 19961 19961 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-02 19:29:08.555 19961 19961 F DEBUG   : Build fingerprint: 'google/sargo/sargo:11/RQ3A.210805.001.A1/2021.08.09.20:userdebug/test-keys'
09-02 19:29:08.555 19961 19961 F DEBUG   : Revision: 'MP1.0'
09-02 19:29:08.555 19961 19961 F DEBUG   : ABI: 'arm64'
09-02 19:29:08.557 19961 19961 F DEBUG   : Timestamp: 2021-09-02 19:29:08-0700
09-02 19:29:08.557 19961 19961 F DEBUG   : pid: 19884, tid: 19908, name: FinalizerDaemon  >>> org.thoughtcrime.securesms <<<
09-02 19:29:08.557 19961 19961 F DEBUG   : uid: 10188
09-02 19:29:08.557 19961 19961 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
09-02 19:29:08.557 19961 19961 F DEBUG   :     x0  0000000000000000  x1  0000000000004dc4  x2  0000000000000006  x3  0000005f4b4408a0
09-02 19:29:08.557 19961 19961 F DEBUG   :     x4  fefefefefefefeff  x5  fefefefefefefeff  x6  fefefefefefefeff  x7  7f7f7f7f7f7f7f7f
09-02 19:29:08.557 19961 19961 F DEBUG   :     x8  00000000000000f0  x9  c67cfc66ce168500  x10 0000000000000000  x11 ffffffc0fffffbdf
09-02 19:29:08.557 19961 19961 F DEBUG   :     x12 0000000000000001  x13 0000000000000018  x14 00000945d64b1235  x15 00196154fce6c13d
09-02 19:29:08.557 19961 19961 F DEBUG   :     x16 00000061340c2d80  x17 00000061340a3730  x18 0000005f49654000  x19 0000000000004dac
09-02 19:29:08.557 19961 19961 F DEBUG   :     x20 0000000000004dc4  x21 00000000ffffffff  x22 0000005fbcc15000  x23 0000005fbd16ce48
09-02 19:29:08.557 19961 19961 F DEBUG   :     x24 0000000000020300  x25 000000000000002a  x26 00000061340cc000  x27 000000613402bd40
09-02 19:29:08.557 19961 19961 F DEBUG   :     x28 0000005fbd15ce00  x29 0000005f4b440920
09-02 19:29:08.557 19961 19961 F DEBUG   :     lr  0000006134057850  sp  0000005f4b440880  pc  000000613405787c  pst 0000000000000000
09-02 19:29:08.557 19884 19929 I Job     : [JOB::bf65b936-316a-481e-b5c1-f2856f57cb48][PushDecryptDrainedJob] onSubmit() (Time Since Submission: 2 ms, Lifespan: Immortal, Run Attempt: 1/1)
09-02 19:29:08.558 19884 19930 I JobSchedulerScheduler: JobScheduler enqueue of  (0)
09-02 19:29:08.559 19884 19944 I JobRunner: [JOB::bf65b936-316a-481e-b5c1-f2856f57cb48][PushDecryptDrainedJob][1] Running job. (Time Since Submission: 4 ms, Lifespan: Immortal, Run Attempt: 1/1)
09-02 19:29:08.561 19884 19929 D IncomingMessageObserver: Network: true, Foreground: true, FCM: false, Censored: false, Registered: true, Websocket Registered: true, Proxy: false
09-02 19:29:08.561 19884 19929 D IncomingMessageObserver: Reading message...
09-02 19:29:08.563 19884 19944 I PushDecryptDrainedJob: Decryptions are caught-up.
09-02 19:29:08.563 19884 19944 I IncomingMessageObserver: Decryptions newly drained.
09-02 19:29:08.563 19884 19944 I JobManager: onConstraintMet(DecryptionsDrainedConst)
09-02 19:29:08.565 19884 19944 I JobRunner: [JOB::bf65b936-316a-481e-b5c1-f2856f57cb48][PushDecryptDrainedJob][1] Job finished with result SUCCESS in 6 ms. (Time Since Submission: 10 ms, Lifespan: Immortal, Run Attempt: 1/1)
09-02 19:29:08.767 19884 19923 D LogDatabase: [trim] keepers-size: 59  binary-search: 875  delete: 24  total: 958
09-02 19:29:08.931 19961 19961 F DEBUG   : backtrace:
09-02 19:29:08.931 19961 19961 F DEBUG   :       #00 pc 000000000004b87c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #01 pc 00000000000423b0  /apex/com.android.runtime/lib64/bionic/libc.so (fatal_error+112) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #02 pc 0000000000041b00  /apex/com.android.runtime/lib64/bionic/libc.so (memory_purge+72) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #03 pc 000000000004052c  /apex/com.android.runtime/lib64/bionic/libc.so (h_malloc_trim+748) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #04 pc 0000000000040228  /apex/com.android.runtime/lib64/bionic/libc.so (h_mallopt+16) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #05 pc 00000000001dbb04  /system/lib64/libhwui.so (android::Bitmap::~Bitmap()+60) (BuildId: d10cdd502d9f938c2bff93974f72ceff)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #06 pc 00000000001dbbc8  /system/lib64/libhwui.so (android::Bitmap::~Bitmap()+16) (BuildId: d10cdd502d9f938c2bff93974f72ceff)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #07 pc 00000000001ad700  /system/lib64/libhwui.so (android::uirenderer::VectorDrawable::Tree::~Tree()+116) (BuildId: d10cdd502d9f938c2bff93974f72ceff)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #08 pc 00000000006cf608  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+152) (BuildId: eb423e596286354be7efc039e527f48e8e95a892)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #09 pc 000000000282db3c  /system/framework/arm64/boot-framework.oat (com.android.internal.util.VirtualRefBasePtr.finalize+60) (BuildId: eb423e596286354be7efc039e527f48e8e95a892)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #10 pc 00000000000fef74  /apex/com.android.art/javalib/arm64/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.doFinalize+100) (BuildId: ac023a89d971054a975cf1138f2c010e22afe8be)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #11 pc 00000000000ff1dc  /apex/com.android.art/javalib/arm64/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.runInternal+492) (BuildId: ac023a89d971054a975cf1138f2c010e22afe8be)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #12 pc 00000000000cbf60  /apex/com.android.art/javalib/arm64/boot-core-libart.oat (java.lang.Daemons$Daemon.run+160) (BuildId: ac023a89d971054a975cf1138f2c010e22afe8be)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #13 pc 000000000089ab78  /apex/com.android.art/javalib/arm64/boot.oat (java.lang.Thread.run+72) (BuildId: 829fbd5e82a269a36b7e5e3a2a7ec5948d488db8)
09-02 19:29:08.931 19961 19961 F DEBUG   :       #14 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
09-02 19:29:08.932 19961 19961 F DEBUG   :       #15 pc 00000000001a8ac8  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
09-02 19:29:08.932 19961 19961 F DEBUG   :       #16 pc 000000000055658c  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
09-02 19:29:08.932 19961 19961 F DEBUG   :       #17 pc 00000000005a6030  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: 8225d6ae4ee980386aca32d36788bc5d)
09-02 19:29:08.932 19961 19961 F DEBUG   :       #18 pc 00000000000ad724  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
09-02 19:29:08.932 19961 19961 F DEBUG   :       #19 pc 000000000004d718  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: aea9c714e924492ceb4a137fbe8d9fec)
09-02 19:29:04.335   608   608 D logd    : logdr: UID=10188 GID=10188 PID=19961 n tail=50 logMask=8 pid=19884 start=0ns timeout=0ns
09-02 19:29:04.374   608   608 D logd    : logdr: UID=10188 GID=10188 PID=19961 n tail=50 logMask=1 pid=19884 start=0ns timeout=0ns
09-02 19:29:05.142   608   608 D logd    : logdr: UID=10188 GID=10188 PID=19961 n tail=0 logMask=8 pid=19884 start=0ns timeout=0ns
09-02 19:29:05.162   608   608 D logd    : logdr: UID=10188 GID=10188 PID=19961 n tail=0 logMask=1 pid=19884 start=0ns timeout=0ns
09-02 19:29:09.981  1029 19971 I DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
09-02 19:29:09.982   758   758 E tombstoned: Tombstone written to: /data/tombstones/tombstone_08
09-02 19:29:09.982  1029 19970 W ActivityTaskManager:   Force finishing activity org.thoughtcrime.securesms/.RoutingActivity
09-02 19:29:09.988  1029  1063 I BootReceiver: Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)
09-02 19:29:09.990  1029  1063 I DropBoxManagerService: add tag=SYSTEM_TOMBSTONE isTagEnabled=true flags=0x2
09-02 19:29:05.439     1     1 I init    : Untracked pid 19961 exited with status 0
09-02 19:29:10.257  1029 11815 I ActivityManager: Process org.thoughtcrime.securesms (pid 19884) has died: fg  TOP 
09-02 19:29:05.466     1     1 I init    : Untracked pid 19963 exited with status 0
09-02 19:29:10.257   822   822 I sensors-hal: batch_physical_sensor:285, android.sensor.accelerometer/11, period=66667000, max_latency=0
09-02 19:29:10.258  1029  7370 I WindowManager: WIN DEATH: Window{ea2f51a u0 org.thoughtcrime.securesms/org.thoughtcrime.securesms.RoutingActivity}
09-02 19:29:10.258  1029  7370 W InputDispatcher: Attempted to unregister already unregistered input channel 'ea2f51a org.thoughtcrime.securesms/org.thoughtcrime.securesms.RoutingActivity (server)'
09-02 19:29:10.258   822   822 I sensors-hal: batch_physical_sensor:296, android.sensor.accelerometer/11, period=66667000, max_latency=0 request completed
09-02 19:29:10.260   764   764 I Zygote  : Process 19884 exited due to signal 6 (Aborted)
09-02 19:29:10.266  1029  1057 I libprocessgroup: Successfully killed process cgroup uid 10188 pid 19884 in 7ms
09-02 19:29:10.270  1029 11815 W ActivityManager: Scheduling restart of crashed service org.thoughtcrime.securesms/.messages.IncomingMessageObserver$ForegroundService in 18000000ms for start-requested
09-02 19:29:10.270  1029 11815 W ActivityManager: Scheduling restart of crashed service org.thoughtcrime.securesms/.jobmanager.JobSchedulerScheduler$SystemService in 1000ms for connection

@inthewaves
Copy link

https://community.signalusers.org/t/beta-feedback-for-the-upcoming-android-5-23-release/36545/29

Thanks, we are working directly with sqlcipher folks to address this! They’ve been made aware.

@rehork
Copy link

rehork commented Sep 4, 2021

Hi, thanks for this bug. It's essential one to me. I've reported another similar issue #11508
This bug is so annoying that I've started thinking about changing the communicator, cause for me currently it's pretty hard to use your application. Version 5.22.7 still freezes.

I'm not entirely sure, but I started noticing the issue after Signal update when customization (backgrounds, fonts, etc.) for chats have been implemented. Maybe it would be helpful.

@inthewaves
Copy link

inthewaves commented Sep 9, 2021

Signal beta version 5.23.3 no longer has fatal crashes for me (on a self-compiled build).

The commit in 5.23.3 that updates their SQLCIpher fork (to version 4.4.3-S3) is bb446ac. Since the commit also involves removing the PRAGMA cipher_memory_security = OFF; statement from the postKey callback, it seems that they've likely disabled memory protection in the library itself or fixed the underlying issue.

@greyson-signal
Copy link
Contributor

Yeah, by default the new SQLCipher has memory protection off and people can instead choose to enable it. Glad it's fixed 👍

@johanw666
Copy link
Contributor

But ultimately you want the memory protection, but without the bugs that are causing it to crash on GrapheneOS.

@inthewaves
Copy link

Signal has had memory protection disabled since they updated to major version 4 of SQLCipher, so it's likely they were having issues with it beforehand.

@greyson-signal
Copy link
Contributor

The issue is that it's very slow. I believe it was 6x slower for most of our core queries.

@thestinger
Copy link

That's tied to the same issue that's causing crashes: it's not really being done properly. Memory locking works on a page level but in SQLCipher implemented as if it's reasonable to do it for individual tiny malloc allocations. It could only correctly do that if all the allocations were page-aligned and sized to multiples of the page size. It's important to remember to unlock it before freeing it though, and presumably after using MADV_DONTNEED to drop/clear the memory perhaps with memset as a fallback if madvise returns an error.

That adds the overhead of a system call for allocation and another one for free. It also means realloc can't be used safely and the application has to just allocate, memory lock, copy to that, clear the old memory, unlock it and free it. Since it's currently not always remembering to unlock before freeing, it's also effectively leaking memory, since malloc can't purge with madvise and hardened_malloc just has the unique property of actually checking for errors and treating non-ENOMEM errors as serious logic errors in the program. This is actually a serious problem because it prevents dropping that memory via madvise. It could be replaced with fresh pages but it can't really be expected that malloc identifies the bug, confirms it via /proc/self/maps to make sure it's not caused by the application unmapping part of it and then it could replace the mapping.

@sjlombardo
Copy link

Hello @thestinger - thanks for the valuable feedback on the implementation of memory security in SQLCipher, and how it is impacting the use of Signal on Graphene. Based on some of this input and review of the implementation we have made a few changes that will be included in the next version of SQLCipher.

First, the implementation of the xRealloc callback will be modified when memory security is enabled. This will avoid the issue you identified where a realloc operation occurs and does not properly munlock the segment. While not as efficient the new implementation uses the same approach you described, allocating a new segment, copying to it, and then unlocking and freeing the old one.

Based on this input we also identified a separate issue where, due to the locking being on by default, segments could be locked early in the connection lifecycle, and then if locking is subsequently disabled, those segments could be freed without unlocking. After reviewing all the options, we have made the decision to turn the memory security feature off be default. An application can then turn it on, but will not be able to turn it off after doing so. This ensures the consistent tracking of allocations guaranteeing that munlock will be called before free on any mlocked allocations.

Finally, we do recognize that, in terms of efficiency, the current implementation can result in multiple mlock / munlock cycles. Unfortunately we are somewhat constrained with the implementation in the memory management plugin architecture for SQLite. We will review this in the future to see if there are further opportunities for optimization.

In the mean time though, in our testing these changes have eliminated the crash issues observed on Graphene, both with memory security enabled and disabled. Thanks again for your input on this issue, and let us know if you have any other suggestions or comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests