SDWebImage icon indicating copy to clipboard operation
SDWebImage copied to clipboard

The methods dealloc/cancelInternal/reset of SDWebImageDownloaderOperation make crashes

Open 1oo1 opened this issue 9 years ago • 18 comments

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

1oo1 avatar Feb 27 '17 07:02 1oo1

We are facing same issue.

Nishant-goibibo avatar Mar 01 '17 11:03 Nishant-goibibo

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

testmesut avatar Mar 03 '17 07:03 testmesut

We are facing same issue.

gshe avatar Mar 03 '17 10:03 gshe

Can you guys provide reproducible examples about the crash?

skyline75489 avatar Mar 04 '17 09:03 skyline75489

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

1oo1 avatar Mar 04 '17 10:03 1oo1

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 avatar Mar 06 '17 07:03 testmesut

@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()

aldolazuardi avatar Mar 10 '17 10:03 aldolazuardi

I met the same problem and more

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

IvanChan avatar Mar 13 '17 07:03 IvanChan

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).

PhilippeBoisney avatar Mar 13 '17 15:03 PhilippeBoisney

@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 avatar Mar 14 '17 13:03 PhilippeBoisney

@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 avatar Mar 15 '17 01:03 IvanChan

@IvanChan, 4.0 works for you?

It still crashes sometimes in my app...

OmarPedraza avatar Mar 23 '17 16:03 OmarPedraza

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

IvanChan avatar Mar 24 '17 01:03 IvanChan

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

CodeStage avatar Apr 06 '17 13:04 CodeStage

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

RoeeNadam avatar Apr 23 '17 10:04 RoeeNadam

@roeeAsaf, does version 3.8 not crash?

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

OmarPedraza avatar Apr 27 '17 09:04 OmarPedraza

We are facing same issue.

archpan avatar Apr 28 '17 02:04 archpan

Should be fixed by #1940 - closing for now

bpoplauschi avatar Jul 28 '17 17:07 bpoplauschi