Self Recovery in Server Programs The University of California, Riverside Vijay Nagarajan Dennis JeffreyRajiv Gupta International Symposium on Memory Management.

Slides:



Advertisements
Similar presentations
Remus: High Availability via Asynchronous Virtual Machine Replication
Advertisements

Page Replacement Algorithms
Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Paging: Design Issues. Readings r Silbershatz et al: ,
Data Dependencies Describes the normal situation that the data that instructions use depend upon the data created by other instructions, or data is stored.
Presented By: Krishna Balasubramanian
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
SHelp: Automatic Self-healing for Multiple Application Instances in a Virtual Machine Environment Gang Chen, Hai Jin, Deqing Zou, Weizhong Qiang, Gang.
1 Rx: Treating Bugs as Allergies – A Safe Method to Survive Software Failures Feng Qin Joseph Tucek Jagadeesan Sundaresan Yuanyuan Zhou Presentation by.
7. Fault Tolerance Through Dynamic (or Standby) Redundancy The lowest-cost fault-tolerance technique in multiprocessors. Steps performed: When a fault.
Quick Review of May 1 material Concurrent Execution and Serializability –inconsistent concurrent schedules –transaction conflicts serializable == conflict.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 23 Database Recovery Techniques.
LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks Feng Qin, Cheng Wang, Zhenmin Li, Ho-seop Kim, Yuanyuan.
Chapter 19 Database Recovery Techniques. Slide Chapter 19 Outline Databases Recovery 1. Purpose of Database Recovery 2. Types of Failure 3. Transaction.
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
Transaction Management WXES 2103 Database. Content What is transaction Transaction properties Transaction management with SQL Transaction log DBMS Transaction.
1 RAKSHA: A FLEXIBLE ARCHITECTURE FOR SOFTWARE SECURITY Computer Systems Laboratory Stanford University Hari Kannan, Michael Dalton, Christos Kozyrakis.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 1) Academic Year 2014 Spring.
Towards a Hardware-Software Co-Designed Resilient System Man-Lap (Alex) Li, Pradeep Ramachandran, Sarita Adve, Vikram Adve, Yuanyuan Zhou University of.
Distributed Deadlocks and Transaction Recovery.
Vulnerability-Specific Execution Filtering (VSEF) for Exploit Prevention on Commodity Software Authors: James Newsome, James Newsome, David Brumley, David.
Failure Spread in Redundant UMTS Core Network n Author: Tuomas Erke, Helsinki University of Technology n Supervisor: Timo Korhonen, Professor of Telecommunication.
CH2 System models.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Presentation of Failure- Oblivious Computing vs. Rx OS Seminar, winter 2005 by Lauge Wullf and Jacob Munk-Stander January 4 th, 2006.
A Framework for Elastic Execution of Existing MPI Programs Aarthi Raveendran Graduate Student Department Of CSE 1.
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
SafetyNet: improving the availability of shared memory multiprocessors with global checkpoint/recovery Daniel J. Sorin, Milo M. K. Martin, Mark D. Hill,
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
Chapter 16 Recovery Yonsei University 1 st Semester, 2015 Sanghyun Park.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally VIRTUALMEMORY.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 20 Slide 1 Critical systems development 3.
(C) 2003 Daniel SorinDuke Architecture Dynamic Verification of End-to-End Multiprocessor Invariants Daniel J. Sorin 1, Mark D. Hill 2, David A. Wood 2.
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
Fast Crash Recovery in RAMCloud. Motivation The role of DRAM has been increasing – Facebook used 150TB of DRAM For 200TB of disk storage However, there.
Operating Systems Lecture 14 Segments Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
1 A Secure Access Control Mechanism against Internet Crackers Kenichi Kourai* Shigeru Chiba** *University of Tokyo **University of Tsukuba.
Hwajung Lee. One of the selling points of a distributed system is that the system will continue to perform even if some components / processes fail.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Chapter 10 Recovery System. ACID Properties  Atomicity. Either all operations of the transaction are properly reflected in the database or none are.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Protecting The Kernel Data through Virtualization Technology BY VENKATA SAI PUNDAMALLI id :
Dynamic Taint Analysis for Automatic Detection, Analysis, and Signature Generation of Exploits on Commodity Software Paper by: James Newsome and Dawn Song.
A Binary Agent Technology for COTS Software Integrity Anant Agarwal Richard Schooler InCert Software.
Threaded Programming Lecture 1: Concepts. 2 Overview Shared memory systems Basic Concepts in Threaded Programming.
SENG521 (Fall SENG 521 Software Reliability & Testing Fault Tolerant Software Systems: Techniques (Part 4a) Department of Electrical.
CSE 351 Caches. Before we start… A lot of people confused lea and mov on the midterm Totally understandable, but it’s important to make the distinction.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Exploration 3 Chapter 4. What is VTP? VTP allows a network manager to configure a switch so that it will propagate VLAN configurations to other switches.
Qin Zhao1, Joon Edward Sim2, WengFai Wong1,2 1SingaporeMIT Alliance 2Department of Computer Science National University of Singapore
Memory Protection through Dynamic Access Control Kun Zhang, Tao Zhang and Santosh Pande College of Computing Georgia Institute of Technology.
Week#3 Software Quality Engineering.
Process Management Deadlocks.
Database Recovery Techniques
Presented by: Daniel Taylor
Data Prefetching Smruti R. Sarangi.
Prepared by Ertuğrul Kuzan
Paging COMP 755.
Introduction to Operating Systems
Chapter 9: Virtual-Memory Management
CS 632 Lecture 6 Recovery Principles of Transaction-Oriented Database Recovery Theo Haerder, Andreas Reuter, 1983 ARIES: A Transaction Recovery Method.
Fault Tolerance Distributed Web-based Systems
Recovery System.
Data Prefetching Smruti R. Sarangi.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Database Recovery 1 Purpose of Database Recovery
COMP755 Advanced Operating Systems
Abstractions for Fault Tolerance
MapReduce: Simplified Data Processing on Large Clusters
Presentation transcript:

Self Recovery in Server Programs The University of California, Riverside Vijay Nagarajan Dennis JeffreyRajiv Gupta International Symposium on Memory Management June 19, 2009

Server Availability Long-running server programs: availability threatened by software failures Memory errors a significant problem –Buffer overflows, format string errors, etc. –National Vulnerability Database, 2008: 30% software failures caused by memory errors Memory bug defect  triggered by user request  memory corruption  crash, or software attack due to malicious user input

Checkpointing/Rollback Technique One commonly used technique to recover from a failure –[Gray ‘86, Plank ’98, Qin ’05, Randell ’78, Tallam ’08] Main principle –Periodically checkpoint state –On failure, rollback to most recent safe state –Replay benign user requests from safe state to failure point Limitations –Checkpointing can have high overhead –Rollback can affect throughput and response time –Inherent tradeoff Small checkpoint interval  rollback improved, but time/space overhead Large checkpoint interval  overhead improved, but throughput and response time degrades

Memory Corruption Propagation Is expensive checkpointing/rollback scheme necessary? –Perhaps, if memory corruption undergoes significant propagation –Perhaps not, if memory corruption is relatively isolated Memory corruption –Memory location contains an unexpected value (e.g., overflow) Memory corruption propagation –The spreading of memory corruption as computation progresses –New values become corrupt due to existing corrupt values –Corrupt values become uncorrupted when they are overwritten with an uncorrupt value (e.g., reusing a variable)

How Corruption Propagates Does the number of corrupted locations steadily increase? –Dominated by “uncorrupt  corrupt” transitions –Very quickly, memory may be filled with corrupt locations and computation can’t proceed –May justify the need for checkpointing/rollback Or, does the number of corrupted locations stabilize or vanish? –Significant “corrupt  uncorrupt” transitions –This “self cleansing” can be leveraged for recovery –May suggest that checkpoint/rollback is unnecessary

Study: Corruption Propagation Understand how memory corruption can propagate in server programs One way: study the memory corruption propagation in real bugs –Limited: depends on what is corrupted in the bugs we choose A more comprehensive approach –Consider multiple runs, multiple requests per run –In each run, assume one of the store instruction instances causes corruption Do this for different store instruction instances in each run –Simulate memory corruption propagation For each instruction, if any of the source values are corrupt, then the target value is also corrupt (else, target is not corrupt) –Study the number of corrupt locations: max versus final

Subjects and Implementation Server programs considered –mysqld : database management server –cvs : version control system –squid : web proxy cache server –apache : web server Implementation –Associate a corruption bit with each memory location and register (initially, the bit is not set) –Every execution marks some unique store as corrupt –Propagate the corruption bits –Implemented in the Valgrind dynamic binary translation framework

Observations from Study General patterns we observed –(A) # corrupted locations increases over time –(B) # corrupted locations increases, but is partially reverted to uncorrupt as memory gets deallocated / overwritten –(C) # corrupted locations increases, but is fully reverted by the end Studied the distribution of max and final # of corrupted locations –Max: the highest point in each graph –Final: the right-most value in each graph It turns out that case (C) is the most common case, and usually max is quite low Execution Time # Corrupt Locations (A) Execution Time # Corrupt Locations (B) Execution Time # Corrupt Locations (C)

Illustration: Max vs. Final

Self Cleansing In nearly 80% of cases, all corrupted locations revert back to uncorrupt state by the end Key observation: a memory location marked corrupt usually corrupts relatively few other locations, most of which are uncorrupted by the end of processing of a user request Why does this “self cleansing” occur? –Conduct a study of isolation to understand the cause

Study: Isolation To determine the degree of isolation across user requests inherent in servers Methodology –Send several user requests to server –Determine memory shared across user requests Written by one request, read by subsequent request Maintain a request id with each memory location –Vary the request sizes and observe the effect on shared state

Illustration: Shared vs. Not Shared

Observations from Isolation Study Relatively small % of memory was shared across user requests As request size increases: –# non-shared locations increases –# shared locations stays about the same Evidence points to high isolation: only small global state is shared –Most state is local to a user request, and deallocated / overwritten before the next request Program Name% of Accessed Memory Locations that are Shared mysqld 10.4% cvs 15.6% squid 6.2% apache 35.7%

Summary of Study Requests share small fixed global state –When global state corrupted, corruption persists across requests Most state is local to a user request –When local state corrupted, corruption vanishes by the end of the user request Take advantage of this self-cleansing property

SRS: Self Recovery in Servers Key idea: when a server experiences a failure: –Do not actually crash  nullify and isolate the current request –Continue to process future user requests Ensure corrupt state is not visible during processing Take advantage of self-cleansing for recovery without checkpointing/rollback SRS approach –When a failure happens, do not crash; execute forward to trigger self cleansing Current request executed in crash suppression mode –Ensure isolation: handle (uncommon) case when benign request needs to access corrupted memory location On-demand restoration to an earlier uncorrupt value

Crash Suppression When crash occurs during user request: –Execute forward to trigger self cleansing –Crash suppression prevents additional crashes Semantics of suppression –When initial crash is detected at an instruction, suppress the crash and mark the target as “corrupt” Each register and memory location associated with a “corrupt” bit –Propagate the “corrupt” bits during rest of request If any source operands are “corrupt”, then suppress the instruction and mark the target “corrupt” Ensures that any subsequent instructions dependent upon the corrupt location are suppressed as well –But what about values already written by the faulty request?

Ensuring Isolation Need to isolate faulty request from future requests –Values written by faulty request should be invisible to later requests Only relatively small global state needs to be handled Identify global state using profiling –TrackSet: set of memory locations used across user requests Maintain a rollback value for each entry in TrackSet –When location in TrackSet is about to be written in a request, save the prior (uncorrupt) value into the TrackLog When benign request needs to access a value written by a faulty request –Restore the prior uncorrupt value on demand from the TrackLog

Monitoring Shared Locations Identify TrackSet through profiling –Give several user requests to the server –Identify the shared locations as well as the instructions that write to these shared locations Maintain TrackLog –Used for reverting corrupt location to its prior uncorrupt state when necessary –Allocate memory for TrackLog at the start of a request Each TrackLog entry is an (address, prior-value) pair –When instruction writes to location in TrackSet, store prior value into TrackLog

Demand Driven Restoration Identify when a request needs to read a corrupt location previously written by a faulty request –At each store, associate request id with the memory location, showing which request last defined it –When a crash occurs, remember the current request id as a “faulty” one For benign requests after a crash, may need to perform on-demand restoration of corrupt values –For all loads, check if value to be loaded is corrupt (look at request id) –If corrupt, obtain the value from the TrackLog If value not in TrackLog, restart the server (fail-safe condition, can occur if shared location not identified during profiling)

Summary of SRS Offline step –Profile to identify TrackSet and stores operating on it Online steps –Monitor location accesses and handle crashes Maintain TrackLog for stores that operate on TrackSet Associate current request id with each store If crash detected: add current request id to faulty list, and run in crash suppression mode to the end of the current request –Additional steps when recovering from crash Check whether each load needs to access a corrupt location –Restore value from TrackLog if possible, else restart server

Experimental Evaluation Benchmarks: mysqld, cvs, squid, apache –Considered 1 memory bug in each benchmark For our memory study and for running SRS: –Used Valgrind shadow memory and instrumentation support For performance evaluation: –Used dynamoRIO dynamic code modification system Because Valgrind imposes higher overheads –Required some manual source code changes to handle shadow memory

Running SRS: Recovery in Presence of Crash Each subject program given 10 user requests –5 th request triggers a failure SRS enters crash suppression mode once fault triggered For future benign requests, SRS was able to perform on-demand restoration and recover –The need to restart server did not arise

Performance of SRS Response time during normal run degraded by 5% –Additional store for each store Maintain TrackLog Store request id –Instrumentation tolerable since programs not CPU-intensive Response time after recovery degraded by 8% –Additional check at each load Fail-safety check to possibly restore a corrupt value Overhead during suppression about 3x (graph not shown) –Suppression only performed during a faulty request –Can be improved with DIFT hardware support

Related Work Rebooting techniques –Whole program restart [Gray 1986] –Selective restarting of certain components [Candea 2004] Recovery-oriented computing [Oppenheimer 2002, Patterson 2002] –Software components designed to be isolated to reduce failure impact Checkpointing/rollback –Already described in this talk Failure-oblivious computing [Rinard 2004] –Instead of crashing, server continues execution Discard illegal writes Manufacture appropriate values for illegal reads –Success hinges on “self cleansing” property also observed in our work –Whereas this approach does not cancel a faulty user request, our SRS approach attempts to isolate and nullify faulty requests

Conclusions Conducted detailed study of memory corruption propagation in servers –Provided insight into “self cleansing” property –User requests share small global state Proposed SRS approach –Takes advantage of “self cleansing” property –Recovery without checkpointing / rollback

Start Backup Slides

Observations from Study Min Max = 1 –This is the first location that is corrupted. No more locations are marked corrupt. –Used as loop counter Max Max can be quite large –Median value much smaller –80% of the runs max value is < 10 Max Final considerably smaller than Max Max –Significant # of corrupted locations revert back to uncorrupt state. –Furthermore Min Final = 0 –All corrupted locations revert to uncorrupt state –deallocation/ overwritten –True for 80%-90% of the runs! –Self Cleansing

Example