-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ThreadSanitizer Issue - Swift access race in ImageDownloader.clean #763
Comments
Thanks for reporting this. I will take a look at it later. |
No problem, I should have also stated this is on Swift 4 (swift4 branch) and iOS 11, Xcode 9 beta 6. |
I have the same problem, but only on simulator - Swift 3.2 and Xcode 9 |
After some investigation, I guess it might be an issue of the ThreadSanitizer of Xcode, which might not be able to work well with a barrier queue. Like indicated in the documentation of dispatch_barrier_sync:
Both of the racing statement are surrounded by a barrier sync, it should be totally fine since the execution of them will be happened in a sequence way, without a race condition. There should be no case that both of them get accessed or modified. So you could just ignore this. I don't think the sanitizer works well on this. However, I am not 100% sure about for which case the thread sanitizer could give a warning (since it is true that they happens in different threads. So maybe it is just the way thread sanitizer works). Maybe I was wrong. Please let me know if you have any other ideas. Thanks! |
If unchecking the option "Thread sanitizer" in the xcode settings, then it works well :) |
Umm, it seems that I misunderstood the sanitizer warning. There was actually a race condition in reading without barrier. Now it should be fixed in #790 @AndrewBarba @shilei365 Thanks for reporting this! |
Check List
Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.
Issue Description
What
Reproduce
Not sure, I just have a standard table view where each cell has 2 image views being populated by Kf. I have the ThreadSanitizer options turned on in my dev scheme
The text was updated successfully, but these errors were encountered: