MaterialFiles icon indicating copy to clipboard operation
MaterialFiles copied to clipboard

Material files (v1.62) crash (android14)

Open robovoice1 opened this issue 2 years ago • 8 comments

type: crash
osVersion: google/raven/raven:14/UQ1A.231205.015/2023120800:user/release-keys
package: me.zhanghai.android.files:34
process: me.zhanghai.android.files
processUptime: 0 + 0 ms
installer: dev.imranr.obtainium

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000008

backtrace:
      #00 pc 0000000000081230  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/lib/arm64/libarchive-jni.so (Java_me_zhanghai_android_libarchive_Archive_free+68) (BuildId: 5aac375a93b05300900d02c95f753f1f160904ba)
      #01 pc 0000000000969e24  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (art_jni_trampoline+116)
      #02 pc 00000000012dc250  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (yl.k.o+1728)
      #03 pc 0000000000d36bf0  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (bd.f.l+192)
      #04 pc 0000000000d3a85c  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (bd.g.s+332)
      #05 pc 00000000016aabd8  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (androidx.lifecycle.d1.j+536)
      #06 pc 0000000000e99d9c  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (h9.c.k+700)
      #07 pc 0000000000f7ad44  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (me.zhanghai.android.files.provider.root.u.s+308)
      #08 pc 00000000008c705c  /data/app/~~BSi5aZXYGxm1sR3kp6qdJQ==/me.zhanghai.android.files-GZCGdVXCuOhkVmX4v36sUA==/oat/arm64/base.odex (k5.l.call+1276)
      #09 pc 0000000000254a94  /system/framework/arm64/boot.oat (java.util.concurrent.FutureTask.run+180) (BuildId: 1348f1c03b740c7d44cc624fe7a2affb180c42a1)
      #10 pc 00000000002b3d3c  /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+796) (BuildId: 1348f1c03b740c7d44cc624fe7a2affb180c42a1)
      #11 pc 00000000002b0e60  /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+64) (BuildId: 1348f1c03b740c7d44cc624fe7a2affb180c42a1)
      #12 pc 000000000015f828  /system/framework/arm64/boot.oat (java.lang.Thread.run+72) (BuildId: 1348f1c03b740c7d44cc624fe7a2affb180c42a1)
      #13 pc 00000000002109a4  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 9eaf1a83f1fae3c1a7c6d4789badfa91)
      #14 pc 0000000000253b3c  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+172) (BuildId: 9eaf1a83f1fae3c1a7c6d4789badfa91)
      #15 pc 000000000069abc8  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1416) (BuildId: 9eaf1a83f1fae3c1a7c6d4789badfa91)
      #16 pc 00000000000cf9ec  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: ffd6f1c31b8e101bb6b86eee2bcdaa01)
      #17 pc 0000000000064730  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: ffd6f1c31b8e101bb6b86eee2bcdaa01)


Google Pixel 6 pro (raven) Android 14 GrapheneOS UQ1A.231205.015.2023120800

To reproduce: Exploit protection off Haredened Memory Allocator on Native code debugging off

After tapping on a downloaded zip file, the app crashed with the message tried to use native code debugging.

robovoice1 avatar Dec 11 '23 10:12 robovoice1

Useful information are optimized away in release builds. Could you please try installing a debug build (e.g. app-debug.apk from https://github.com/zhanghai/MaterialFiles/actions/runs/7140457023 ) (you'll need to uninstall your current version first) and paste the crash stacktrace here?

zhanghai avatar Dec 12 '23 13:12 zhanghai

I installed your proposed apk version and tried with the same settings described in my intial report above. No crash at all, the content of the downloaded .zip file is displayed, and can be extracted, when tapping on it.

robovoice1 avatar Dec 13 '23 21:12 robovoice1

Release APK: If native code debugging is allowed, the app do not crash, but nothing else happens (no viewing of the content of the zip, no extracting of the file possible). Material Files app is just minimised.

robovoice1 avatar Dec 14 '23 15:12 robovoice1

I installed your proposed apk version and tried with the same settings described in my intial report above.

No crash at all, the content of the downloaded .zip file is displayed, and can be extracted, when tapping on it.

Could you confirm if you turned on Haredened Memory Allocator when testing the debug APK? That's so weird since it's built from the same native code...

Release APK:

If native code debugging is allowed, the app do not crash, but nothing else happens (no viewing of the content of the zip, no extracting of the file possible). Material Files app is just minimised.

Which release APK are you referring to, and how are you enabling native code debugging?

And did you enable Haredened Memory Allocator this time?

zhanghai avatar Dec 14 '23 15:12 zhanghai

  • Could you confirm if you turned on Haredened Memory Allocator when testing the debug APK? That's so weird since it's built from the same native code...

Yes Hardened Memory Allocator was on!

  • Which release APK are you referring to, and how are you enabling native code debugging?

https://github.com/zhanghai/MaterialFiles/releases/download/v1.6.2/app-release.apk (12.1 MB)

In Android14 GrapheneOS you can switch on/off: Exploit protection, Hardware Memory Allocator, Native Code debugging Settings/Apps/MaterialFiles

Screenshot_20231214-204213 Screenshot_20231214-203852 Screenshot_20231214-210500

robovoice1 avatar Dec 14 '23 20:12 robovoice1

OK I've built a new release APK (please manually remove the .zip suffix, GitHub doesn't let me upload .apk) from tip of master. Could you test it with Hardened memory allocator as well and see if it crashes? It would be strange if it crashes only with release build but not debug build from the same code, which would mean some compiler optimization is causing this...

zhanghai avatar Dec 16 '23 10:12 zhanghai

I tested the new release apk: Screenshot_20231216-172852 Screenshot_20231216-173205 In both cases Hardened memory allocator was allowed. I changed Native code debugging from on to off. No crash at all and the content of the .zip is displayed and could be extracted. 😃👍

robovoice1 avatar Dec 16 '23 16:12 robovoice1

That's strange but at least the issue seems somehow fixed. Maybe it will be fixed when I just publish a new version? I'll also ask people on the other issue to test it.

zhanghai avatar Dec 20 '23 04:12 zhanghai