Facebook released version 13.1 of its iOS client today with a rather uninteresting change log noting that the app had received “bug fixes” and nothing more. However, over on Facebook’s engineering blog the company has outlined what exactly went into this fix, and it turns out the update contains a significant fix that will resolve over 50% of reported crashes.
According to the blog post, the issue arose from a file corruption error that appeared in iOS’s Core Data system:
Tweetbot for Mac
Our file descriptor retention policy looked suspect. Although SPDY used the recommended CFSocket wrapper for our database, the SSL layer did not. The SSL layer instead handled a raw file descriptor and, consequently, lifetime handling was not automatically synchronized. The SPDY socket closed before the SSL and created a race window where writes would go to a file that was “lucky enough” to receive the same file descriptor as the recently closed socket.
If you’re interested in the nitty-gritty details on how the development team tracked down the bug, you can find a full breakdown on the Facebook engineering blog. As noted above, Facebook says that this update will resolve over half of the crashes that were being reported in the app.
You can grab the updated Facebook app for free on the iOS App Store.