This bug has been causing me grief for the last month or so, as it was hard to pin down without a concrete use case that can reliably reproduce it. GitHub user brovador finally was able to narrow it down to be able to repro it every time.
There appears to be a bug in NSAttributedString that causes an EXC_BAD_ACCESS if you try to enumerate certain attributes over a longer range on two separate attributed strings from two background threads.
If you enumerate attributes on two different NSAttributedString instances on two background threads an EXC_BAD_ACCESS is caused by -attribute:atIndex:effectiveRange: method.
Steps to Reproduce
Launch the provided sample app.
There should be no crash.
The app crashes showing two crashed threads at DTCoreTextLayoutFrame.m:949.
I’m enclosing a screen shot of the crash.
If you enable the the synchronization at line 939 then the crash no longer occurs.
This bug was also present in iOS 6.
iOS 7 Simulator
Categories: Bug Reports