War story: the hardest bug I ever debugged
a year ago
- #debugging
- #Google Docs
- #V8 engine
- A sudden surge of fatal errors in Google Docs without any apparent cause or user complaints.
- The bug was Chrome-specific, starting at a particular release, making it hard to diagnose.
- Reproduction involved creating a large document and repeatedly bolding/unbolding text, revealing the bug was nondeterministic.
- Investigation pointed to a layout engine issue where subpixel rendering errors accumulated over time.
- Debugging was complicated by the bug's nondeterministic nature and slow reproduction steps.
- Collaboration with a coworker and a tech lead was crucial in identifying the root cause.
- The issue was traced back to a V8 optimization bug where Math.abs() incorrectly returned negative values.
- A temporary fix was implemented with a browser version check and a manual workaround for Math.abs().
- The V8 team had already fixed the issue, highlighting the challenge of debugging external dependencies.
- The experience underscored the unpredictable and sometimes frustrating nature of debugging complex software issues.