Debugging operating systems with time-traveling virtual machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan.

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Process Description and Control
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
1 Building a Fast, Virtualized Data Plane with Programmable Hardware Bilal Anwer Nick Feamster.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
OPERATING SYSTEMS Lecturer: Szabolcs Mikulas Office: B38B
1 Processes and Threads Creation and Termination States Usage Implementations.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Chapter 1 Introduction Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Introduction Abstract Views of an Operating System.
Real Time Versions of Linux Operating System Present by Tr n Duy Th nh Quách Phát Tài 1.
CS 695 Host Forensics: Auditing Using VMs GEORGIOS PORTOKALIDIS.
CS136, Advanced Architecture
Randomized Algorithms Randomized Algorithms CS648 1.
Content Overview Virtual Disk Port to Intel platform
Chapter 4 Memory Management Basic memory management Swapping
ABC Technology Project
Project 5: Virtual Memory
Hardware-assisted Virtualization
1 Overview Assignment 4: hints Memory management Assignment 3: solution.
Chapter 3 Memory Management
Memory Management.
© 2010 VMware Inc. All rights reserved Application-level mobile virtualization Harvey Tuch, Staff Engineer, Mobile Virtualization Platform January 25 th.
Operating Systems Operating Systems - Winter 2011 Dr. Melanie Rieback Design and Implementation.
Operating Systems Operating Systems - Winter 2012 Dr. Melanie Rieback Design and Implementation.
OS Components and Structure
COMP1214 Systems & Platforms: Operating Systems Concepts Dr. Yvonne Howard – Rikki Prince – 1.
Processes Management.
Executional Architecture
KAIST Computer Architecture Lab. The Effect of Multi-core on HPC Applications in Virtualized Systems Jaeung Han¹, Jeongseob Ahn¹, Changdae Kim¹, Youngjin.
© 2004, D. J. Foreman 1 Scheduling & Dispatching.
Addition 1’s to 20.
25 seconds left…...
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.
Week 1.
We will resume in: 25 Minutes.
NetSlices: Scalable Multi-Core Packet Processing in User-Space Tudor Marian, Ki Suh Lee, Hakim Weatherspoon Cornell University Presented by Ki Suh Lee.
Debugging operating systems with time-traveling virtual machines Sam King, George Dunlap & Peter Chen University of Michigan Min Xie Slides modifed using.
OS Spring’03 Introduction Operating Systems Spring 2003.
Operating System Support for Virtual Machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
CSE598C Virtual Machines and Their Applications Operating System Support for Virtual Machines Coauthored by Samuel T. King, George W. Dunlap and Peter.
Presented by: Zhiyong (Ricky) Cheng Samuel T. King, George W. Dunlap, and Peter M. Chen University of Michigan.
A Portable Virtual Machine for Program Debugging and Directing Camil Demetrescu University of Rome “La Sapienza” Irene Finocchi University of Rome “Tor.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
Operating System Support for Virtual Machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
CS533 Concepts of Operating Systems Jonathan Walpole.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
Seminar of “Virtual Machines” Course Mohammad Mahdizadeh SM. University of Science and Technology Mazandaran-Babol January 2010.
Simics: A Full System Simulation Platform Synopsis by Jen Miller 19 March 2004.
Full and Para Virtualization
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to threads
Virtualization.
Operating System Structure
Presented by Yoon-Soo Lee
Disco: Running Commodity Operating Systems on Scalable Multiprocessors
OS Virtualization.
Operating System Support for Virtual Machines
A Survey on Virtualization Technologies
Auditing Using Virtual Machines
Presentation transcript:

Debugging operating systems with time-traveling virtual machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan

Sam King University of Michigan 2 of 21 Cyclic debugging Iterate, revisit previous states Inspect state of the system at each point

Sam King University of Michigan 3 of 21 Problems with cyclic debugging Long runs Each iteration costly Non-determinism Code might take different path each time bug executed Bug may not be triggered at all Especially relevant for multithreaded apps, OS

Sam King University of Michigan 4 of 21 Example: NULL pointer Walk call stack Variable not modified ptr == NULL?

Sam King University of Michigan 5 of 21 Example: NULL pointer Set a conditional watchpoint ptr might change often ptr == NULL?

Sam King University of Michigan 6 of 21 Example: NULL pointer Conditional watchpoint Different code path, variable never set to NULL All these are trying to find the LAST modification

Sam King University of Michigan 7 of 21 Debugging with time traveling virtual machines Provide what cyclic debugging trying to approx. ptr = NULL!

Sam King University of Michigan 8 of 21 Debugging with time traveling virtual machines (TTVM) Reverse equivalent to any debugger motion function Reverse watchpoint, breakpoint, step Implement using time travel to previous states Must be identical to buggy run Instruction level granularity

Sam King University of Michigan 9 of 21 Overview Virtual machine platform Efficient checkpoints and time travel ReVirt: virtual machine replay system Using time travel for debugging Live demo Conclude

Sam King University of Michigan 10 of 21 Typical OS level debugging Requires two computers OS state and debugger state are in same protection domain crashing OS may hang the debugger host machine application operating system debugging stub host machine kernel debugger operating system

Sam King University of Michigan 11 of 21 Using virtual-machines for debugging host machine application operating system application kernel debugger virtual machine monitor [UML: includes host operating system] debugging stub Guest OS, operating system running inside virtual machine Debugger functions without any help from target OS Works even when guest kernel corrupted Leverage convenient abstractions provided by VM How similar is the guest OS?

Sam King University of Michigan 12 of 21 Similarity of guest OS Want guest OS to be similar to host OS so bugs are portable Differences not fundamental, result of VM platform we use Architecture dependent code different between guest OS Low-level trap handling MMU functionality Device drivers Use the same host driver in guest Trap and forward privileged instructions from guest IN/OUT instructions Memory mapped I/O Interrupts DMA 98% of Linux code runs unmodified in User-Mode Linux

Sam King University of Michigan 13 of 21 Checkpoints: coarse grained time travel Periodic checkpoints for coarse grained time travel Save complete copy of virtual-machine state: simple but inefficient CPU registers virtual machines physical memory image virtual machines disk image Instead, use copy-on-write and undo/redo logging Technique applied both to memory and disk

Sam King University of Michigan 14 of 21 How to time travel backward checkpoint 1 redo log undo log

Sam King University of Michigan 15 of 21 ReVirt: fine grained time travel Based on previous work (Dunlap02) Re-executes any part of the prior run, instruction by instruction Re-creates all state at any prior point in the run Logs all sources of non-determinism external input (keyboard, mouse, network card, clock) interrupt point Low space and time overhead SPECweb, PostMark, kernel compilation logging adds 3-12% time overhead logging adds 2-85 KB/sec

Sam King University of Michigan 16 of 21 How to time travel backward checkpoint 1 redo log undo log

Sam King University of Michigan 17 of 21 Using time travel to implement reverse watchpoints Example: reverse watchpoint First pass: count watchpoints Second pass: wait for the last watchpoint before current time checkpoint

Sam King University of Michigan 18 of 21 Using TTVM Checkpoint at moderate intervals (e.g., 25 seconds) < 4% time overhead < 6 MB/s space overhead Exponentially thin out prior checkpoints (Boothe 00) Take checkpoints at short intervals (e.g., 10 seconds) < 27% time overhead < 7 MB/s space overhead

Sam King University of Michigan 19 of 21 Experiences with TTVM Corrupted debugging information TTVM still effective when stack was corrupted Device driver bugs Handles long runs Non-determinism Device timing issues Race condition bugs Live demo

Sam King University of Michigan 20 of 21 Live demo

Sam King University of Michigan 21 of 21 Conclusions Programmers want to debug in reverse Current debugging techniques are poor substitutes for reverse debugging Time traveling virtual machines efficient and effective mechanism for implementing reverse debugging

Sam King University of Michigan 22 of 21 Questions

Sam King University of Michigan 23 of 21 Multi-processor support Checkpointing does not change Must be able to support replay Topic of ongoing research Support at hardware level, flight data recorder () – Fast, limited amount of time recorded Software level, page protections to track sharing – Might be slow? Might not allocate all processors to one OS

Sam King University of Michigan 24 of 21

Sam King University of Michigan 25 of 21

Sam King University of Michigan 26 of 21

Sam King University of Michigan 27 of 21