logoalt Hacker News

Hunting a 16-year-old SQLite WAL bug with TLA+

40 pointsby peterparker204last Tuesday at 11:07 AM2 commentsview on HN

Comments

hackingonemptytoday at 3:18 PM

TLA+ = formal language for modeling software above the code level and hardware above the circuit level by Leslie Lamport (of vector clock and Paxos fame, among other things.)

https://lamport.azurewebsites.net/tla/tla.html

peterparker204last Tuesday at 11:07 AM

SQLite recently patched a rare, 16-year-old bug in its Write-Ahead Log (WAL) checkpointing system that could lead to database corruption. This post from Canonical's dqlite (distributed SQLite) team walks through how they used TLA+ to formally model SQLite's internal behavior, isolate the exact sequence of steps needed to trigger the corruption, and determine whether their own system was vulnerable.