Automatic Checkpointing - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Automatic Checkpointing

Description:

Used to store a variety of static and variable data ... Statically declared memory. Variable memory. Undeclared memory. How is it done? Code ... – PowerPoint PPT presentation

Number of Views:9
Avg rating:3.0/5.0
Slides: 18
Provided by: vult1
Category:

less

Transcript and Presenter's Notes

Title: Automatic Checkpointing


1
Automatic Checkpointing
  • Sean Stanek
  • CprE 545

2
What is it?
  • Saves complete checkpoint of program without
    requiring additional programming
  • Advantages
  • Easy to use
  • Programmer does not need to worry about it
  • Disadvantages
  • May not work as desired
  • May not work at all

3
How is it done?
  • Process in memory has a state
  • Data
  • Code
  • Stack
  • Processor State
  • OS/Process State

4
How is it done?
  • Data
  • Used to store a variety of static and variable
    data
  • Data memory is composed of one or more segments
    of bytes
  • Statically declared memory
  • Variable memory
  • Undeclared memory

5
How is it done?
  • Code
  • Binary data that defines a program
  • Program code is actually the same as data memory
  • Typically has different attributes on its memory
    segment to allow it to execute code
  • Need to save these additional attributes

6
How is it done?
  • Stack
  • Stores local variables
  • Stores procedure return addresses
  • Stack is also just memory, but it is in a
    different location

7
How is it done?
  • Processor State
  • Registers
  • General purpose registers
  • Extra registers (FPU, etc.)
  • Program counter (Instruction pointer)
  • Special purpose registers
  • Flags
  • Potentially special attributes about the process

8
How is it done?
  • OS/Process State
  • Open files
  • File positions
  • File buffers
  • File attributes
  • Network connections
  • Open libraries

9
How is it done?
  • OS/Process State (continued)
  • Process State
  • Hooked signals
  • Message queue
  • Timers/Alarms
  • OS/API hooks

10
When can it be used?
  • Before starting a process
  • Process Snooper / Spy
  • Perform timed checkpoint
  • After starting a process
  • Attach to process to spy
  • Timed checkpoint (but not always running)
  • One-time checkpoint

11
How can it recover?
  • Reload code, data, and stack segments
  • Reload processor states
  • Reload process states
  • Reload OS states
  • Continue execution of code from checkpoint
  • Not always recoverable

12
What problems are there?
  • An open file on disk has changed since last
    checkpoint
  • Open file positions may be stale
  • Buffered file data may be stale
  • Might corrupt data by writing back to disk
  • Just keep copy of file?
  • Too much data
  • Does not solve a bigger problem

13
What problems are there?
  • Open network connections
  • Impossible to recover remote state
  • Both sides would have to checkpoint at same time
  • Still probably would not fix the problem

14
What problems are there?
  • Checkpoint after a fault but before detection
  • Program may crash as a result of a fault from
    long before
  • Keep multiple checkpoints?
  • Would use very large amount of data
  • If restricting number of checkpoints kept, still
    does not guarantee a working checkpoint
  • May be difficult to find last correct checkpoint

15
Functions to Manage Checkpoints
  • Unix/Linux
  • ptrace() system call
  • PTRACE_ATTACH
  • PTRACE_PEEKDATA
  • PTRACE_POKEDATA
  • etc.
  • Win32
  • AttachProcess()
  • ReadProcessMemory()
  • WriteProcessMemory()
  • etc.

16
CPU/OS specific data
  • Would require additional programming for every
    new CPU and OS
  • May not be able to retrieve all vital process
    states given user privilege level
  • Might be easier to modify the OS to retrieve all
    this information, but then would not be an
    easy-to-use user mode process

17
Additional Uses
  • If a program crashes, may be able to reload
    checkpoint in debug mode to track down bugs
  • Word processing (already implemented, manually)
  • Could recover other vital program data otherwise
    lost to program crash
Write a Comment
User Comments (0)
About PowerShow.com