iOS 18.4 crash in WebCore with NSAttributedString

My app started crashing since iOS 18.4 update. Crashes started happening in 18.4 beta and are still happening in the official 18.4 RTM build (22E240). Crash is happening randomly and I cannot reproduce it, but it affects a few percent of users.

As you can see in log, crash happen when NSAttributedString is loading HTML with init(data:options:documentAttributes:) with .html documentType.

Answered by DTS Engineer in 833011022

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the Feedback number here once you do. For this particular problem I think it would also be useful to include copies of the HTML that is causing the crashing behavior. If you post the bug number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.

Bug Reporting: How and Why? has tips on creating your bug report.

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the Feedback number here once you do. For this particular problem I think it would also be useful to include copies of the HTML that is causing the crashing behavior. If you post the bug number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.

Bug Reporting: How and Why? has tips on creating your bug report.

I filled a bug report FB17113268. Unfortunately, I am not able to reproduce the crash therefore I am not able to provide a small project with an example.

Hi and thanks for filing a bug report. Looking at the HTML sample you provided it appears to have lots of CSS. I'm not sure if that's responsible for the crash, but it could be related. If you are able to find a HTML sample that can reliably cause a crash, that would be very useful. Or, if you can provide a crash log that would be useful as well. If you find either, please attach them to your bug report.

Please continue to test your software in release and pre-release versions of system software made available to you through your developer.apple.com account. When you do, add details about that into your bug report to keep it up to date. Please see https://developer.apple.com/download/.

iOS 18.4 crash in WebCore with NSAttributedString
 
 
Q