From: James Cownie <jcownie@etnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] New gdb command 'gcore'
Date: Thu, 13 Dec 2001 05:56:00 -0000 [thread overview]
Message-ID: <16EWL3-0eH-00@etnus.com> (raw)
> The holy grail, of course, would be to then give gdb the ability to
> restart the process from the core file state. That would give us a
> checkpoint-and-restart capability that very few debuggers have ever
> had. But that's down the line...
Unfortunately in general a normal core file does not contain enough
information to allow a process to be restarted, since it doesn't
contain a lot of the information in the kernel which forms part of the
process' state.
There are many "fun" issues which arise when trying to implement
checkpointing, such as
1) Open files. What fds ar open ? What's the seek position of each ?
What about pipes ?
2) process id; does it change between the original process and its
reincarnation ?)
3) parent process id (same question).
4) relationship with child processes (if any). Do you checkpoint the
whole process group ?
5) network connections. Can you reconstruct them ? What about the
state of the other end ?
6) time. When the process is reincarnated does it see time passing
while it was only a checkpoint ?
7) signal handling state. What signal handlers are set up ? What
signals are blocked ?
8) State of any timers. Suppose a thread was in a sleep() when should
the sleep complete ?
9) State of other potentially long system calls. A listen(), for
instance, or a read from something which isn't ready.
10) All the other things which didn't come to mind in the three minutes
it's taken to type this.
Of course it's possible to add restrictions to the state a process
must be in before it can be checkpointed, unfortunately if you want to
do the checkpoint from gdb it's going to be hard to know if the
restrictions are valid, since you can arbitrarily invoke gcore between
any two machine instructions.
It's a nice idea, but I think it's hard :-( (and to do it portably is
_very_ hard).
-- Jim
James Cownie <jcownie@etnus.com>
Etnus, LLC. +44 117 9071438
http://www.etnus.com
next reply other threads:[~2001-12-13 13:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-13 5:56 James Cownie [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-12-14 6:18 Andrew Volkov
2001-12-14 7:33 ` Frank Ch. Eigler
2001-12-12 16:46 Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16EWL3-0eH-00@etnus.com \
--to=jcownie@etnus.com \
--cc=gdb@sources.redhat.com \
--cc=msnyder@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox