square / picasso

A powerful image downloading and caching library for Android
https://square.github.io/picasso/
Apache License 2.0
18.71k stars 3.97k forks source link

Picasso and Lollipop problem #749

Closed CeccoCQ closed 9 years ago

CeccoCQ commented 9 years ago

Hi, I've this error: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7700000155 in tid 2532 (Picasso-/102055) and my app crashes everytime in the Android AVD 5.0.

I've this code in my fragment: Picasso.with(getActivity()) .load(imageUrl) .fit() .centerCrop() .placeholder(R.drawable.placeholder) .into(navigationImageImageView);

All works correctly before 5.0. Can you help me?

dnkoutso commented 9 years ago

Interesting. Seems like a native issue. Have you tried another library for images if it successfully loads the bitmap? Also try to remove as a test fit() and/or centerCrop().

CeccoCQ commented 9 years ago

Hi, thanks for your quickly response.

I've tried to comment fit() and centerCrop() methods but still not works, same error. With Universal Image Loader library I've same error on Lollipop. I don't know if is possible, but I've realized that the url that I passed is wrong for my mistake (http://graph.facebook.com/10203981605594645/picture?type=large_200x200), is there an error handler for invalid url that return json text?

Below the all stacktrace: 11-10 18:50:40.640 956-956/? I/DEBUG﹕ * * * * * * * * * * * * * * * * 11-10 18:50:40.640 956-956/? I/DEBUG﹕ Build fingerprint: 'generic_x86_64/sdk_phone_x86_64/generic_x86_64:5.0/LRX09D/1504858:eng/test-keys' 11-10 18:50:40.640 956-956/? I/DEBUG﹕ Revision: '0' 11-10 18:50:40.640 956-956/? I/DEBUG﹕ ABI: 'x86_64' 11-10 18:50:40.640 956-956/? I/DEBUG﹕ pid: 2861, tid: 2899, name: Picasso-/102039 >>> com.myproj<<< 11-10 18:50:40.640 956-956/? I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8b000000f9 11-10 18:50:40.640 956-956/? I/DEBUG﹕ rax 0000000000000000 rbx 0000008b00000049 rcx 0000000000000081 rdx 0000000000000001 11-10 18:50:40.640 956-956/? I/DEBUG﹕ rsi 000000000000001e rdi 00007fd4431a72b0 11-10 18:50:40.640 956-956/? I/DEBUG﹕ r8 000000000000014a r9 0000000000000000 r10 0000000000000024 r11 0000000000000000 11-10 18:50:40.640 956-956/? I/DEBUG﹕ r12 00007fd436178920 r13 0000000000000000 r14 00007fd4359a5698 r15 00007fd4359a53c0 11-10 18:50:40.640 956-956/? I/DEBUG﹕ cs 0000000000000033 ss 000000000000002b 11-10 18:50:40.640 956-956/? I/DEBUG﹕ rip 00007fd449ccc4d6 rbp 00007fd4359a5660 rsp 00007fd4358feb40 eflags 0000000000010202 11-10 18:50:40.640 956-956/? I/DEBUG﹕ backtrace: 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #00 pc 00000000000e34d6 /system/lib64/libcrypto.so (ENGINE_init+38) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #01 pc 00000000000eb435 /system/lib64/libcrypto.so (EVP_MD_CTX_copy_ex+37) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #02 pc 00000000000f8556 /system/lib64/libcrypto.so (HMAC_CTX_copy+22) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #03 pc 00000000000f7e32 /system/lib64/libcrypto.so 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #04 pc 00000000000f698a /system/lib64/libcrypto.so (EVP_PKEY_CTX_dup+234) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #05 pc 00000000000eb52b /system/lib64/libcrypto.so (EVP_MD_CTX_copy_ex+283) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #06 pc 000000000004a9b3 /system/lib64/libssl.so (tls1_mac+195) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #07 pc 0000000000032bf1 /system/lib64/libssl.so (ssl3_read_bytes+1249) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #08 pc 0000000000026acb /system/lib64/libssl.so (ssl3_get_message+315) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #09 pc 00000000000263e2 /system/lib64/libssl.so (ssl3_get_finished+34) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #10 pc 0000000000028e90 /system/lib64/libssl.so (ssl3_connect+2256) 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #11 pc 00000000000186a2 /system/lib64/libjavacrypto.so 11-10 18:50:40.640 956-956/? I/DEBUG﹕ #12 pc 0000000000409ef1 /data/dalvik-cache/x86_64/system@framework@boot.oat 11-10 18:50:40.690 956-956/? I/DEBUG﹕ Tombstone written to: /data/tombstones/tombstone_00

JakeWharton commented 9 years ago

This is a problem with the SSL context in native code. Are you using OkHttp in your app along with the Facebook SDK?

CeccoCQ commented 9 years ago

Hi Jake, I'm not using Facebook SDK, but I'm using OkHttp with Retrofit library. I get the url (graph.facebook.com, etcc.) from my server.

JakeWharton commented 9 years ago

Can you say what other libraries you are using? This happens when OkHttp configures NPN for SPDY/HTTP2 support and some other client library doesn't expect it.

CeccoCQ commented 9 years ago
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.google.code.gson:gson:2.3'
compile 'joda-time:joda-time:2.5'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0-RC1'
compile 'com.squareup.okhttp:okhttp:2.1.0-RC1'
compile 'com.squareup.retrofit:retrofit:1.7.1'
compile 'org.jdeferred:jdeferred-android-aar:1.2.3'
compile 'de.greenrobot:eventbus:2.2.1'
compile 'com.github.castorflex.smoothprogressbar:library:1.0.0'
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.1'
compile 'com.astuetz.viewpager.extensions:android-pagerslidingtabstrip:1.0@aar'
compile 'com.williammora:snackbar:1.4.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
compile 'org.roboguice:roboguice:3.0'
provided 'org.roboguice:roboblender:3.0'
compile 'com.google.code.findbugs:jsr305:3.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
JakeWharton commented 9 years ago

Hmm, It might be play services... give me an hour or two (I'm mobile) and I'll track down the code to set OkHttp as the global URL handler.

CeccoCQ commented 9 years ago

@JakeWharton Thank you very much!! I love Squareup libraries ;)

CeccoCQ commented 9 years ago

Hi @JakeWharton , did you have news about this issue?

JakeWharton commented 9 years ago

Try this:

URL.setURLStreamHandlerFactory(new OkUrlFactory(client));

(where client is your OkHttpClient instance).

Sorry for the delay. Was traveling internationally.

CeccoCQ commented 9 years ago

Thanks Jack, this fix solves my issue.

Papipo commented 9 years ago

Using

URL.setURLStreamHandlerFactory(new OkUrlFactory(client));

didn't fix the issue for me. It fails on Lollipop but works fine on KitKat.