lkml.org 
[lkml]   [1996]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Core dumps & restarting
From
Date

> > I was wandering how to stop a process, reboot the machine, and
> > restart that process. Is there a way to provoke a program to dump
> > itself, and restart it after the reboot?
> >
> > Maybe we can define a new executable format for it to work ;-)
> >
> > Cheers!
>
> This would be practically impossible as you'd have to load the program
> into the exact same memory space or all of its pointers would be bad...
> Memory fragmentation issues would make it very hard to get any program to
> occupy the exact same space it did before.

Come on, that is an easy job to do. Most likely the text section will
be on the same layout and hopefully the only parts that have changes
are the data sections and the stack.

A program that records the state of another process may also be
interested in looking at which mmap()ings were active at the point of
the dump of a program.

The real problem would be with sockets, pipes and some file
descriptors, but if your program does not do anything fancy (like
compute intensive jobs).

Emacs and Perl can make use of this feature on some systems: they core
dump (on Perl, you actually, have to tell the interpreter to core dump
to use this feature) to make reloading faster in future invocations of
the program. They require an program called undump to be available on
your system, I believe Emacs ships with an undump program. I don't
know if this have been ported to Linux, but it would be a nice weekend
project for someone.

Miguel.

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.076 / U:1.552 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site