Search
English

A developer's notes on building a debugger that reproduces even thread execution order with Nix(fzakaria.com)

startupxo Discuss

Writing language: KoreanRead in the original language

Plain summary

- The original author runs Nix builds on Rewind, a deterministic virtual machine, to find race condition bugs. The key point is that with the same input, even the thread execution order is reproduced identically. - Nix derivation builds treat the source, compiler, libraries, and configuration as explicit inputs. The author explains that this let others receive the execution records and the information the debugger needs in the same way. - According to the original, nixpkgs stores debug information on cache.nixos.org, and debuginfod fetches symbols and sources by build ID. The author claims this approach lets him check even the Linux kernel source. - The example program, bank, has a bug where two threads overwrite the same balance and money is lost. In the author's measurement on a laptop with 16 cores, losses occurred in 396 of 1,000 runs, and when pinned to a single core, they never occurred.

Read source ↗

Found on

Hacker News ↗ / 172 votes / 37 comments

Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.

Sign in to comment

Keyboard shortcuts

Choose a post with J and K or the arrow keys, then press Enter.

K ↑ / J ↓
Previous post / next post
Enter C
Open summary and comments for the selected post
O
Open the original link of the selected post
/
Search
?
Show this help
Tab
Move to the submit or comment button, then press Enter

Type normally in text fields. Tab and Enter are always available.