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

Crash on MD5 section possible conflict #692

Closed
blaineam opened this issue May 31, 2017 · 5 comments
Closed

Crash on MD5 section possible conflict #692

blaineam opened this issue May 31, 2017 · 5 comments

Comments

@blaineam
Copy link

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

Issue Description

I am currently using my switfyhash md5 hashing library and after a random number from 10-4000 photos being fetched by a ImagePrefetcher it crashes on the stringproxy.md5.getter see attached screenshot. I cannot figure out what if any possible conflict there is and am still investigated. I was just wondering if you might have an idea as to what could be going wrong. Thank You. I am hashing md5 within the completion handler if that helps at all.

What

[Tell us about the issue]

Reproduce

[The steps to reproduce this issue. What is the url you were trying to load, where did you put your code, etc.]

Other Comment

[Add anything else here]

screen shot 2017-05-30 at 6 13 03 pm

@onevcat
Copy link
Owner

onevcat commented May 31, 2017

I noticed that you are fetching a lot of images and it might be a problem of the stack. The completion stack is too large and it might be a stack overflow.

Could you confirm that this issue only happens when you have a large number of images?

If so, a possible quick workaround is breaking down your images into smaller set and download it with multiple prefetchers.

@blaineam
Copy link
Author

I removed the whole prefetched code out from a dispatch in background task and it is running a lot better and hasn't crashed yet however I'm noticing what appears to be socket errors in writing data. they aren't crashing the app but I am wondering If I'm running through everything too quickly? I might have to break the images into smaller sets as the though did cross my mind thank you. and yeah there is a lot of images being fetched. Thanks for the fast reply.

@onevcat onevcat closed this as completed Jun 3, 2017
@cl3m
Copy link

cl3m commented Nov 7, 2017

@onevcat I had the same problem. It seems the recursion is too deep when prefetching thousand of image.
The easiest solution was to add an DispatchQueue.main.async in reportCompletionOrStartNext.

@onevcat
Copy link
Owner

onevcat commented Nov 9, 2017

@cl3m Good catch on it. I will try it soon. Thanks!

@onevcat
Copy link
Owner

onevcat commented Dec 3, 2017

The prefetcher stack overflow issue should be fixed in 4.4.1. (preparing a release now.)

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

No branches or pull requests

3 participants