SlideShare a Scribd company logo
1 of 25
Download to read offline
An Overview of Distributed Debugging
Anant Narayanan

Advanced Topics in Distributed Systems
November 17, 2009
The Problem
Introduction
Oļ¬„ine

Anything that can go wrong will go wrong

liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

Debugging is frustrating. Distributed debugging even more so!
Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

2 of 21
Why is this hard?
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Errors are rarely reproducible
Non-determinism plays a big role in distributed systems

Remote machines appear to crash more often!

Conclusion

Interactions between several diļ¬€erent components
(possibly written in diļ¬€erent languages) running on
diļ¬€erent computers are extremely intricate
Communication is unreliable and asynchronous
Existing debuggers are simply inadequate

Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

3 of 21
Possible Approaches
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

OFFLINE
METHODS

Online
D3 S
CrystalBall

Conclusion

BEFORE

DURING

AFTER

ONLINE
METHOD

Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

4 of 21
Outline
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

1

After
Logging (liblog)
Pervasive debuggers
Time travel (TTVM)

Online
D3 S
CrystalBall

Conclusion

2

Before

3

During

Model checking (MaceMC)
D3 S
CrystalBall

Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

5 of 21
Logging
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

Example
printf("The value of x at node %d:

%d", nr, x);

The most primitive form of debugging, we all do it!
However, extremely diļ¬ƒcult to capture all state, and thus
can be used only for small bugs
Wonā€™t it be a good idea to automatically capture and
store all state information so we can analyze and possibly
replay it at a later time?

Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

6 of 21
Yes, it would!
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

application

application

other libs

other libs

liblog
libc

logger
libc

liblog
libc

GNU/Linux
x86 Hardware
Figure 1: Logging: liblog intercepts calls to libc and
sends results to logger process. The latter asynchronously
compresses and writes the logs to local storage.

2.2

Message Tagging and

The second deļ¬ning aspect of our
proach to replaying network com
contents of all incoming message
process can be replayed independ

This ļ¬‚exibility comes at the
space (cf. Section 5) but is w
projects have tried the alternative,
and regenerating message conte
cannot do so because we operate i
with non-logging processes. Eve
tion logs may be unavailable for
ing disk or network failure.

Intercepts all calls to libc using LD PRELOAD So far we satisfy one requireme
to coordinate these individual re

vide another, Consistent Group R

2.1 Shared logging with deterministic and Lamport clocks
Provides continuous Library Implementation
we embed 8-byte
ing messages during execution an
The core of our debugging tool is a shared library (the
consistent groupliblog), which intercepts calls to libc (e.g., clocks to schedule replay. The c
eponym replay in a mixed environment
select, gettimeofday) and logs their results. Our

ensures that the timestamps in eac

start-up scripts use provide central replay in a familiar
Integrates with gdb to the LD PRELOAD linker variable to ā€œhappens-beforeā€ relationship. Th
venient way to correlate messag
interpose liblog between libc and the application
environment and its other libraries (see Figure 1). liblog runs on ception events, so we can trace co

Linux/x86 computers and supports POSIX C/C++ applications.
Nov. 17, ATDS, Vrije Universiteit ā€”chose to build Distributed Debugging
We Anant
a library-based tool because op-

chine to machine.

To make the virtual clocks mor
7 of 21
Challenges
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

Signals and Threads
User-level cooperative scheduler on top of OS scheduler

Unsafe Memory Access
All malloc calls are eļ¬€ectively calloc

Consistent Replay for UDP/TCP
Packets are annotated

Finding Peers in a Mixed Environment
Local ports are tracked
Initialization with other liblog hosts occurs

Is liblog for you?
High disk usage; heterogenous systems and tight spin-locks
disallowed; 16 byte per-message network overhead; and ļ¬nally,
limited consistency
Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

8 of 21
A Pervasive Debugger
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online

Debuggers are unable to access all the state that we
sometimes need because it is just another program!
Debugging is usually either vertical or horizontal:

D3 S
CrystalBall

Conclusion

Java
client

Java
client

Java
Virtual
Machine
Linux
operating
system

C web
server
FreeBSD
operating
system

virtual machine monitor

(a)

Java
Virtual
Machine
Linux
operating
system

C web
server
FreeBSD
operating
system

virtual machine monitor

(b)

Nov. 17, ATDS, Vrije Universiteit ā€” Anant
Distributed Debugging
Figure 1: (a) Horizontal debugging with

multiple

Although
and cont
point in
the targe
issued ex
debug ta

2.2 E

The st
of its me
of each e
debug ta
software
each targ
threads,
Auxilia
9 of 21
cannot d
A Pervasive Debugger
Introduction
Oļ¬„ine

process

liblog
Pervasiveness
TTVM
MaceMC

virtual
machine

Online

threads
process

operating system

D3 S
CrystalBall

process
operating
system

Conclusion

pervasive debugger

Nov.

3.1

Ext

Each deb
its environm
memory ad
ters) of the
amine the
include the
example, a
ļ¬le that ha

3.1.1

Ob

Since the
target, the
Figure 2: The pervasive debugger enables both horenvironmen
izontal and vertical debugging.
scheme sim
Why are debuggers peers of the application being
vironment.
identify a ļ¬
debugged rather thanthread. Pervasive debugging extends
nipulate a process or being placed in the underlying
length to id
this to include the underlying software and hardware layers;
system?
connections
all interactions between the process and its environment can
the
This be examined. Weallows us to perform both vertical and name a
architecture term this vertical debugging.
If we con
The environment in which an operating system executes
then we can
horizontal debugging just memory and processor state.
encompasses more than
records in t
The operating system can access all of the various hardware
be 10 of 21
read, th
17, ATDS, Vrije Universiteit ā€” Anant
Distributed Debugging
devices attached to the machine. Therefore, in the context
Letā€™s Look at an Application
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

A Virtual Machine Monitor (VMM) is capable of
monitoring and logging a lot more state than is possible by
a userspace library!
By running an application inside a VM, we are able to log
not just CPU instructions, memory, network and disk I/O,
but also interrupts, clock values, signals
We can also log byte-for-byte network, memory and disk
Remember, device drivers can have bugs too!

Time-traveling virtual machines take advantage of all this
by using User Mode Linux (UML) and integrating with gdb
to provide a uniļ¬ed, easy to use debugging environment

Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

11 of 21
How This Works
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

gdb

guest-user
host process

guest-kernel
host process

TTVM functionality
(checkpointing, logging, replay)

Online
D3 S
CrystalBall

host operating system

Conclusion

Figure 1: System structure: UML runs as two user pro-

card is emu
driver; the
mmap and m
vice interru
GIO signals
output. The
uses these h
ware.

In additionon the host Linux OS,mentioned state parameters,
cesses to all the earlier the guest-kernel host proUsing a
cess and the guest-user checkpoints at regular intervals the is
the system takes systemhost process. TTVMā€™s ability to
raises
travel forward and back in time is implemented
to to
The host operating system, UML and gdb by modare modiļ¬ed an OS t
ifying the host OS. We extend gdb to make use of this
that one ca
allowtime traveling functionality. gdb communicates with the ging the gu
time-travel back to earlier checkpoints, replaying
execution with host process via a remote serial protocol.
guest-kernel breakpoints
VMM: as th
Performance
Checkpointing everyVMM adds just 4%and well-deļ¬ned inFinally, a 25s offers a narrow overhead!

terface: the interface of a physical machine. This inter-

Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

the hardwa
para-virtual
and it becom
be debugge
may also m
12 of 21
Model Checking
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

Weā€™ve seen what tools we can use after a bug has been found,
is there anything we can do before deploying an application?
Model checkers, which basically perform state space
exploration, can be used to gain conļ¬dence in a system
MaceMC is one such model checker, tailored for verifying
large distributed applications
Deļ¬nition
Safety Property
A property that should always be satisļ¬ed
Liveness Property
A property that should always be eventually satisļ¬ed
Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

13 of 21
Life, Death and the Critical Transition
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

Each node is a state machine
At each step in the execution, an event handler for a
particular pending event at a node is called
Thus, the entire system is to be represented as a giant
state machine with speciļ¬c event handlers deļ¬ned
Of course, liveness and safety properties are required by
MaceMC to start the checks
Deļ¬nition
Critical transition
A transition from a live state to a dead state, from which a
liveness property can never be satisļ¬ed

Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

14 of 21
3 step process
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

1
2
3

Bounded depth-ļ¬rst search
Random walks
Isolating critical transitions

operty would have to capture the following: ā€œAlOnline
eachSmessage in the inļ¬‚ight queue or retransD3
mer queue, either the message is in ļ¬‚ight (in the
CrystalBall
or in the destinationā€™s receive socket buffer, or
Conclusion
verā€™s corresponding IncomingConnection.next
han the message sequence number, or an acgment is in ļ¬‚ight from the destination to the
ith a sequence number greater than or equal to
age sequence number, or the same acknowledgn the senderā€™s receive socket buffer, or a rege is in ļ¬‚ight between the sender and receiver
direction), or . . .ā€ Thus, attempting to spec- Figure 1: State Exploration We perform bounded depth-ļ¬rst
n conditions with safety properties quickly be- search (BDFS) from the initial state (or search preļ¬x): most peerwhelming and hopelessly complicated, espe- riphery states are indeterminate, i.e., not live, and thus are either
en contrasted with the simplicity and succinct- dead or transient. We execute random walks from the periphery
he liveness property: ā€œEventually, for all n in states and ļ¬‚ag walks not reaching live states as suspected violatinļ¬‚ightSize() = 0,ā€ i.e., that eventually there ing executions.
no packets in ļ¬‚ight.
we recommend the following iterative process for
ubtle protocol errors in complex concurrent envi- tialization typically takes many more transitions (cf. Fig. A developer begins by writing desirable high- ure 2), the vast majority of states reached at the periphery
ness properties. As these liveness properties typ- of the exhaustive search are not live. We call these states
Nov. 17, ATDS, Vrije Universiteit ā€” Anant
Distributed Debugging

Is MaceMC for you?

Requires a concrete and theoretical model of your system.
Existing code must be understood and represented as a state
machine and properties! Too much work?
15 of 21
Debugging Deployed Solutions
Introduction
Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion

Because real debuggers run on a live, deployed system!
Instead of verifying liveness properties in advance, why not
let the system itself do a state space search for you?
D3 S does exactly that by letting the developer specify
predicates that are automatically veriļ¬ed by the system
on-the-ļ¬‚y.
Key Challenge
Allowing developers to express predicates easily, verify those
predicates in a distributed manner with minimal overhead, and
without disrupting the system!
Nov. 17, ATDS, Vrije Universiteit ā€” Anant

Distributed Debugging

16 of 21
D3 S Architecture
Introduction
  

Oļ¬„ine
liblog
Pervasiveness
TTVM
MaceMC

Online
D3 S
CrystalBall

Conclusion
!     !


!


!
Figure 1: Overview of D3 S.
% '
()
*(

More Related Content

What's hot

Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanismsRajapriya82
Ā 
GFS & HDFS Introduction
GFS & HDFS IntroductionGFS & HDFS Introduction
GFS & HDFS IntroductionHariharan Ganesan
Ā 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
Ā 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systemskaran2190
Ā 
File replication
File replicationFile replication
File replicationKlawal13
Ā 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed applicationRishikese MR
Ā 
Directory and discovery services
Directory and discovery servicesDirectory and discovery services
Directory and discovery servicesRamchandraRegmi
Ā 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system modelHarshad Umredkar
Ā 
Comet Cloud
Comet CloudComet Cloud
Comet Cloudpradeepas7
Ā 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed SystemsDr Sandeep Kumar Poonia
Ā 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems SHATHAN
Ā 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docxkumari36
Ā 
Virtualization (Distributed computing)
Virtualization (Distributed computing)Virtualization (Distributed computing)
Virtualization (Distributed computing)Sri Prasanna
Ā 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor schedulingShashank Kapoor
Ā 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionSHIKHA GAUTAM
Ā 

What's hot (20)

Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanisms
Ā 
GFS & HDFS Introduction
GFS & HDFS IntroductionGFS & HDFS Introduction
GFS & HDFS Introduction
Ā 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
Ā 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
Ā 
Cloud Security Mechanisms
Cloud Security MechanismsCloud Security Mechanisms
Cloud Security Mechanisms
Ā 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systems
Ā 
File replication
File replicationFile replication
File replication
Ā 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
Ā 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
Ā 
Directory and discovery services
Directory and discovery servicesDirectory and discovery services
Directory and discovery services
Ā 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
Ā 
Comet Cloud
Comet CloudComet Cloud
Comet Cloud
Ā 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed Systems
Ā 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
Ā 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docx
Ā 
Synch
SynchSynch
Synch
Ā 
Virtualization (Distributed computing)
Virtualization (Distributed computing)Virtualization (Distributed computing)
Virtualization (Distributed computing)
Ā 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Ā 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock Detection
Ā 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
Ā 

Similar to An Overview of Distributed Debugging

Performance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memoryPerformance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memoryZongYing Lyu
Ā 
A New Paradigm In Linux Debug From Viosoft Corporation
A New Paradigm In Linux Debug From Viosoft CorporationA New Paradigm In Linux Debug From Viosoft Corporation
A New Paradigm In Linux Debug From Viosoft Corporationart_lee
Ā 
A New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From ViosoftA New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From Viosoftguestc28df4
Ā 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spacesluccastera
Ā 
LOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSLOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSijdpsjournal
Ā 
Lock free parallel access collections
Lock free parallel access collectionsLock free parallel access collections
Lock free parallel access collectionsijdpsjournal
Ā 
Overview
OverviewOverview
Overviewhendriv
Ā 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & JitAnkit Somani
Ā 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & JitAnkit Somani
Ā 
OpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus Networks
OpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus NetworksOpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus Networks
OpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus NetworksOpenStack
Ā 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Hajime Tazaki
Ā 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfsamaghorab
Ā 
Comparing Write-Ahead Logging and the Memory Bus Using
Comparing Write-Ahead Logging and the Memory Bus UsingComparing Write-Ahead Logging and the Memory Bus Using
Comparing Write-Ahead Logging and the Memory Bus Usingjorgerodriguessimao
Ā 
An Optics Life
An Optics LifeAn Optics Life
An Optics LifeThomas Weible
Ā 
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...Andrey Korolyov
Ā 

Similar to An Overview of Distributed Debugging (20)

Performance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memoryPerformance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memory
Ā 
Remote Web Desk
Remote Web DeskRemote Web Desk
Remote Web Desk
Ā 
A New Paradigm In Linux Debug From Viosoft Corporation
A New Paradigm In Linux Debug From Viosoft CorporationA New Paradigm In Linux Debug From Viosoft Corporation
A New Paradigm In Linux Debug From Viosoft Corporation
Ā 
Node.js security tour
Node.js security tourNode.js security tour
Node.js security tour
Ā 
A New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From ViosoftA New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From Viosoft
Ā 
20090720 smith
20090720 smith20090720 smith
20090720 smith
Ā 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
Ā 
LOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSLOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONS
Ā 
Lock free parallel access collections
Lock free parallel access collectionsLock free parallel access collections
Lock free parallel access collections
Ā 
Overview
OverviewOverview
Overview
Ā 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & Jit
Ā 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & Jit
Ā 
.ppt
.ppt.ppt
.ppt
Ā 
OpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus Networks
OpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus NetworksOpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus Networks
OpenStack Networks the Web-Scale Way - Scott Laffer, Cumulus Networks
Ā 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014
Ā 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdf
Ā 
Comparing Write-Ahead Logging and the Memory Bus Using
Comparing Write-Ahead Logging and the Memory Bus UsingComparing Write-Ahead Logging and the Memory Bus Using
Comparing Write-Ahead Logging and the Memory Bus Using
Ā 
LANSim
LANSimLANSim
LANSim
Ā 
An Optics Life
An Optics LifeAn Optics Life
An Optics Life
Ā 
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
Ā 

More from Anant Narayanan

Enterprise Scale Knowledge Graphs
Enterprise Scale Knowledge GraphsEnterprise Scale Knowledge Graphs
Enterprise Scale Knowledge GraphsAnant Narayanan
Ā 
Building an Intelligent Assistant
Building an Intelligent AssistantBuilding an Intelligent Assistant
Building an Intelligent AssistantAnant Narayanan
Ā 
WebRTC: A Practical Introduction
WebRTC: A Practical IntroductionWebRTC: A Practical Introduction
WebRTC: A Practical IntroductionAnant Narayanan
Ā 
Message Passing vs. Data Synchronization
Message Passing vs. Data SynchronizationMessage Passing vs. Data Synchronization
Message Passing vs. Data SynchronizationAnant Narayanan
Ā 
Firebase: Tales from the Trenches
Firebase: Tales from the TrenchesFirebase: Tales from the Trenches
Firebase: Tales from the TrenchesAnant Narayanan
Ā 
WebRTC: An Overview
WebRTC: An OverviewWebRTC: An Overview
WebRTC: An OverviewAnant Narayanan
Ā 
Error Handling in WebRTC
Error Handling in WebRTCError Handling in WebRTC
Error Handling in WebRTCAnant Narayanan
Ā 
WebRTC Demystified
WebRTC DemystifiedWebRTC Demystified
WebRTC DemystifiedAnant Narayanan
Ā 
WebRTC: User Security & Privacy
WebRTC: User Security & PrivacyWebRTC: User Security & Privacy
WebRTC: User Security & PrivacyAnant Narayanan
Ā 
Firefox Architecture Overview
Firefox Architecture OverviewFirefox Architecture Overview
Firefox Architecture OverviewAnant Narayanan
Ā 
Next Generation Browser Add-Ons
Next Generation Browser Add-OnsNext Generation Browser Add-Ons
Next Generation Browser Add-OnsAnant Narayanan
Ā 
A Brief Incursion into Botnet Detection
A Brief Incursion into Botnet DetectionA Brief Incursion into Botnet Detection
A Brief Incursion into Botnet DetectionAnant Narayanan
Ā 
Mozilla Weave: Integrating Services into the Browser
Mozilla Weave: Integrating Services into the BrowserMozilla Weave: Integrating Services into the Browser
Mozilla Weave: Integrating Services into the BrowserAnant Narayanan
Ā 
Distributed File Systems: An Overview
Distributed File Systems: An OverviewDistributed File Systems: An Overview
Distributed File Systems: An OverviewAnant Narayanan
Ā 
Innovating with Mozilla Labs
Innovating with Mozilla LabsInnovating with Mozilla Labs
Innovating with Mozilla LabsAnant Narayanan
Ā 
Glendix: The Why and the How
Glendix: The Why and the HowGlendix: The Why and the How
Glendix: The Why and the HowAnant Narayanan
Ā 
Making Gentoo Tick
Making Gentoo TickMaking Gentoo Tick
Making Gentoo TickAnant Narayanan
Ā 

More from Anant Narayanan (20)

Enterprise Scale Knowledge Graphs
Enterprise Scale Knowledge GraphsEnterprise Scale Knowledge Graphs
Enterprise Scale Knowledge Graphs
Ā 
Building an Intelligent Assistant
Building an Intelligent AssistantBuilding an Intelligent Assistant
Building an Intelligent Assistant
Ā 
WebRTC: A Practical Introduction
WebRTC: A Practical IntroductionWebRTC: A Practical Introduction
WebRTC: A Practical Introduction
Ā 
Message Passing vs. Data Synchronization
Message Passing vs. Data SynchronizationMessage Passing vs. Data Synchronization
Message Passing vs. Data Synchronization
Ā 
Firebase: Tales from the Trenches
Firebase: Tales from the TrenchesFirebase: Tales from the Trenches
Firebase: Tales from the Trenches
Ā 
WebRTC: An Overview
WebRTC: An OverviewWebRTC: An Overview
WebRTC: An Overview
Ā 
Error Handling in WebRTC
Error Handling in WebRTCError Handling in WebRTC
Error Handling in WebRTC
Ā 
WebRTC Demystified
WebRTC DemystifiedWebRTC Demystified
WebRTC Demystified
Ā 
WebRTC: User Security & Privacy
WebRTC: User Security & PrivacyWebRTC: User Security & Privacy
WebRTC: User Security & Privacy
Ā 
Firefox Architecture Overview
Firefox Architecture OverviewFirefox Architecture Overview
Firefox Architecture Overview
Ā 
Ļ€P
Ļ€PĻ€P
Ļ€P
Ā 
Next Generation Browser Add-Ons
Next Generation Browser Add-OnsNext Generation Browser Add-Ons
Next Generation Browser Add-Ons
Ā 
A Brief Incursion into Botnet Detection
A Brief Incursion into Botnet DetectionA Brief Incursion into Botnet Detection
A Brief Incursion into Botnet Detection
Ā 
Mozilla Weave: Integrating Services into the Browser
Mozilla Weave: Integrating Services into the BrowserMozilla Weave: Integrating Services into the Browser
Mozilla Weave: Integrating Services into the Browser
Ā 
about:labs
about:labsabout:labs
about:labs
Ā 
Distributed File Systems: An Overview
Distributed File Systems: An OverviewDistributed File Systems: An Overview
Distributed File Systems: An Overview
Ā 
Innovating with Mozilla Labs
Innovating with Mozilla LabsInnovating with Mozilla Labs
Innovating with Mozilla Labs
Ā 
Glendix: The Why and the How
Glendix: The Why and the HowGlendix: The Why and the How
Glendix: The Why and the How
Ā 
Mozilla Prism
Mozilla PrismMozilla Prism
Mozilla Prism
Ā 
Making Gentoo Tick
Making Gentoo TickMaking Gentoo Tick
Making Gentoo Tick
Ā 

Recently uploaded

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
Ā 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
Ā 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
Ā 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
Ā 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vƔzquez
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
Ā 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
Ā 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
Ā 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Ā 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Ā 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Ā 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Ā 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Ā 

An Overview of Distributed Debugging

  • 1. An Overview of Distributed Debugging Anant Narayanan Advanced Topics in Distributed Systems November 17, 2009
  • 2. The Problem Introduction Oļ¬„ine Anything that can go wrong will go wrong liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion Debugging is frustrating. Distributed debugging even more so! Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 2 of 21
  • 3. Why is this hard? Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Errors are rarely reproducible Non-determinism plays a big role in distributed systems Remote machines appear to crash more often! Conclusion Interactions between several diļ¬€erent components (possibly written in diļ¬€erent languages) running on diļ¬€erent computers are extremely intricate Communication is unreliable and asynchronous Existing debuggers are simply inadequate Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 3 of 21
  • 5. Outline Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC 1 After Logging (liblog) Pervasive debuggers Time travel (TTVM) Online D3 S CrystalBall Conclusion 2 Before 3 During Model checking (MaceMC) D3 S CrystalBall Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 5 of 21
  • 6. Logging Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion Example printf("The value of x at node %d: %d", nr, x); The most primitive form of debugging, we all do it! However, extremely diļ¬ƒcult to capture all state, and thus can be used only for small bugs Wonā€™t it be a good idea to automatically capture and store all state information so we can analyze and possibly replay it at a later time? Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 6 of 21
  • 7. Yes, it would! Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion application application other libs other libs liblog libc logger libc liblog libc GNU/Linux x86 Hardware Figure 1: Logging: liblog intercepts calls to libc and sends results to logger process. The latter asynchronously compresses and writes the logs to local storage. 2.2 Message Tagging and The second deļ¬ning aspect of our proach to replaying network com contents of all incoming message process can be replayed independ This ļ¬‚exibility comes at the space (cf. Section 5) but is w projects have tried the alternative, and regenerating message conte cannot do so because we operate i with non-logging processes. Eve tion logs may be unavailable for ing disk or network failure. Intercepts all calls to libc using LD PRELOAD So far we satisfy one requireme to coordinate these individual re vide another, Consistent Group R 2.1 Shared logging with deterministic and Lamport clocks Provides continuous Library Implementation we embed 8-byte ing messages during execution an The core of our debugging tool is a shared library (the consistent groupliblog), which intercepts calls to libc (e.g., clocks to schedule replay. The c eponym replay in a mixed environment select, gettimeofday) and logs their results. Our ensures that the timestamps in eac start-up scripts use provide central replay in a familiar Integrates with gdb to the LD PRELOAD linker variable to ā€œhappens-beforeā€ relationship. Th venient way to correlate messag interpose liblog between libc and the application environment and its other libraries (see Figure 1). liblog runs on ception events, so we can trace co Linux/x86 computers and supports POSIX C/C++ applications. Nov. 17, ATDS, Vrije Universiteit ā€”chose to build Distributed Debugging We Anant a library-based tool because op- chine to machine. To make the virtual clocks mor 7 of 21
  • 8. Challenges Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion Signals and Threads User-level cooperative scheduler on top of OS scheduler Unsafe Memory Access All malloc calls are eļ¬€ectively calloc Consistent Replay for UDP/TCP Packets are annotated Finding Peers in a Mixed Environment Local ports are tracked Initialization with other liblog hosts occurs Is liblog for you? High disk usage; heterogenous systems and tight spin-locks disallowed; 16 byte per-message network overhead; and ļ¬nally, limited consistency Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 8 of 21
  • 9. A Pervasive Debugger Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online Debuggers are unable to access all the state that we sometimes need because it is just another program! Debugging is usually either vertical or horizontal: D3 S CrystalBall Conclusion Java client Java client Java Virtual Machine Linux operating system C web server FreeBSD operating system virtual machine monitor (a) Java Virtual Machine Linux operating system C web server FreeBSD operating system virtual machine monitor (b) Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging Figure 1: (a) Horizontal debugging with multiple Although and cont point in the targe issued ex debug ta 2.2 E The st of its me of each e debug ta software each targ threads, Auxilia 9 of 21 cannot d
  • 10. A Pervasive Debugger Introduction Oļ¬„ine process liblog Pervasiveness TTVM MaceMC virtual machine Online threads process operating system D3 S CrystalBall process operating system Conclusion pervasive debugger Nov. 3.1 Ext Each deb its environm memory ad ters) of the amine the include the example, a ļ¬le that ha 3.1.1 Ob Since the target, the Figure 2: The pervasive debugger enables both horenvironmen izontal and vertical debugging. scheme sim Why are debuggers peers of the application being vironment. identify a ļ¬ debugged rather thanthread. Pervasive debugging extends nipulate a process or being placed in the underlying length to id this to include the underlying software and hardware layers; system? connections all interactions between the process and its environment can the This be examined. Weallows us to perform both vertical and name a architecture term this vertical debugging. If we con The environment in which an operating system executes then we can horizontal debugging just memory and processor state. encompasses more than records in t The operating system can access all of the various hardware be 10 of 21 read, th 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging devices attached to the machine. Therefore, in the context
  • 11. Letā€™s Look at an Application Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion A Virtual Machine Monitor (VMM) is capable of monitoring and logging a lot more state than is possible by a userspace library! By running an application inside a VM, we are able to log not just CPU instructions, memory, network and disk I/O, but also interrupts, clock values, signals We can also log byte-for-byte network, memory and disk Remember, device drivers can have bugs too! Time-traveling virtual machines take advantage of all this by using User Mode Linux (UML) and integrating with gdb to provide a uniļ¬ed, easy to use debugging environment Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 11 of 21
  • 12. How This Works Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC gdb guest-user host process guest-kernel host process TTVM functionality (checkpointing, logging, replay) Online D3 S CrystalBall host operating system Conclusion Figure 1: System structure: UML runs as two user pro- card is emu driver; the mmap and m vice interru GIO signals output. The uses these h ware. In additionon the host Linux OS,mentioned state parameters, cesses to all the earlier the guest-kernel host proUsing a cess and the guest-user checkpoints at regular intervals the is the system takes systemhost process. TTVMā€™s ability to raises travel forward and back in time is implemented to to The host operating system, UML and gdb by modare modiļ¬ed an OS t ifying the host OS. We extend gdb to make use of this that one ca allowtime traveling functionality. gdb communicates with the ging the gu time-travel back to earlier checkpoints, replaying execution with host process via a remote serial protocol. guest-kernel breakpoints VMM: as th Performance Checkpointing everyVMM adds just 4%and well-deļ¬ned inFinally, a 25s offers a narrow overhead! terface: the interface of a physical machine. This inter- Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging the hardwa para-virtual and it becom be debugge may also m 12 of 21
  • 13. Model Checking Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion Weā€™ve seen what tools we can use after a bug has been found, is there anything we can do before deploying an application? Model checkers, which basically perform state space exploration, can be used to gain conļ¬dence in a system MaceMC is one such model checker, tailored for verifying large distributed applications Deļ¬nition Safety Property A property that should always be satisļ¬ed Liveness Property A property that should always be eventually satisļ¬ed Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 13 of 21
  • 14. Life, Death and the Critical Transition Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion Each node is a state machine At each step in the execution, an event handler for a particular pending event at a node is called Thus, the entire system is to be represented as a giant state machine with speciļ¬c event handlers deļ¬ned Of course, liveness and safety properties are required by MaceMC to start the checks Deļ¬nition Critical transition A transition from a live state to a dead state, from which a liveness property can never be satisļ¬ed Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 14 of 21
  • 15. 3 step process Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC 1 2 3 Bounded depth-ļ¬rst search Random walks Isolating critical transitions operty would have to capture the following: ā€œAlOnline eachSmessage in the inļ¬‚ight queue or retransD3 mer queue, either the message is in ļ¬‚ight (in the CrystalBall or in the destinationā€™s receive socket buffer, or Conclusion verā€™s corresponding IncomingConnection.next han the message sequence number, or an acgment is in ļ¬‚ight from the destination to the ith a sequence number greater than or equal to age sequence number, or the same acknowledgn the senderā€™s receive socket buffer, or a rege is in ļ¬‚ight between the sender and receiver direction), or . . .ā€ Thus, attempting to spec- Figure 1: State Exploration We perform bounded depth-ļ¬rst n conditions with safety properties quickly be- search (BDFS) from the initial state (or search preļ¬x): most peerwhelming and hopelessly complicated, espe- riphery states are indeterminate, i.e., not live, and thus are either en contrasted with the simplicity and succinct- dead or transient. We execute random walks from the periphery he liveness property: ā€œEventually, for all n in states and ļ¬‚ag walks not reaching live states as suspected violatinļ¬‚ightSize() = 0,ā€ i.e., that eventually there ing executions. no packets in ļ¬‚ight. we recommend the following iterative process for ubtle protocol errors in complex concurrent envi- tialization typically takes many more transitions (cf. Fig. A developer begins by writing desirable high- ure 2), the vast majority of states reached at the periphery ness properties. As these liveness properties typ- of the exhaustive search are not live. We call these states Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging Is MaceMC for you? Requires a concrete and theoretical model of your system. Existing code must be understood and represented as a state machine and properties! Too much work? 15 of 21
  • 16. Debugging Deployed Solutions Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion Because real debuggers run on a live, deployed system! Instead of verifying liveness properties in advance, why not let the system itself do a state space search for you? D3 S does exactly that by letting the developer specify predicates that are automatically veriļ¬ed by the system on-the-ļ¬‚y. Key Challenge Allowing developers to express predicates easily, verify those predicates in a distributed manner with minimal overhead, and without disrupting the system! Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 16 of 21
  • 17. D3 S Architecture Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion
  • 18.
  • 19. ! ! ! !
  • 20. Figure 1: Overview of D3 S.
  • 21.
  • 22.
  • 23. % '
  • 24. ()
  • 25. *(
  • 26.
  • 27. + ' ,) ( ' . '- 0 ' ,'-1 !! # # 2, 3 ' ,'-14 # ( / 1 33 *5
  • 28. 67 * ( ' . 81 9::/ '- 81 9::/ ) * 3 ( ' . 1; 4 / 0 !. !. 33 + ,1 2, ! =
  • 29.
  • 31. 2, +
  • 32. 1 / / Simple C++Exclusive holder and no Shared holders, or there and state API for specifying predicates is no Exclusive holders. Because clients cache locks Veriļ¬er and State reduce trafļ¬c between the clients and the lock on diļ¬€erent locally (to exposer processes can be server), only the clients know the current state of a lock. machines, allowing shows partitioned execution Figure 2 for the code that the developer writes to monitor and check the properties of Boxwoodā€™s disSafety property violations are immediately logged, liveness tributed lock service. The developer organizes the predicate how the properties after checking in severalanstages and expressesdeveloper stages a timeout acyclic graph; the are connected in describes this graph with the script part of the code. In Nov. 17, ATDS, Vrije Universiteit example there are Distributed Debugging a single the ā€” Anant only two stages that form
  • 34. Steering Deployed Solutions Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion So, D3 S can detect property violations but can we do anything about it? CrystalBall attempts to give us an ultimate solution by gazing at the future and steering the application away from disaster! Many distributed application block on network I/O, letā€™s use those free CPU cycles for some useful work... Packet transmission is faster in simulation than in reality Can we stay one-state-step ahead at all times? Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 18 of 21
  • 35. CrystalBall Architecture Introduction Oļ¬„ine ;:,%#)*0,%2,$ $+0$3*%$ /3,/40*2+%$ !#$%'('') !*+%*'', !*+$,-.,+/,) 0,12/%2*+ 52*'%2*+$ '*/')/3,/40*2+% 6,%7*4 liblog n low-probability events, Pervasiveness timately triggered the inTTVM MaceMC can take a very long time Online ncounter such a scenario, D3 S ssible bugs difļ¬cult. Our CrystalBall ves system debugging by Conclusion e that combines some of nd static analysis. +,2839*)2+:* ,5,+%):2'%, =.+%2, ,$$8,$A) ;,52/, ?$%%,) ,$$8,$) %2,$ consistencies before they /32+,@ ssible because the model !#$%'('')+*1, ket transmission in time tency, and because it can me shorter than than the Figure 4: High-level overview of CrystalBall aspect of our approach sibility: adapt the behavDeep join request of n and:toPropertyTCP connection with online debugging break the violations recorded 13 n the ļ¬‚y and avoid an init. Node n13 eventually succeeds joining conditions Execution Steering : Avoids erroneousthe random treereported echnique execution steer(perhaps after some other nodes have joined ļ¬rst). The ly on a history of past instale information aboutDistributedn9 is removed once n9 n13 in Debugging Nov. 17, ATDS, Vrije Universiteit ā€” Anant 19 of 21
  • 36. Challenges Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion Specifying state and properties: Uses MaceMC Consistent snapshots: Only neighbors are involved Consequence prediction: Reļ¬ned state-space search Steering without disruption: Filters rely on the distributed system handling ā€œdroppedā€ messages How did it do? Bugs found in RandTree, Chord, and Bulletā€™ while in deep online debugging mode As for execution steering, Bulletā€™ ran for 1.4 hours with 121 inconsistent states that were never reached, no false negatives. When run on Paxos, inconsistencies at runtime were avoided between 74 and 89% of the time Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 20 of 21
  • 37. Your Takeaways Introduction Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Tools liblog and TTVM at your disposal for debugging using the familiar gdb environment after a crash occurs MaceMC model checking gives you theoretical conļ¬dence in your system before you deploy it Conclusion Systems D3 S detects and logs the reason for property violations based on your speciļ¬cations CrystalBall can take this one step further and prevent your distributed system from executing towards bad states Recommendation Use a combination of these tools and systems to make all your debugging problems go away! Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 21 of 21
  • 38. Performance: liblog Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall 70000 120 60000 50000 Receive Rate (MB/s) Sending Rate (Packets/second) Introduction 40000 30000 20000 10000 0 32 Conclusion 64 128 256 512 1024 Packet Size (bytes) No liblog Liblog 512 1024 LAN 600 500 6050 40 40 30 2020 0 Gigabit ļ¬le. Each pair of bars represents a diffe 8060 010 20 Figure 6: TCP throughput for wget Time (usecs) Receive Rate (MB/s) 256 40 No liblog 120 various datagram sizes. The maximum standard deviation over all points is 1.3 percent of the mean. 100 Sending Rate (MB/s) 128 60 Liblog Figure 4: Packet rate reduction: Maximum UDP send rate for 64 80 0 Packet Size (bytes) No liblog 100 400 300 200 100 Gigabit 1 Nov. 17, ATDS, Vrije Universiteit ā€” Anant LAN 2 US 3 No liblog 4 Liblog 5 Packet Size (bytes) Distributed Debugging Australia 6 0 1000 Bbps 22No liblog of 21
  • 39. Performance: TTVM Oļ¬„ine liblog Pervasiveness TTVM MaceMC Online D3 S CrystalBall Conclusion 200 kernel build SPECweb PostMark 6 4 2 0 0 200 600 800 400 Checkpoint interval (sec) Time to restore (sec) 1000 15 15 10 5 0 0 200 4 Distance Figure 6: Time to 6 Experience and 10 ten after a checkpoint. More frequent checkpoints thus cause the disk block allocation to resemble a pure logging disk, which improved the spatial locality for writes 5 for PostMark. 0 Because checkpointing adds 600 time overhead, it little 0 200 800 400 1000 is reasonable to Distance to restore point (sec) runs while perform long debugging checkpointing relatively often (say, every 25 seconds). ce overhead of checkpoints. For long Nov. 17, ATDS, Vrije ers will cap the maximum space used by Universiteit ā€” Anant kernel build SPECweb PostMark 20 1000 25 Figure 5: Space overhead of checkpoints. For long kernel build runs, programmers will cap the maximum space used by SPECweb PostMark 20 checkpoints by deleting selected checkpoints. kernel build SPECweb PostMark 600 800 400 Checkpoint interval (sec) 25 8 Time to restore (sec) Checkpoint space overhead (MB/sec) Introduction Distributed Debugging In this section, we descr to track down four kern verse gdb commands si rience provides anecdot reverse debugging is a u does not constitute an u ing the beneļ¬ts of rever 23 of 21
  • 40. Performance: D3 S Introduction Oļ¬„ine 8.00 7.00 slowdown (%) liblog Pervasiveness TTVM MaceMC D3 S CrystalBall 26 31 4.00 2 threads 3.00 4 threads 2.00 8 threads 16 threads 0.00 50 36 41 46 51 100 56 Peer index ons of peers (free riders are 46āˆ¼56). 200 600 1000 avg frequency (a) Slowdown with average packet size 390 bytes and different exposing frequencies. 8.00 7.00 n whether or not we have useful When a system already has specs (e.g., at the component level), omplex, well designed systems, e the predicates can check the inedicates is mostly an easy task for ey are allowed to use sequential pshots. When a system doesnā€™t on (e.g., in performance debug- slowdown (%) Conclusion 1 thread 5.00 1.00 Online 21 6.00 6.00 5.00 1 thread 4.00 2 threads 3.00 4 threads 2.00 8 threads 1.00 16 threads 0.00 8 64 128 512 1024 avg packet size (bytes) (b) Slowdown with average frequency 347 /s and different exposing packet sizes. Nov. 17, ATDS, Vrije Universiteit ā€” Anant Distributed Debugging 24 of 21
  • 41. Performance: CrystalBall Increased Memory Size (kB) Size (kB) Increased Memory 2500 Consequence Search on RandTree 2000 2500 Consequence Search on RandTree 1500 2000 1000 1500 500 1000 0 500 0 2 4 6 8 Depth (levels) 10 12 0 Figure 10:0The memory consumed 6 consequence10 by prediction 2 4 8 12 (RandTree, depths 7 to 8) ļ¬ts Depth L2 CPU cache. in an (levels) 1 Figure 10: The memory consumed (baseline) BulletPrime by consequence prediction BulletPrime (CrystalBall) (RandTree, depths 7 to 8) ļ¬ts in an L2 CPU cache. 0.8 Fraction of nodes of nodes Fraction tween rounds uniformly at random be0 seconds. As we can see in Figure 9, xecution steering is successful in avoidIntroduction ween at runtime 74% at 89% of the stency rounds uniformlyand random beOļ¬„ine seconds. As we can In these cases, and bug2, respectively.see in Figure 9, liblog ecution steering is successful in avoidts Pervasiveness model checking after node C recontency at runtime 74% and participants. ves checkpoints from other 89% of the TTVM ndmodel respectively. In these cases, bug2, he MaceMCchecker for 3.3 seconds, C sucs Onlinethe scenarioafter node C reconts model checking in the second round that 3S esDcheckpoints from other participants. violation of the safety property, and it CrystalBall eevent ļ¬lter. The for 3.3 seconds, C sucmodel checker avoidance by execution s that the scenario in Propose message nsConclusionrejects the the second round when C violation of the more property, and it cution steering is safetyeffective for bug2 event former involves resetting B. This as the ļ¬lter. The avoidance by execution s when C rejects the Propose to redismore time for the model checkermessage ution steering is more effective for or ii) em by: i) consequence prediction, bug2 s the former involves resetting B. This iously identiļ¬ed erroneous scenario. Imore time for the model checker the time, check engages 25% and 7% of to redism by:when model checking did not have cases i) consequence prediction, or ii) ously identiļ¬ed erroneous scenario. Imuncover the inconsistency), and prevents heck engages 25% and by of the time, cy from occurring later, 7% dropping the cases C at node B.checking did could not from when model CrystalBall not have uncover the inconsistency), and prevents ation for only 1% and 4% of the runs, reycause for these false negatives was the from occurring later, by dropping the rom C set node B. CrystalBall could not of the at of checkpoints. tion for only 1% and 4% of the runs, remance Impact of CrystalBall the cause for these false negatives was of and set of checkpoints. , the bandwidth consumption. Be- 1 BulletPrime (baseline) BulletPrime (CrystalBall) 0.6 0.8 0.4 0.6 0.2 0.4 0 0.2 0 Nov. 17, ATDS, Vrije Universiteit ā€” Anant 50 100 150 200 250 download time(s) Distributed Debugging 25 of 21