public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Stan Shebs <shebs@apple.com>
To: Michael Snyder <michsnyd@cisco.com>
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] a prototype checkpoint-restart using core files
Date: Wed, 16 Nov 2005 00:37:00 -0000	[thread overview]
Message-ID: <437A7F5E.6090307@apple.com> (raw)
In-Reply-To: <43696953.9090601@cisco.com>

Michael Snyder wrote:

> Folks, this isn't for commit, just for discussion.
>
> Attached is an experimental patch that adds a command
> "restore-core-file" or "rcore", which is the inverse of
> "generate-core-file" (gcore).  Instead of copying the
> memory and register state of a process into a file,
> it takes an existing corefile, and copies its memory
> and register state into the child process.

My prototype is even lamer :-) I use target read/write
operations to collect state - but it can step backwards.
An improved version in the works uses vfork() to make
core images more cheaply.

>
> The idea was to experiment with the concept of doing
> checkpoint and restore, by using a corefile as the
> checkpoint file.  Obviously it has limitations --
> it doesn't save any kernel state, I/O state etc.
> Just user state.
>
> But it turns out that if you avoid those limitations,
> it works!  As a conservative rule of thumb, you can
> go back to an earlier state so long as you don't cross
> a system call.  And in practice there are lots of
> system calls that can be regarded as "stateless",
> or that change only user state -- so you can cross
> those.

One idea I've considered is getting the OS to set up
some kind of notification at system calls, and then use
it to warn the user who tries to resume the inferior after
rolling back. In addition to obvious corruption issues,
you can also get some funky Heisenbugs, for instance
if the code of interest is inside "if (!file_exists()) {",
but a forewarned user can then decide whether to press
on or just rerun.

On shared memory, there's an old Mark Linton paper (1988
debug workshop I think) where they deal with shared memory
and replay by using the compiler to instrument all memory
refs that might be to shmem, basically adding a test to see
if the address is in shmem and if so, updating the shared
memory bits from a saved version. A hairy solution to a
hairy problem...

Stan

  parent reply	other threads:[~2005-11-16  0:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-03  1:35 Michael Snyder
2005-11-07  0:19 ` Daniel Jacobowitz
2005-11-07  4:40   ` Eli Zaretskii
2005-11-07 18:57     ` Mark Kettenis
2005-11-07 19:07       ` Daniel Jacobowitz
2005-11-07 19:50         ` Michael Snyder
2005-11-07 20:22         ` Mark Kettenis
2005-11-07 20:26           ` Daniel Jacobowitz
2005-11-07 23:56             ` Michael Snyder
2005-11-08  0:34               ` Soam Vasani
2005-11-08  0:43                 ` Michael Snyder
2005-11-07 19:43       ` Michael Snyder
2005-11-07 20:56       ` Eli Zaretskii
2005-11-08  0:10         ` Michael Snyder
2005-11-16  0:37 ` Stan Shebs [this message]
2005-11-18  3:37 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=437A7F5E.6090307@apple.com \
    --to=shebs@apple.com \
    --cc=gdb@sources.redhat.com \
    --cc=michsnyd@cisco.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).