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

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

Open
vshibin08 opened this issue Aug 14, 2024 · 3 comments
Open

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

vshibin08 opened this issue Aug 14, 2024 · 3 comments

Comments

@vshibin08
Copy link

vshibin08 commented Aug 14, 2024

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

  • Fresco version: 3.2.0
  • Platform version: Android 15 emulator with 16KB page size
@zjw-swun
Copy link

zjw-swun commented Aug 15, 2024

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

@robinshi-mega
Copy link

robinshi-mega commented Sep 22, 2024

Hi Team, Could you please support Fresco with 16KB page size in next release?

I could rebuild the Fresco library by following build from source doc, but picking the needed sub-libraries from the many generated .aar files and import them as local dependency is not really a good idea.

Our project relies on below Fresco libraries

fresco = { module = "com.facebook.fresco:fresco", version.ref = "fresco" }
fresco-gif = { module = "com.facebook.fresco:animated-gif", version.ref = "fresco" }
fresco-webp = { module = "com.facebook.fresco:animated-webp", version.ref = "fresco" }
fresco-webpsupport = { module = "com.facebook.fresco:webpsupport", version.ref = "fresco" }

It's hard to decide which aar files are the ones I needed among the aar files generated as below:

fresco % find . -name "*.aar" | grep release | grep "outputs/aar"
./imagepipeline/build/outputs/aar/imagepipeline-release.aar
./middleware/build/outputs/aar/middleware-release.aar
./vito/init/build/outputs/aar/init-release.aar
./vito/options/build/outputs/aar/options-release.aar
./vito/core-impl/build/outputs/aar/core-impl-release.aar
./vito/renderer/build/outputs/aar/renderer-release.aar
./vito/tools/liveeditor/build/outputs/aar/liveeditor-release.aar
./vito/litho/build/outputs/aar/litho-release.aar
./vito/core/build/outputs/aar/core-release.aar
./vito/textspan/build/outputs/aar/textspan-release.aar
./vito/drawee-support/build/outputs/aar/drawee-support-release.aar
./vito/ktx/build/outputs/aar/ktx-release.aar
./vito/source/build/outputs/aar/source-release.aar
./vito/nativecode/build/outputs/aar/nativecode-release.aar
./vito/provider/build/outputs/aar/provider-release.aar
./vito/core-common-impl/build/outputs/aar/core-common-impl-release.aar
./vito/litho-slideshow/build/outputs/aar/litho-slideshow-release.aar
./vito/view/build/outputs/aar/view-release.aar
./vito/core-java-impl/build/outputs/aar/core-java-impl-release.aar
./tools/flipper-fresco-plugin/build/outputs/aar/flipper-fresco-plugin-release.aar
./tools/flipper/build/outputs/aar/flipper-release.aar
./tools/stetho/build/outputs/aar/stetho-release.aar
./native-imagetranscoder/build/outputs/aar/native-imagetranscoder-release.aar
./fbcore/build/outputs/aar/fbcore-release.aar
./viewport/build/outputs/aar/viewport-release.aar
./ui-core/build/outputs/aar/ui-core-release.aar
./native-filters/build/outputs/aar/native-filters-release.aar
./animated-drawable/build/outputs/aar/animated-drawable-release.aar
./urimod/build/outputs/aar/urimod-release.aar
./animated-gif-lite/build/outputs/aar/animated-gif-lite-release.aar
./animated-gif/build/outputs/aar/animated-gif-release.aar
./soloader/build/outputs/aar/soloader-release.aar
./animated-base/build/outputs/aar/animated-base-release.aar
./imagepipeline-test/build/outputs/aar/imagepipeline-test-release.aar
./drawee/build/outputs/aar/drawee-release.aar
./ui-common/build/outputs/aar/ui-common-release.aar
./samples/zoomable/build/outputs/aar/zoomable-release.aar
./samples/gestures/build/outputs/aar/gestures-release.aar
./drawee-backends/drawee-pipeline/build/outputs/aar/drawee-pipeline-release.aar
./imagepipeline-base/build/outputs/aar/imagepipeline-base-release.aar
./drawee-span/build/outputs/aar/drawee-span-release.aar
./static-webp/build/outputs/aar/static-webp-release.aar
./imagepipeline-backends/imagepipeline-volley/build/outputs/aar/imagepipeline-volley-release.aar
./imagepipeline-backends/imagepipeline-okhttp3/build/outputs/aar/imagepipeline-okhttp3-release.aar
./imagepipeline-native/build/outputs/aar/imagepipeline-native-release.aar
./animated-webp/build/outputs/aar/animated-webp-release.aar
./imagepipeline-base-test/build/outputs/aar/imagepipeline-base-test-release.aar
./memory-types/ashmem/build/outputs/aar/ashmem-release.aar
./memory-types/nativememory/build/outputs/aar/nativememory-release.aar
./memory-types/simple/build/outputs/aar/simple-release.aar

And doing such "secondary-build" to support 16KB page size by library user doesn't sound a long term solution.
Thanks and appreciate it in advance.

@migueldaipre
Copy link

Version v3.4.0 has 16k page support

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

No branches or pull requests

4 participants