17

I would like to know: Is there a system call, library, kernel module or command line tool I can use to store the complete state of a running program on the disk?

That is: I would like to completely dump the memory, page layout, stack, registers, threads and file descriptors a process is currently using to a file on the hard drive and be able to restore it later seamlessly, just like an emulator "savestate" or a Virtual Machine "snapshot".

I would also like, if possible, to have multiple "backup copies" of the program state, so I can revert to a previous execution point if the program dies for some reason.

Is this possible?

Marco Aurélio
  • 2,463
  • 1
  • 21
  • 21
  • 1
    possible duplicate of ['Hibernate' a process in linux](http://stackoverflow.com/questions/2134771/hibernate-a-process-in-linux) – ergosys Apr 18 '11 at 02:52
  • There is a similar questioned [asked on unix.exchange](http://unix.stackexchange.com/questions/23078/suspend-resume-single-process-to-from-disk) – Rick Smith May 04 '15 at 21:03

2 Answers2

2

You should take a look at the BLCR project from Berkeley Lab. This is widely used by several MPI implementations to provide Checkpoint / Restart capabilities for parallel applications.

crazyg33k
  • 165
  • 9
  • "There isn't any support for 3.x kernels yet. Until there is support for that there's little point patching the configure script to be able to locate 3.x kernels correctly, which is where this error comes from." --https://hpcrdm.lbl.gov/pipermail/checkpoint/2012-June/000427.html Any suggestions? I really want to get this to work. – John P Feb 17 '17 at 20:39
1

A core dump is basically this, so yes, it must be possible to get.

What you really want is a way to restore that dump as a running program. That might be more difficult.

drysdam
  • 8,341
  • 1
  • 20
  • 23