July 3, 2026
Bug cold case: solved
Hunting a 16-year-old SQLite WAL bug with TLA+
A 16-year-old hidden glitch finally got caught, and the comments are loving the brainy chaos
TLDR: SQLite fixed a rare database-corruption bug that had been hiding since 2010, and the team used a math-based modeling tool to finally pin it down. In the comments, people were equal parts impressed, amused, and eager to turn the whole thing into an even bigger formal-methods nerd party.
A tiny bug lived quietly inside SQLite — a hugely popular piece of software used to store data in apps — for 16 years before anyone finally dragged it into the light. That alone had commenters doing the classic internet double take: how does something this old survive that long? The article’s answer is deliciously nerdy: the Canonical team used TLA+, a math-heavy way of modeling software behavior, to recreate the exact chain of events that could scramble a database. The real twist? The bug’s practical impact is said to be low, but the sheer age and slipperiness of it made people treat the discovery like a cold-case true crime doc for software.
And yes, the comments immediately turned into a TLA+ fan club with side quests. One user jumped in with the helpful “for normal humans” explainer, introducing Leslie Lamport like a celebrity cameo. Another went full academic-brain and basically said: great, now port it to Lean and add tactics — a comment with strong “the wizard council has entered the chat” energy. Then the article’s own author appeared, sounding pleasantly shocked that the post hit the front page and offering to answer questions, which gave the whole thread a fun backstage vibe. There wasn’t much of a full-on flame war here; the drama was more about collective awe: people marveling that a niche formal method could solve a bug that hid for over a decade, while others chuckled at the idea that the comments needed a translator just to explain the tool used to catch it.
Key Points
- •SQLite released a new version fixing a WAL checkpointing bug that can cause database corruption.
- •The article says the bug had existed in SQLite’s repository since 2010 and was difficult to find and reproduce.
- •Canonical’s dqlite team uses TLA+ to model SQLite behavior and identify the sequence of actions that leads to corruption.
- •The analysis focuses on WAL writing and checkpointing, especially the roles of CKPT_LOCK, WRITE_LOCK, walSalt, mxFrame, and nBackfill.
- •The authors simplify the model by representing WAL pages as unique numbers and the database as a set, enabling tractable formal reasoning about the bug.