Mehdi Akiki

Writing archive

Everything published under Writing, newest first. Each entry is labelled as part of an investigation, an article or reference. Short engineering notes have their own archive.

  • Published on

    Investigation · Part 18 of 20 · When the benchmark lies

    The Benchmark Measured the Allocator

    A small formatting function took 52 ns per call with a new String and 38 ns with a reused buffer. A 256 KiB buffer cost nothing extra after the first call. And the contention that I saw with four threads came from my own allocation counter, not from malloc.
  • Published on

    Investigation · Part 18 of 20 · What survives a crash

    Checksums: Catching Corruption the Disk Did Not Report

    I flipped one bit in four files. My log's CRC caught it and then threw away nine good records, SQLite returned the changed value and its integrity check said ok, gzip reported a CRC error, and the text file changed silently. Where checksums belong, and what ext4 checks itself.
  • Published on

    Investigation · Part 18 of 20 · From source to a running process

    How a Stack Overflow Is Detected: Guard Pages and Signals

    A C program that overflows its stack dies without a word, a Rust program prints a message. I overflowed both on purpose, in the main thread and in a new thread, and followed the limit, the guard page, the SIGSEGV, the alternate signal stack and the abort.