Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checkpoint/restart using Core Dump in Linux

Can Checkpoint/restart be implemented using the core dump of a process? The core file contains a complete memory dump of the process, thus in theory it should be possible to restore the process to the same state it was in when the core was dumped.

like image 950
rogue_knight9 Avatar asked Apr 16 '13 21:04

rogue_knight9


People also ask

What is core dump in Linux?

A core dump is a file containing a process's address space (memory) when the process terminates unexpectedly. Core dumps may be produced on-demand (such as by a debugger), or automatically upon termination.

What is core dump checkpoint?

Introduction. A process core dump file consists of the recorded status of the working memory of the Gaia. Check Point security operating system that combines the strengths of both SecurePlatform and IPSO operating systems. computer at the time that a Gaia process terminated abnormally.

Where is core dump in Linux?

In a terminal, run sleep 30 to start a process sleeping for 30 seconds. While it is running, press Ctrl + \ to force a core dump. You'll now see a core file in the directory you are in.


1 Answers

Yes, this is possible. GNU Emacs does this to optimize its startup time. It loads a bunch of Lisp files to produce an image and then dumps a core which can be restarted.

Several years ago, I created a patch for GNU Make 3.80 to do exactly the same thing (using code borrowed from GNU Emacs).

With this patch, you have a new option in make: make --dump. The utility now reads your Makefile, and then instead of executing the rules, it produces a core dump which can be restarted to do the actual build (evaluation of the parsed rule tree).

This was a saving, because the project was so large that loading all of the make rules across the source tree took thirty seconds! With this optimization, incremental builds launched almost instantly, without the half minute startup penalty.

No kernel support is required for this. What is required is knowledge about the structure of the core file.

In addition to this approach, there was a process checkpointing project for Linux many years ago (wonder what happened to that).

like image 110
Kaz Avatar answered Sep 19 '22 13:09

Kaz