picasso: Exception: java.io.IOException: Cannot reset

Hi Square team!

We are having an issue in an app, when in a listview, images on some rows load but some of them are blank. I tried to trace it and collect as much information as I can.

Exception

Picasso:Error:ImageLoadFailed:Uri http://store.indemand.com/shared/ovs/prodimages/movies/t/troublewiththecurve_ID0360906/troublewiththecurveBM_ID0360906.jpg

Picasso:Error:ImageLoadFailed:Exception java.io.IOException: Cannot reset

Picasso:Error:ImageLoadFailed:StackTrace 
[
    com.squareup.picasso.MarkableInputStream.reset(MarkableInputStream.java:94), 
    com.squareup.picasso.NetworkBitmapHunter.decodeStream(NetworkBitmapHunter.java:91), 
    com.squareup.picasso.NetworkBitmapHunter.decode(NetworkBitmapHunter.java:60), 
    com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:111), 
    com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:82), 
    java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390),
    java.util.concurrent.FutureTask.run(FutureTask.java:234), 
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080), 
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573), 
    java.lang.Thread.run(Thread.java:856), 
    com.squareup.picasso.Utils$PicassoThread.run(Utils.java:218)
]

Responsible code (under getView())

pBuilder.build().load(URL).fit().into(ImageView);

By the way, I don’t know if it matters but airplane mode is on, but wifi is connected. I added this because with every row loading, I am seeing this in logs:

W/Settings(4289): Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.

Also the app crashed with this, after scrolling through the list up and down many times;

A/Looper(4289): Could not create wake pipe.  errno=24
A/libc(4289): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 5091 (Picasso-Dispatc)
A/libc(4289): Unable to open connection to debuggerd: Too many open files

The app doesn’t seem to crash and I also didn’t see the W/Settings airplane message if I switch to

Picasso.with(_context).load(URL).fit().into(imageView);

style instead of Picasso.Builder.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 72 (12 by maintainers)

Commits related to this issue

Most upvoted comments

3.0.0 is next

On Mon, Jan 9, 2017 at 2:15 PM Etienne Lawlor notifications@github.com wrote:

If there is already a snapshot for 2.5.3 then does that mean v2.5.3 is coming in a few months from now?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/square/picasso/issues/364#issuecomment-271425110, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEfXGVWR76o8qMHA0BJ7rDxXdAFdwks5rQrGcgaJpZM4BbK7L .

It’ll happen eventually.

On Mon, Apr 25, 2016 at 6:00 PM dimsuz notifications@github.com wrote:

Yeah, it’s kinda sad to see this library stagnating a bit. I use it almost in all of my projects… It’s almost perfect, if not for these several bugs like this which are standing out - would be great to have at least one release with them fixed

  • and I’d say it can stagnate a bit more then 😉

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/square/picasso/issues/364#issuecomment-214541067

Upgrading to 2.5.3-SNAPSHOT fixes the issue. Thanks!

The metadata for every image format is present in the first 1024 bytes of the image. The images on which Android decides to read a ton of data on a metadata-only decode contain the relevant data in the first 1024 bytes. Something is causing the native decoding libraries to read much more data than they need to fulfill the metadata decode we are requesting.

@yayaa looking into the commit history #1280 with the fix is included in 2.71828. Changes comparison for the reference: https://github.com/square/picasso/compare/picasso-parent-2.5.2...2.71828

If there is already a snapshot for 2.5.3 then does that mean v2.5.3 is coming in a few months from now?

@martygeek @Maragues cannot found 2.5.3-SNAPSHOT , @JakeWharton When will the 3.0.0 come out?

Could someone publish whatever code is in 2.5.3-SNAPSHOT as a release version please?

Same problem on Moto G(6.0) with Picasso version 2.5.2, but it works well with 2.6.0-SNAPSHOT. Picasso release is needed.

Pull requests are welcome.

On Tue, Nov 10, 2015 at 12:59 PM Anil Sharma notifications@github.com wrote:

Please fix this issue, I wrote a good amount of code for my app and later struck with this issue. I have to now move to Glide.

— Reply to this email directly or view it on GitHub https://github.com/square/picasso/issues/364#issuecomment-155514444.