Mehdi Akiki

Posts tagged "linux"

  • Published on

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

    How a Call to printf Finds printf: The PLT and the GOT

    I watched one GOT slot in gdb before and after the first call to puts, measured what lazy binding costs on that first call, and compared it with -z now, LD_BIND_NOW, -fno-plt and a Rust binary that never uses the PLT for libc.
  • Published on

    Investigation · Part 8 of 20 · When the benchmark lies

    The Average Hides the Slow Requests

    I timed four million single Vec::push calls: mean 22.8 ns, slowest 315,684 ns. The slow ones were not the reallocations but page faults, and huge pages made them bigger. Then a simulated request handler where the mean is a time that no request had.
  • Published on

    Investigation · Part 7 of 20 · When the benchmark lies

    The Benchmark Ran on an Efficiency Core

    On a laptop with two kinds of cores, I measured the same benchmark on a P-core and on an E-core, without taskset, and with two threads on one core. The E-core needed more cycles, not only a lower clock, and a busy sibling thread made a P-core as slow as an E-core.
  • Published on

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

    How the Dynamic Loader Finds a Shared Library

    I built a small shared library and a program that needs it, got the famous cannot open shared object file, and fixed it three ways while LD_DEBUG=libs showed every directory the loader tried, including why RPATH and RUNPATH give different answers.
  • Published on

    Investigation · Part 7 of 20 · What survives a crash

    Building a Tiny Crash Simulator From strace Output

    kill -9 could not tell a save with fsync from a save without it. So I wrote a small Python simulator that replays the strace output of a program and lists what a machine crash could leave at every moment. It found the zero-length file and the missing directory fsync.