Elektrine lite

← Feed

@encthenet@flyovercountry.social

Post #1434220

2026-04-17 17:54 UTC

I've probably told this story before, but one of my favorite debugging stories is the time we conducted a seance on a core file. At the time we were using the boehm garbage collector, but had processes not freeing memory. We had core files, but at the time, to get stats, you had to run code in a live process. I had recently done work parsing sections of elf binaries, so I wrote a script (with the help of some coworkers) that would take a minimal program, run gdb on it, and then script gdb to open the core file, load cored process into memory at the correct locations. I forget how we handled the stack, but likely just loaded the registers from the core file as well. With the core file restored, we could now tell gdb to print the stats. My coworker used it to find that boehm was erroneously including the text segment as valid pointers, and with the process at 2gb (which was pretty large in 2004/2005 time frame), strings became valid pointers, preventing the freeing of memory. Changing to not include it fixed our out of memory issues.

Replies (2)

  • @mwl@io.mwl.io 2026-04-17 18:01

    @encthenet@flyovercountry.social legit necromancy, this :flan_dalf:

    Open ##2238398

  • @mcr314@todon.nl 2026-04-18 05:02

    @encthenet@flyovercountry.social turning a core file into an executable was a regular part of the emacs build process. I think it stopped a few decades ago, but I remember this on Sun 3/60...

    Open ##2238399