NSBundle is not thread safe.
| Originator: | steipete | ||
| Number: | rdar://19278417 | Date Originated: | 17-Dec-2014 03:28 PM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 8.1.1 |
| Classification: | Other Bug | Reproducible: | Always |
Summary: NSBundle is not thread safe. It should be. Steps to Reproduce: Hard; it’s more a conceptual thing, but we’ve seen rare crashes using NSBundle.mainBundle.infoDictionary on a background thread, and then started digging. (There’s no example needed nor would it be helpful.) Expected Results: NSBundle should be thread safe. Can it even be mutated? Actual Results: We’ve seen rare crashes using NSBundle on background threads. Notes: I see that it’s listed here, but it’s unexpected. https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html There’s also nothing warning developers about it being not thread safe (or sharing global state) in the NSBundle docs: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!