Sdwebimage: The methods dealloc/cancelInternal/reset of SDWebImageDownloaderOperation make crashes

Created on 27 Feb 2017  路  18Comments  路  Source: SDWebImage/SDWebImage

New Issue Checklist

Issue Info

Info | Value |
-------------------------|-------------------------------------|
Platform Name | iOS
Platform Version | 8.0/9.3/10.2
SDWebImage Version | 4.0.0
Integration Method | cocoapods
Xcode Version | Xcode 8.2.1
Repro rate | sometimes 5%
Repro with our demo prj | not happen
Demo project link | none

Issue Description and Steps

Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.

dealloc

reset
cancelinternal

crash

Most helpful comment

Hi @1oo1 ,
I can reprudce with these steps.

  • Load a tableview with over 200+ cells first time (images should be un-cached)
  • Scroll to bottom fastly
  • Gone

All 18 comments

We are facing same issue.

We are facing same issue (when we have 200+ cells in our tableview). We can reproduce it everytime. (going to downgrade sdwebimage)

We are facing same issue.

Can you guys provide reproducible examples about the crash?

In fact I didn't reproduce these crashes, just found them on CrashReports.
@testmesut , If you can reproduce it, please provide examples to help.

Hi @1oo1 ,
I can reprudce with these steps.

  • Load a tableview with over 200+ cells first time (images should be un-cached)
  • Scroll to bottom fastly
  • Gone

@testmesut have you try downgrade sdwebimage? I'm still use version 3.7 and reproduce same crash. Crash did not happen in iphone 6s and up. I tried to put this below line in didMemoryWarning, it helps for several scroll but still got crash after several fast scroll

SDImageCache.shared().clearMemory()

I met the same problem and more

https://github.com/rs/SDWebImage/issues/1834

Facing same issue with a tableview fills with +200 rows.
Happening every time user performs fast scrolling with a slow device (iPod Touch for example).

@testmesut @IvanChan @1oo1 Hey guys ! I've performed a lot of test and find out that problem also occurred with other libraries like Nuke or Kingfisher. Actually, I don't know why but didReceiveMemoryWarning method was never called when app run out of memory.

Finally, after 10 hours of multiple tests, I've checked if crash with "fast scrolling" happened with other apps (Facebook, Instagram, etc...). And those apps crashed too, especially when image was loaded from cache (but not during first loading from url)

So I realized that was my device that caused the problem. Actually, my iPod touch wasn't reboot since a while, so I simply rebooted it.. and problem disappears.

I mean It's fucking weird isn't ? I feel like I'm really stupid now...

@PhilippeBoisney My problem might NOT be a memory issue, I set the memory cache size only to 5M.

And I think is multi-thread problem for downloader, since 4.0-beta work well for me.

@IvanChan, 4.0 works for you?

It still crashes sometimes in my app...

@OmarPedraza 4.0-beta didn't seem to crash that much.

We have this issue too, but not in huge numbers (0,007% of active users every day). Still it's number one in our crash list. I assume it happens in combination with collection views. So far we have not been able to reproduce it or force it.

crash

I back to 3.8 )-:
when are you think that be a fix for this?

@roeeAsaf, does version 3.8 not crash?

If not, it looks like a workaround (for the time being) for me.

We are facing same issue.

Should be fixed by #1940 - closing for now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mohacs picture mohacs  路  5Comments

cyanzhong picture cyanzhong  路  5Comments

ericeddy picture ericeddy  路  6Comments

halilyuce picture halilyuce  路  4Comments

paul-lavoine picture paul-lavoine  路  4Comments