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

64-bit ARM and x86_64 - updating PR #121 #176

Closed
wants to merge 3 commits into from

Conversation

robert-wallis
Copy link
Contributor

Just finishing updating PR #121 @orospakr started, by updating the files that @michalgr suggested to use Java long instead of int to store the context id.

@michalgr
Copy link
Contributor

I'll run some tests before merging.

@orospakr
Copy link

Thanks, @michalgr. :)

There's definitely an issue in my original PR; if you try to use the GIF support you'll get runtime symbol lookup errors. I expect to dive into this and properly test it later today.

@robert-wallis
Copy link
Contributor Author

This code produces the following stacktrace from issue #193:

04-23 20:56:16.452  25908-26161/? E/AndroidRuntime﹕ FATAL EXCEPTION: pool-2-thread-1
    Process: com.facebook.fresco.sample, PID: 25908
    java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.facebook.fresco.sample-1/lib/arm64/libgifimage.so"
            at java.lang.Runtime.loadLibrary(Runtime.java:371)
            at java.lang.System.loadLibrary(System.java:989)
            at com.facebook.common.soloader.SoLoaderShim$DefaultHandler.loadLibrary(SoLoaderShim.java:34)
            at com.facebook.common.soloader.SoLoaderShim.loadLibrary(SoLoaderShim.java:56)
            at com.facebook.imagepipeline.gif.GifImage.ensure(GifImage.java:42)
            at com.facebook.imagepipeline.gif.GifImage.create(GifImage.java:64)
            at com.facebook.imagepipeline.animated.factory.AnimatedImageFactory.decodeGif(AnimatedImageFactory.java:62)
            at com.facebook.imagepipeline.decoder.ImageDecoder.decodeAnimatedGif(ImageDecoder.java:105)
            at com.facebook.imagepipeline.decoder.ImageDecoder.decodeImage(ImageDecoder.java:86)
            at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:232)
            at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:92)
            at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$3.run(DecodeProducer.java:202)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)

@tyronen tyronen removed the approved label Apr 25, 2015
@rockerhieu
Copy link

I tested this PR on a Nexus 5 (Android 5.1) and the problem still happened:

E/AndroidRuntime(22014): java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.facebook.fresco.sample-1/lib/arm/libgifimage.so"
E/AndroidRuntime(22014):    at java.lang.Runtime.loadLibrary(Runtime.java:371)
E/AndroidRuntime(22014):    at java.lang.System.loadLibrary(System.java:988)
E/AndroidRuntime(22014):    at com.facebook.common.soloader.SoLoaderShim$DefaultHandler.loadLibrary(SoLoaderShim.java:34)
E/AndroidRuntime(22014):    at com.facebook.common.soloader.SoLoaderShim.loadLibrary(SoLoaderShim.java:56)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.gif.GifImage.ensure(GifImage.java:40)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.gif.GifImage.create(GifImage.java:62)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.animated.factory.AnimatedImageFactory.decodeGif(AnimatedImageFactory.java:62)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.decoder.ImageDecoder.decodeAnimatedGif(ImageDecoder.java:105)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.decoder.ImageDecoder.decodeImage(ImageDecoder.java:86)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:231)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:92)
E/AndroidRuntime(22014):    at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$3.run(DecodeProducer.java:202)
E/AndroidRuntime(22014):    at com.facebook.common.executors.SerialDelegatingExecutor.executeSingleCommand(SerialDelegatingExecutor.java:76)
E/AndroidRuntime(22014):    at com.facebook.common.executors.SerialDelegatingExecutor.access$000(SerialDelegatingExecutor.java:24)
E/AndroidRuntime(22014):    at com.facebook.common.executors.SerialDelegatingExecutor$1.run(SerialDelegatingExecutor.java:47)
E/AndroidRuntime(22014):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime(22014):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime(22014):    at java.lang.Thread.run(Thread.java:818)

@yosit
Copy link

yosit commented May 12, 2015

+1 on this

@@ -865,7 +865,7 @@ jint GifImage_nativeGetSizeInBytes(JNIEnv* pEnv, jobject thiz) {
void GifImage_nativeDispose(JNIEnv* pEnv, jobject thiz) {
pEnv->MonitorEnter(thiz);
GifImageNativeContext* pNativeContext =
(GifImageNativeContext*) pEnv->GetIntField(thiz, sGifImageFieldNativeContext);
(GifImageNativeContext*) pEnv->GetLongField(thiz, sGifImageFieldNativeContext);
if (pNativeContext != nullptr) {
pEnv->SetIntField(thiz, sGifImageFieldNativeContext, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetLongField

@michalgr
Copy link
Contributor

Sorry for keeping you waiting, we are still waiting for 64bit device.

Fortunately the issue happens on all architectures, so I am able to repro this. There are some leftovers, new long fields are accessed as int fields. I was able to mark 4 of those places in the diff, but there are 8 more. To get all of them covered we would have to replace all occurrences of "I" (with double quotes) in webp.cpp and gif.cpp with "J" (this will tell JNI that we are looking for long fields rather than int fields), as well as "(I)V" in the same files with "(J)V" (this will tell JNI that the constructors we are looking for take long as the only argument. With those changes I am able to run this on non 64 bit device.

@ashughes
Copy link

Just wanted to add my +1 for this. Any update on the progress?

@JackPeel
Copy link

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yikaton.handyshop-1/base.apk"],nativeLibraryDirectories=[/data/app/com.yikaton.handyshop-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libimagepipeline.so" how to solve it? help~

@JackPeel
Copy link

my system is windows 64 bits

@oprisnik
Copy link
Contributor

You have to use the correct ABIs, see http://frescolib.org/docs/multiple-apks.html

@wudongjiang333
Copy link

@JackPeel i have this problem too.Did you known how to fit it ????please tell me,thx

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

Successfully merging this pull request may close these issues.