Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Recovering a core dump deleted while debugging
@ 2026-08-26 11:53 Philippe Blain via Gdb
  2026-08-28 19:23 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Blain via Gdb @ 2026-08-26 11:53 UTC (permalink / raw)
  To: gdb

Hi,

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?

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 ?

Thanks,

Philippe. 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Recovering a core dump deleted while debugging
  2026-08-26 11:53 Recovering a core dump deleted while debugging Philippe Blain via Gdb
@ 2026-08-28 19:23 ` Tom Tromey
  2026-09-01 11:03   ` Philippe Blain via Gdb
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2026-08-28 19:23 UTC (permalink / raw)
  To: Philippe Blain via Gdb; +Cc: Philippe Blain

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Recovering a core dump deleted while debugging
  2026-08-28 19:23 ` Tom Tromey
@ 2026-09-01 11:03   ` Philippe Blain via Gdb
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Blain via Gdb @ 2026-09-01 11:03 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Philippe Blain via Gdb

Hi Tom,

> Le 28 août 2026 à 15:23, Tom Tromey <tom@tromey.com> a écrit :
> 
> 
>> 
>> 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.

Thank you for answering. Indeed later I tried to continue my GDB session and got a BFD error saying the core was not found. 

Good news is we managed to reproduce and fix the failure leading to the core dump :P

Cheers,

Philippe. 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-01 11:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-26 11:53 Recovering a core dump deleted while debugging Philippe Blain via Gdb
2026-08-28 19:23 ` Tom Tromey
2026-09-01 11:03   ` Philippe Blain via Gdb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox