Recovering a core dump deleted while debugging

Tom Tromey tom@tromey.com
Fri Aug 28 19:23:05 GMT 2026


> I’m debugging a core dump in GDB and some other process deleted the
> directory where the core dump was. Is there anyway to recover it?

Probably not.

> I tried 'lsof -p $pid' and looking in /proc/$pid/fd/ but the core dump
> does not appear there. I’m guessing GDB closes the file after it loads
> everything into memory ?

BFD sometimes closes file descriptors, so you might have run into this.
gdb can also cause BFD to do this, though exactly when is kind of opaque
to the user.

Checking /proc is pretty much the only thing I would have suggested.

Tom


More information about the Gdb mailing list