Debugging file corruption on iOS
Aug 12, 2014Slobodan Predolac, Nicolas Spiegelberg

Summary
This post details the debugging process for a file corruption issue on iOS, leading to a 50% reduction in crash rates. The authors used Hipal and Scuba for data aggregation, identified a potential file overwrite issue by switching to SQLite, and then used a honeypot file and conditional breakpoints with lldb to pinpoint the SPDY network stack as the culprit. They further utilized Fishhook to intercept POSIX write calls and confirmed that the SSL layer was writing to a closed and reassigned socket, causing the corruption. The fix involved synchronizing lifetime handling between the SPDY socket and the SSL layer.
More from the Site Reliability and Outage Management trail
- Lights Out, Systems On: Validating Instant Power Loss Readiness
- DrP: Meta’s Root Cause Analysis Platform at Scale
- Zoomer: Powering AI Performance at Meta’s Scale Through Intelligent Debugging and Optimization
- Diff Risk Score: AI-driven risk-aware software development
- How Meta keeps its AI hardware reliable