public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB does not work on DMTCP restart.
@ 2023-06-19  8:51 Piotr Czak
  2023-06-28 21:52 ` Magne Hov
  0 siblings, 1 reply; 2+ messages in thread
From: Piotr Czak @ 2023-06-19  8:51 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

Hello everyone,

My name is Piotr and I'd like to ask for suggestions and help with one issue
I have.

I'm using DMTCP to save a checkpoint of some applications and restart from it.
In some cases I need to use gdb to debug issues. I noticed that in one design
gdb does not see debug symbols when used after the restart from a checkpoint.
It works on "save" when executed under the DMTCP when the checkpoint is
created but not after restarting from it. This is happening
only on some tests to which I have limited access. In that case gdb cannot
connect current application location with sources, it shows me wrong but
always the same location.
I can set a breakpoint but it is never hit even if I know that this part of the
code is executed. From the log I see that gdb thinks that my function
is in some
file which is not correct. If I remember well, the line number in the
log message
was correct.
I also cannot display variables.
The result of sharedlibrary command is empty.
In case of issues I'm not able to do any debugging. All of these debug
features work when I try to save DMTCP checkpoint.

Unfortunately, since it is related to my work I cannot provide more
detailed information but I will be grateful if you could provide me with
some suggestions  what could be a reason for the issue or how to debug the
issue.

Thanks,
Best Regards,
Piotr

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

* Re: GDB does not work on DMTCP restart.
  2023-06-19  8:51 GDB does not work on DMTCP restart Piotr Czak
@ 2023-06-28 21:52 ` Magne Hov
  0 siblings, 0 replies; 2+ messages in thread
From: Magne Hov @ 2023-06-28 21:52 UTC (permalink / raw)
  To: Piotr Czak, gdb

Hi Piotr,

In my experience there is a number of things GDB gets wrong when tracing a dmtc_restart process restoring a different process state from a checkpoint. Normally when a process replaces its process image it does so with an exec call, which GDB knows how to handle, but with DMTCP there is no exec call and all the pieces of interesting memory that GDB has started tracking is suddenly changed under its feet. The fact that the `sharedlibrary` command shows no loaded libraries suggests that GDB is failing to find the dynamic linker map of the loaded checkpoint. Often, an appropriate `symbol-file PATH-TO-MAIN-EXE` command is sufficient to help GDB realise where the main executable segments are located, including the dynamic symbols that are required for GDB to inspect the dynamic loader.

Kind regards,

On Mon, Jun 19 2023, Piotr Czak via Gdb wrote:

> Hello everyone,
>
> My name is Piotr and I'd like to ask for suggestions and help with one issue
> I have.
>
> I'm using DMTCP to save a checkpoint of some applications and restart from it.
> In some cases I need to use gdb to debug issues. I noticed that in one design
> gdb does not see debug symbols when used after the restart from a checkpoint.
> It works on "save" when executed under the DMTCP when the checkpoint is
> created but not after restarting from it. This is happening
> only on some tests to which I have limited access. In that case gdb cannot
> connect current application location with sources, it shows me wrong but
> always the same location.
> I can set a breakpoint but it is never hit even if I know that this part of the
> code is executed. From the log I see that gdb thinks that my function
> is in some
> file which is not correct. If I remember well, the line number in the
> log message
> was correct.
> I also cannot display variables.
> The result of sharedlibrary command is empty.
> In case of issues I'm not able to do any debugging. All of these debug
> features work when I try to save DMTCP checkpoint.
>
> Unfortunately, since it is related to my work I cannot provide more
> detailed information but I will be grateful if you could provide me with
> some suggestions  what could be a reason for the issue or how to debug the
> issue.
>
> Thanks,
> Best Regards,
> Piotr

-- 
Magne Hov | Software Engineer | Direct: +44 7395 395 648 | mhov@undo.io

Undo | Record. Replay. Resolve

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

end of thread, other threads:[~2023-06-28 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19  8:51 GDB does not work on DMTCP restart Piotr Czak
2023-06-28 21:52 ` Magne Hov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).