GSoC 2026 · CernVM-FS · CERN-HSF

Debugging Without ptrace

A four-part write-up on building a userspace core dump generator to debug D-state hangs in CernVM-FS. No ptrace. No signals. No cooperation from the target process.

github/Physic69 · PR #4314 · cernvm.cern.ch/fs

Contents

I
How Debuggers Work (and Why They Break)
The ptrace contract, D-state processes, and why GDB hangs forever when you need it most. The /proc backdoor that makes everything else possible.
II
The ELF Core Dump — A Dead Process's Autobiography
What's actually inside a core file, byte by byte. ELF headers, NT_PRSTATUS registers, NT_FILE mappings, and the offset arithmetic that holds it all together.
III
Filling the Structs — /proc as Our Backdoor
Pulling registers out of /proc/pid/syscall, the RBP heuristic that turns a two-frame backtrace into a full call stack, and page-by-page memory reads.
IV
Assembling the Core Dump
The build_core() pipeline, dump levels (standard vs full), the dynamic linker trick, and the moment of truth — loading the output in GDB.