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

Fix double closing on memory file #1579

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Conversation

simophin
Copy link

It should be able to fix this issue:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 25649 >>> network.loki.messenger <<<

backtrace:
  #00  pc 0x000000000009988c  /apex/com.android.runtime/lib64/bionic/libc.so (fdsan_error(char const*, ...)+564)
  #01  pc 0x0000000000099590  /apex/com.android.runtime/lib64/bionic/libc.so (android_fdsan_close_with_tag+920)
  #02  pc 0x00000000000264f8  /apex/com.android.art/lib64/libjavacore.so (Linux_close(_JNIEnv*, _jobject*, _jobject*)+104)
  #03  pc 0x000000000033e310  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+128)
  #04  pc 0x00000000005f1468  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (libcore.io.BlockGuardOs.close+824)
  #05  pc 0x00000000005ebaa0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (libcore.io.ForwardingOs.close+64)
  #06  pc 0x00000000005b47bc  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.system.Os.close+76)
  #07  pc 0x00000000005ba818  /apex/com.android.art/lib64/libart.so (nterp_helper+152)
  #08  pc 0x0000000000256c74  /system/framework/framework.jar (android.os.SharedMemory$Closer.run+20)
  #09  pc 0x0000000000510778  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (sun.misc.Cleaner.clean+88)
  #10  pc 0x000000000037a188  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.lang.ref.ReferenceQueue.enqueuePending+392)
  #11  pc 0x00000000005eb380  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.lang.Daemons$ReferenceQueueDaemon.runInternal+576)
  #12  pc 0x00000000005c034c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.lang.Daemons$Daemon.run+156)
  #13  pc 0x000000000041c970  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.lang.Thread.run+64)
  #14  pc 0x000000000033eba4  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
  #15  pc 0x000000000023a9ac  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144)
  #16  pc 0x000000000053b96c  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1600)
  #17  pc 0x000000000053b31c  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8)
  #18  pc 0x00000000000fd0f4  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
  #19  pc 0x0000000000096a04  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68)

@simophin
Copy link
Author

simophin commented Jul 29, 2024

To reproduce the issue, do the following:

  1. Make sure your Android version is 13+
  2. Open the app, find a conversation to go to
  3. Send a PDF file into the chat
  4. Open the "Dot menu" on chat screen, and go to "All media"
  5. Upon opening the gallery viewer, Go to "Documents" part
  6. Tap on the PDF file to open. The PDF should have open in other apps.
  7. Come back to the app
  8. Play around for a bit. Do some memory heavy stuff, like sending big attachment, viewing images, etc.

It will crash eventually. It's actually quite easy for me to trigger it.

Screen_recording_20240729_115708.webm

@simophin simophin merged commit dec02ce into dev Jul 29, 2024
2 checks passed
ThomasSession pushed a commit that referenced this pull request Jul 30, 2024
@simophin simophin deleted the fix-memory-file-double-closing branch August 12, 2024 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants