facebook / fresco

An Android library for managing images and the memory they use.
https://frescolib.org/
MIT License
17.07k stars 3.75k forks source link

App crashes on Android 15 images with page size 16KB #2784

Open vshibin08 opened 1 month ago

vshibin08 commented 1 month ago

Description

As part of testing compatibility of my app with Android 15 16KB memory page size, the app crashes as certain .so libraries cannot be loaded at runtime. I'm currently using Android 14 with AGP below version 8 and I tried using the jniLibs.useLegacyPackaging as true as mentioned in the https://developer.android.com/guide/practices/page-sizes#agp_version_82_or_lower but no luck. I'm currently on the latest Fresco version.

Reproduction

Trying to use certain capabilities of Fresco crashes with the following error logs:

FATAL EXCEPTION: OkHttp Dispatcher Process: com.myapp, PID: 9460 java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~J3j_2PtH0YoNPw22jgFfdQ==/com.myapp-eaduPyMXkWOgdHbd6RvaqA==/lib/arm64/libimagepipeline.so" (new hash type from the future?) at java.lang.Runtime.loadLibrary0(Runtime.java:1081) at java.lang.Runtime.loadLibrary0(Runtime.java:1003) at java.lang.System.loadLibrary(System.java:1765) at com.facebook.soloader.nativeloader.SystemDelegate.loadLibrary(SystemDelegate.java:24) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:52) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:30) at com.facebook.imagepipeline.memory.NativeMemoryChunk.(NativeMemoryChunk.java:33) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:31) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:16) at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:256) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.(MemoryPooledByteBufferOutputStream.kt:39) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:97) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:23) at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:98) at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:75) at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$fetchWithRequest$2.onResponse(OkHttpNetworkFetcher.kt:142) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

2024-08-14 16:04:25.639 9460-9977 AndroidRuntime com.myapp E FATAL EXCEPTION: OkHttp Dispatcher Process: com.myapp, PID: 9460 java.lang.NoClassDefFoundError: failed for class com.facebook.imagepipeline.memory.NativeMemoryChunk; see exception in other thread at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:31) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:16) at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:256) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.(MemoryPooledByteBufferOutputStream.kt:39) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:97) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:23) at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:98) at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:75) at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$fetchWithRequest$2.onResponse(OkHttpNetworkFetcher.kt:142) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

2024-08-14 16:04:25.661 9460-9976 AndroidRuntime com.myapp E FATAL EXCEPTION: OkHttp Dispatcher Process: com.myapp, PID: 9460 java.lang.NoClassDefFoundError: com.facebook.imagepipeline.memory.NativeMemoryChunk at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:31) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:16) at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:256) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.(MemoryPooledByteBufferOutputStream.kt:39) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:97) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:23) at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:98) at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:75) at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$fetchWithRequest$2.onResponse(OkHttpNetworkFetcher.kt:142) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012) Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~J3j_2PtH0YoNPw22jgFfdQ==/com.myapp-eaduPyMXkWOgdHbd6RvaqA==/lib/arm64/libimagepipeline.so" (new hash type from the future?) at java.lang.Runtime.loadLibrary0(Runtime.java:1081) at java.lang.Runtime.loadLibrary0(Runtime.java:1003) at java.lang.System.loadLibrary(System.java:1765) at com.facebook.soloader.nativeloader.SystemDelegate.loadLibrary(SystemDelegate.java:24) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:52) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:30) at com.facebook.imagepipeline.memory.NativeMemoryChunk.(NativeMemoryChunk.java:33) ... 13 more

2024-08-14 16:04:25.677 9460-9979 AndroidRuntime com.myapp E FATAL EXCEPTION: OkHttp Dispatcher Process: com.myapp, PID: 9460 java.lang.NoClassDefFoundError: com.facebook.imagepipeline.memory.NativeMemoryChunk at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:31) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:16) at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:256) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.(MemoryPooledByteBufferOutputStream.kt:39) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:97) at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.kt:23) at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:98) at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:75) at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$fetchWithRequest$2.onResponse(OkHttpNetworkFetcher.kt:142) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012) Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~J3j_2PtH0YoNPw22jgFfdQ==/com.myapp-eaduPyMXkWOgdHbd6RvaqA==/lib/arm64/libimagepipeline.so" (new hash type from the future?) at java.lang.Runtime.loadLibrary0(Runtime.java:1081) at java.lang.Runtime.loadLibrary0(Runtime.java:1003) at java.lang.System.loadLibrary(System.java:1765) at com.facebook.soloader.nativeloader.SystemDelegate.loadLibrary(SystemDelegate.java:24) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:52) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:30) at com.facebook.imagepipeline.memory.NativeMemoryChunk.(NativeMemoryChunk.java:33)

Additional Information

zjw-swun commented 1 month ago

The same crash with the following error logs:

uid: 10193
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x00007603e50ea0c8
    x0  0000000000004a8a  x1  000000005c000000  x2  0000760649180e50  x3  000076053656bbd5
    x4  000076038983d888  x5  7661072842000000  x6  0000804228076176  x7  6d645f003b6e6f69
    x8  0000760589028c10  x9  9ef675340ff249d8  x10 00000000000012a0  x11 0000000000000002
    x12 000000000000000e  x13 000076053659cf10  x14 0000000000000000  x15 000076038983d09c
    x16 0000000000000001  x17 00007605369e4f30  x18 0000760388ce8000  x19 0000000000010006
    x20 0000760389844ac0  x21 00007603e50ea000  x22 b4007605e901d350  x23 00007605376dc968
    x24 0000760589028c10  x25 00007603e50d89b0  x26 b40076069903f990  x27 00007606a9054510
    x28 0000000000000000  x29 000076038983d960
    lr  00007603e50d8a28  sp  000076038983d930  pc  00007603e50d8a30  pst 0000000060001000
4 total frames
backtrace:
      #00 pc 0000000000000a30  /data/app/~~mttbZjO2GvJy9InN50FDtQ==/com.mfw.roadbook.dailybuild-mNyLX6glm4vAHvNuIvEvSg==/lib/arm64/libimagepipeline.so (JNI_OnLoad+128) (BuildId: 9397a3572c010e0648070507ddaae68f9493329e)
      #01 pc 000000000066bf9c  /apex/com.android.art/lib64/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, _jobject*, _jclass*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)+1612) (BuildId: 00a927538d6e55b7346c6547b4436b00)
      #02 pc 00000000000058a8  /apex/com.android.art/lib64/libopenjdkjvm.so (JVM_NativeLoad+364) (BuildId: fee884f6680e39017670ed6bdbe02f38)
      #03 pc 00000000000d6ed0  [anon_shmem:dalvik-jit-code-cache] (offset 0x2000000)

Fresco version: 2.3.0 Platform version: Android 15 emulator with 16KB page size