SlideShare a Scribd company logo
Copyright Undo Ltd, 2014 
Introduction to UndoDB 
Greg Law 
Co-founder and CEO, Undo Ltd
Copyright Undo Ltd, 2014 
Undo Overview 
•Founded in 2005, with 25 man years development in debug technology Founder : Greg Law, Ph.D , Acorn, Solarflare, Nexwave,etc Founder: Julian Smith, Ph.D, Acorn, E-14, Broadcom, etc 
•Well funded with $1.25 million raised in round 3. 
−Backed financially by Cambridge Angels and Jaan Tallinn, co-founder Skype 
−Currently 11 full time staff 
•Market Momentum 
−Revenue and headcount doubled in 2012 and 2013. 
−OEMs with ARM (DS5 v5.16) and Rogue Wave (Totalview) 
−Selected as Gartner Cool Vendor in Application Development for 2014. 
−Customers include : NASA, Lawrence Livermore Labs, Cadence Design Systems, Mentor Graphics, Synopsys Inc.
Copyright Undo Ltd, 2014 
Debugging Involves Backwards Reasoning 
“Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” 
Kernighan & Pike's The Practice of Programming
Copyright Undo Ltd, 2014 
Debugging Involves Backwards Reasoning 
“Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” Kernighan & Pike's The Practice of Programming
Copyright Undo Ltd, 2014 
Debugging Involves Backwards Reasoning 
“Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” 
Kernighan & Pike's The Practice of Programming 
•Regular debuggers give you pause/continue
Copyright Undo Ltd, 2014 
Debugging Involves Backwards Reasoning 
“Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” 
Kernighan & Pike's The Practice of Programming 
•Regular debuggers give you pause/continue 
•UndoDB gives you a rewind button, etc 
•CCTV for your code
Copyright Undo Ltd, 2014 
Reversible Debugging for Real Code 
A holy-grail of tools research for decades. 
UndoDB is the first and only reversible debugger that is effective on real-world, complex software 
•Used on many of the world’s most complex software projects Scientific supercomputing clusters (NASA Ames, LLNL, etc) EDA, Enterprise (several fortune 500 customers) 
High performance, scalable, for compiled code on Linux 
"I found the idea of the product amazing and a boon to my productivity... I have already been able to fix a deadlock that was driving me crazy for a week in only ten minutes!”
Copyright Undo Ltd, 2014 
Performance is key 
Patented checkpoint + replay approach 
•Exploit the natural determinism of computers 
•Reduces time/space overheads by many orders of magnitude 
•Highly optimised JIT binary translation 
Benchmark 
•Time to ‘gzip’ a 16MB* file (gzip is mostly CPU bound, with some IO) * GDB times extrapolated from 16K file 
Native 
UndoDB 
GDB “process record” 
Time 
1.49s 
2.61s (1.75x) 
21 hours (>50,000x) 
Space 
N/A 
17.8MB 
63GB
Copyright Undo Ltd, 2014 
The Event Log 
All non-deterministic events (syscalls, signals, thread switches) stored in the Event Log 
−In record mode: operations executed as normal, and results stored in event log 
−In replay mode: operations not executed, but results synthesized from the contents of the event log 
Replay is therefore completely deterministic 
No interaction with outside world in replay mode
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs
Copyright Undo Ltd, 2014 
undodb-gdb: error: UndoDB's event log is full, so no more history can be recorded. 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full:
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full: 
Go back in time 
reverse-next
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full: 
Go back in time 
reverse-next
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full: 
Go back in time, or 
Increase its size 
undodb-set-max-event-log-size 768M
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full: 
Go back in time, or 
Increase its size, or 
Select circular mode 
undodb-set-event-log-mode circular
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full: 
Go back in time, or 
Increase its size, or 
Select circular mode 
undodb-set-event-log-mode circular; continue
Copyright Undo Ltd, 2014 
The event log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full: 
Go back in time, or 
Increase its size, or 
Select circular mode 
undodb-gdb: error: UndoDB's event log is full...
Copyright Undo Ltd, 2014 
The Event Log 
Event log is a fixed size in memory 
Fills up as your program runs 
When it’s full: 
Go back in time, or 
Increase its size, or 
Select circular mode
Copyright Undo Ltd, 2014 
Snapshots
Copyright Undo Ltd, 2014 
Snapshots
Copyright Undo Ltd, 2014 
Snapshots
Copyright Undo Ltd, 2014 
Snapshots
Copyright Undo Ltd, 2014 
Threads
Copyright Undo Ltd, 2014 
Threads
Copyright Undo Ltd, 2014 
Threads 
Scheduling is serialized, but preemptive 
−Many race conditions can be reproduced 
•But not all – e.g. missing or incorrect memory barrier 
−Bigger impact on performance 
Record: OS scheduler selects which thread runs next 
Replay: UndoDB forces scheduling to mirror record
Copyright Undo Ltd, 2014 
UndoDB Save/Load 
Collaborate 
Save a recording and send it to a colleague. 
Load the recording onto another machine 
Defer and prioritise 
Capture now, debug later  Save a recording for analysis later. 
Capture sporadic/intermittent bugs and save them for later. 
Protect against losing your data 
Resilient to power or system failures -- never reproduce a bug a second time.
Copyright Undo Ltd, 2014 
Record In-The-Field Failures 
Undo Flight Recorder is a new product to record failures at the customer site 
A library you link into your code and ship to your customers 
By default, library is dormant. C API allows your program to enable recording
Copyright Undo Ltd, 2014 
Flight Recorder 
Your Executable 
Ship to customer
Copyright Undo Ltd, 2014 
Flight Recorder 
Your Executable 
Ship to customer
Copyright Undo Ltd, 2014 
Flight Recorder 
Your Executable 
undofr.so 
Ship to customer
Copyright Undo Ltd, 2014 
Flight Recorder 
Your 
Executable 
undofr.so 
Ship to customer 
Back to you – load into UndoDB recording
Copyright Undo Ltd, 2014 
Good Kinds of Bug for UndoDB 
1.Long run times 
2.Frequently-called functions 
3.Intermittent bugs 
4.Stack corruption 
5.Memory leaks 
6.Real-time network protocols 
7.Race conditions 
8.Data structure corruption 
9.Dynamic code
Copyright Undo Ltd, 2014 
Good Kinds of Bug for UndoDB 
1.Long run times 
2.Frequently-called functions 
3.Intermittent bugs 
4.Stack corruption 
5.Memory leaks 
6.Real-time network protocols 
7.Race conditions 
8.Data structure corruption 
9.Dynamic code
Copyright Undo Ltd, 2014 
Good Kinds of Bug for UndoDB 
1.Long run times 
2.Frequently-called functions 
3.Intermittent bugs 
4.Stack corruption 
5.Memory leaks 
6.Real-time network protocols 
7.Race conditions 
8.Data structure corruption 
9.Dynamic code 
Demo #1 
(square roots)
Copyright Undo Ltd, 2014 
Good Bugs for UndoDB 
1.Long run times 
2.Frequently-called functions 
3.Intermittent bugs 
4.Stack corruption 
5.Memory leaks 
6.Real-time network protocols 
7.Race conditions 
8.Data structure corruption 
9.Dynamic code 
Demo #2 
(stack smash)
Copyright Undo Ltd, 2014 
Features and benefits 
Works on unmodified Linux x86 and ARM systems and programs 
•No kernel patches or modules, or special hardware requirements 
•No recompilation or special libraries for program being debugged 
•No restrictions on application to debug: threads, signals, shared memory, etc 
Greatest value is on the bugs where: 
•Effects manifest themselves a long time after underlying bug 
•Non-deterministic “once in a blue moon” failures 
•Large, unfamiliar codebases (“how did that happen?”) 
Full-featured debugger 
•Attach, watchpoints, etc. 
•Fits seamlessly into your existing workflow (gdb / Eclipse / Emacs, etc)
Copyright Undo Ltd, 2014 
Competition Time 
Get the code at: http://undo-software.com/bugmug 
Can you find the bug? 
#bugmug @undosoft 
support@undo-software.com
Copyright Undo Ltd, 2014 
Support 
Questions or problems: support@undo-software.com 
If you suspect a bug in UndoDB: 
−Run with --undodb-asserts-1 on the command line, or set UNDODB_debug_level_internal=2 env var to enable internal logging/extra checking 
−On UndoDB crash, files a la undodb_log.1234 will be created; send these as attachments to Undo 
−Alternatively, use maint-undodb-dump-internal-log command to dump the logs immediately
Copyright Undo Ltd, 2014 
Part II UndoDB master class 
Tips and tricks for better debugging
Copyright Undo Ltd, 2014 
Timeline 
“What time is it?”, or “Goto” a particular time: 
undodb-get-n 
undodb-goto-n 
undodb-show-event-log-extent 
Precise control of timeline: 
undodb-set-bookmark and 
undodb-goto-bookmark 
Tip: Use these commands to binary chop
Copyright Undo Ltd, 2014 
Record Mode and Replay Mode 
When you first run, you’re in Record Mode 
If you step forwards, you stay in Record Mode 
Issue a reverse operation puts you in Replay Mode
Copyright Undo Ltd, 2014 
Record/replay continued 
Replaying forwards to the end of the event log takes you back into record mode (debugger will stop) 
Use undodb-goto-record-mode to jump straight to record mode 
−As with undodb-goto-n, will not hit breakpoints 
State (registers, memory) can be modified in record mode, but not in replay mode 
User issued function-calls (e.g. ‘call’ command from gdb prompt) can be issued from replay mode or record mode (see below)
Copyright Undo Ltd, 2014 
The Event Log 
All “non-deterministic” inputs are recorded 
−System-calls 
−Thread-switches 
−Signals 
−Non-deterministic instructions 
−Shared memory reads (incl. DMA) 
List events 
maint-undodb-show-events b,e 
maint-undodb-show-eventstats b,e
Copyright Undo Ltd, 2014 
More on the Event Log 
Increase the event-log size dynamically 
undodb-set-max-event-log-size 
Stop when the event log gets full (default) 
undodb-event-log-mode straight 
Record forever with a circular event log 
undodb-event-log-mode circular
Copyright Undo Ltd, 2014 
Performance tuning 
Start recording later: 
−Start with --undodb-defer-recording option 
−Then when you’re ready: undodb-enable-record 
−Note: you cannot go back to record recording was enabled 
Overview of performance metrics 
−maint-undodb-show-exec-summary 
−Make sure your instrumentation heap is big enough: 
--undodb-instr-heapsize 512M 
−Look out for executing code in writable memory 
approx 2x slower than executing for read-only memory
Copyright Undo Ltd, 2014 
Snapshots 
List existing snapshots 
maint-undodb-show-snapshots 
Beware memory consumption 
e.g. --undodb-snapshots 5 
Note that reverse opterations may be slower 
Hint to create a snapshot soon 
maint-undodb-snapshot 
(will create a snapshot at next basic-block boundary)
Copyright Undo Ltd, 2014 
More tips and tricks 
No symbols/no backtrace? 
reverse-stepi or reverse-finish 
undodb-goto-n -1000 
Set default command-line options 
~/.undodb-gdb.defaults 
Calling functions in debuggee/inferior 
−Side-effects are discarded after function is run 
Function is run in a temporary process 
−Use our `infcall’ gdb patch to make this bullet-proof 
e.g. break foo.c:42 if !memcmp( a, b, 32)
Copyright Undo Ltd, 2014 
More tips and tricks 
Autotrace feature 
Attach to an executable by name rather than pid 
--undodb-autotrace /path/to/myexe cmd 
cmd is the command as executed; if it or a child process exec’s /path/to/myexec then undodb will attach to that 
The path must be complete path or a glob 
Work differently 
−Don’t try to anticipate where to put breakpoints; run until the bug happens, then “think backwards”

More Related Content

What's hot

Run Go applications on Pico using TinyGo
Run Go applications on Pico using TinyGo Run Go applications on Pico using TinyGo
Run Go applications on Pico using TinyGo
Yu-Shuan Hsieh
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
GenchiLu1
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
Linaro
 
Functional MCU programming
Functional MCU programmingFunctional MCU programming
Functional MCU programming
Kiwamu Okabe
 
Performance Enhancement Tips
Performance Enhancement TipsPerformance Enhancement Tips
Performance Enhancement Tips
Tim (文昌)
 
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Pôle Systematic Paris-Region
 
Gnu debugger
Gnu debuggerGnu debugger
Gnu debugger
Gizem Çetin
 
Lowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost PortablyLowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost Portably
ESUG
 
My talk on Piter Py 2016
My talk on Piter Py 2016My talk on Piter Py 2016
My talk on Piter Py 2016
Alex Chistyakov
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014
Jian-Hong Pan
 
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
NodejsFoundation
 
Harry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of BerkeleyHarry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of Berkeley
Alex Chistyakov
 
My talk at LVEE 2016
My talk at LVEE 2016My talk at LVEE 2016
My talk at LVEE 2016
Alex Chistyakov
 
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupPLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
Jervin Real
 
An introduction to programming in Go
An introduction to programming in GoAn introduction to programming in Go
An introduction to programming in Go
David Robert Camargo de Campos
 
Python for IoT, A return of experience
Python for IoT, A return of experiencePython for IoT, A return of experience
Python for IoT, A return of experience
Alexandre Abadie
 
Groovy a Scripting Language for Java
Groovy a Scripting Language for JavaGroovy a Scripting Language for Java
Groovy a Scripting Language for Java
Charles Anderson
 
Python Django Basics
Python Django BasicsPython Django Basics
Python Django Basics
RahilMemon5
 
Code Dojo
Code DojoCode Dojo
Code Dojo
Kacper Gunia
 
Debugging With GNU Debugger GDB
Debugging With GNU Debugger GDBDebugging With GNU Debugger GDB
Debugging With GNU Debugger GDB
kyaw thiha
 

What's hot (20)

Run Go applications on Pico using TinyGo
Run Go applications on Pico using TinyGo Run Go applications on Pico using TinyGo
Run Go applications on Pico using TinyGo
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 
Functional MCU programming
Functional MCU programmingFunctional MCU programming
Functional MCU programming
 
Performance Enhancement Tips
Performance Enhancement TipsPerformance Enhancement Tips
Performance Enhancement Tips
 
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
 
Gnu debugger
Gnu debuggerGnu debugger
Gnu debugger
 
Lowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost PortablyLowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost Portably
 
My talk on Piter Py 2016
My talk on Piter Py 2016My talk on Piter Py 2016
My talk on Piter Py 2016
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014
 
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
 
Harry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of BerkeleyHarry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of Berkeley
 
My talk at LVEE 2016
My talk at LVEE 2016My talk at LVEE 2016
My talk at LVEE 2016
 
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupPLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
 
An introduction to programming in Go
An introduction to programming in GoAn introduction to programming in Go
An introduction to programming in Go
 
Python for IoT, A return of experience
Python for IoT, A return of experiencePython for IoT, A return of experience
Python for IoT, A return of experience
 
Groovy a Scripting Language for Java
Groovy a Scripting Language for JavaGroovy a Scripting Language for Java
Groovy a Scripting Language for Java
 
Python Django Basics
Python Django BasicsPython Django Basics
Python Django Basics
 
Code Dojo
Code DojoCode Dojo
Code Dojo
 
Debugging With GNU Debugger GDB
Debugging With GNU Debugger GDBDebugging With GNU Debugger GDB
Debugging With GNU Debugger GDB
 

Similar to Undo tech overview_201410

Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligence
Carlos Toxtli
 
Fuzzing - Part 2
Fuzzing - Part 2Fuzzing - Part 2
Fuzzing - Part 2
UTD Computer Security Group
 
NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...
NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...
NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...
GetInData
 
Passing The Joel Test In The PHP World
Passing The Joel Test In The PHP WorldPassing The Joel Test In The PHP World
Passing The Joel Test In The PHP World
Lorna Mitchell
 
App Performance Tip: Sharing Flash Across Virtualized Workloads
App Performance Tip: Sharing Flash Across Virtualized WorkloadsApp Performance Tip: Sharing Flash Across Virtualized Workloads
App Performance Tip: Sharing Flash Across Virtualized Workloads
DataCore Software
 
eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...
eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...
eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...
eFolder
 
Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...
Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...
Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...
Emulex Corporation
 
Code, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers wayCode, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers way
Alex Baitov
 
Continuous Infrastructure First
Continuous Infrastructure FirstContinuous Infrastructure First
Continuous Infrastructure First
Kris Buytaert
 
12 tricks to avoid hackers breaks your CI / CD
12 tricks to avoid hackers breaks your  CI / CD12 tricks to avoid hackers breaks your  CI / CD
12 tricks to avoid hackers breaks your CI / CD
Daniel Garcia (a.k.a cr0hn)
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
Ahmed Abdou
 
Online gas booking project in java
Online gas booking project in javaOnline gas booking project in java
Online gas booking project in java
s4al_com
 
Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...
Phil Agcaoili
 
Google ART (Android RunTime)
Google ART (Android RunTime)Google ART (Android RunTime)
Google ART (Android RunTime)
Niraj Solanke
 
Cloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agentsCloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agents
Shai Almog
 
Public Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQLPublic Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQL
EDB
 
Debugging a .NET program after crash (Post-mortem debugging)
Debugging a .NET program after crash (Post-mortem debugging)Debugging a .NET program after crash (Post-mortem debugging)
Debugging a .NET program after crash (Post-mortem debugging)
Mirco Vanini
 
Production profiling what, why and how technical audience (3)
Production profiling  what, why and how   technical audience (3)Production profiling  what, why and how   technical audience (3)
Production profiling what, why and how technical audience (3)
RichardWarburton
 
DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.
Vlad Fedosov
 
DR Planning and Testing
DR Planning and TestingDR Planning and Testing
DR Planning and Testing
Jason Dea
 

Similar to Undo tech overview_201410 (20)

Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligence
 
Fuzzing - Part 2
Fuzzing - Part 2Fuzzing - Part 2
Fuzzing - Part 2
 
NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...
NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...
NLP for videos: Understanding customers' feelings in videos - Albert Lewandow...
 
Passing The Joel Test In The PHP World
Passing The Joel Test In The PHP WorldPassing The Joel Test In The PHP World
Passing The Joel Test In The PHP World
 
App Performance Tip: Sharing Flash Across Virtualized Workloads
App Performance Tip: Sharing Flash Across Virtualized WorkloadsApp Performance Tip: Sharing Flash Across Virtualized Workloads
App Performance Tip: Sharing Flash Across Virtualized Workloads
 
eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...
eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...
eFolder Partner Chat Webinar — Spring Cleaning: Getting Your Clients to Ditch...
 
Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...
Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...
Linked in Twitter Facebook Google+ Email Embed Share Flash Across Virtualized...
 
Code, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers wayCode, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers way
 
Continuous Infrastructure First
Continuous Infrastructure FirstContinuous Infrastructure First
Continuous Infrastructure First
 
12 tricks to avoid hackers breaks your CI / CD
12 tricks to avoid hackers breaks your  CI / CD12 tricks to avoid hackers breaks your  CI / CD
12 tricks to avoid hackers breaks your CI / CD
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
Online gas booking project in java
Online gas booking project in javaOnline gas booking project in java
Online gas booking project in java
 
Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...Good Security Starts with Software Assurance - Software Assurance Market Plac...
Good Security Starts with Software Assurance - Software Assurance Market Plac...
 
Google ART (Android RunTime)
Google ART (Android RunTime)Google ART (Android RunTime)
Google ART (Android RunTime)
 
Cloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agentsCloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agents
 
Public Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQLPublic Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQL
 
Debugging a .NET program after crash (Post-mortem debugging)
Debugging a .NET program after crash (Post-mortem debugging)Debugging a .NET program after crash (Post-mortem debugging)
Debugging a .NET program after crash (Post-mortem debugging)
 
Production profiling what, why and how technical audience (3)
Production profiling  what, why and how   technical audience (3)Production profiling  what, why and how   technical audience (3)
Production profiling what, why and how technical audience (3)
 
DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.
 
DR Planning and Testing
DR Planning and TestingDR Planning and Testing
DR Planning and Testing
 

Recently uploaded

All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 

Recently uploaded (20)

All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 

Undo tech overview_201410

  • 1. Copyright Undo Ltd, 2014 Introduction to UndoDB Greg Law Co-founder and CEO, Undo Ltd
  • 2. Copyright Undo Ltd, 2014 Undo Overview •Founded in 2005, with 25 man years development in debug technology Founder : Greg Law, Ph.D , Acorn, Solarflare, Nexwave,etc Founder: Julian Smith, Ph.D, Acorn, E-14, Broadcom, etc •Well funded with $1.25 million raised in round 3. −Backed financially by Cambridge Angels and Jaan Tallinn, co-founder Skype −Currently 11 full time staff •Market Momentum −Revenue and headcount doubled in 2012 and 2013. −OEMs with ARM (DS5 v5.16) and Rogue Wave (Totalview) −Selected as Gartner Cool Vendor in Application Development for 2014. −Customers include : NASA, Lawrence Livermore Labs, Cadence Design Systems, Mentor Graphics, Synopsys Inc.
  • 3. Copyright Undo Ltd, 2014 Debugging Involves Backwards Reasoning “Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” Kernighan & Pike's The Practice of Programming
  • 4. Copyright Undo Ltd, 2014 Debugging Involves Backwards Reasoning “Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” Kernighan & Pike's The Practice of Programming
  • 5. Copyright Undo Ltd, 2014 Debugging Involves Backwards Reasoning “Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” Kernighan & Pike's The Practice of Programming •Regular debuggers give you pause/continue
  • 6. Copyright Undo Ltd, 2014 Debugging Involves Backwards Reasoning “Reason back from the state of the crashed program to determine what could have caused this. Debugging involves backwards reasoning, like solving murder mysteries. Something impossible occurred, and the only solid information is that it really did occur. So we must think backwards from the result to discover the reasons.” Kernighan & Pike's The Practice of Programming •Regular debuggers give you pause/continue •UndoDB gives you a rewind button, etc •CCTV for your code
  • 7. Copyright Undo Ltd, 2014 Reversible Debugging for Real Code A holy-grail of tools research for decades. UndoDB is the first and only reversible debugger that is effective on real-world, complex software •Used on many of the world’s most complex software projects Scientific supercomputing clusters (NASA Ames, LLNL, etc) EDA, Enterprise (several fortune 500 customers) High performance, scalable, for compiled code on Linux "I found the idea of the product amazing and a boon to my productivity... I have already been able to fix a deadlock that was driving me crazy for a week in only ten minutes!”
  • 8. Copyright Undo Ltd, 2014 Performance is key Patented checkpoint + replay approach •Exploit the natural determinism of computers •Reduces time/space overheads by many orders of magnitude •Highly optimised JIT binary translation Benchmark •Time to ‘gzip’ a 16MB* file (gzip is mostly CPU bound, with some IO) * GDB times extrapolated from 16K file Native UndoDB GDB “process record” Time 1.49s 2.61s (1.75x) 21 hours (>50,000x) Space N/A 17.8MB 63GB
  • 9. Copyright Undo Ltd, 2014 The Event Log All non-deterministic events (syscalls, signals, thread switches) stored in the Event Log −In record mode: operations executed as normal, and results stored in event log −In replay mode: operations not executed, but results synthesized from the contents of the event log Replay is therefore completely deterministic No interaction with outside world in replay mode
  • 10. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs
  • 11. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs
  • 12. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs
  • 13. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs
  • 14. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs
  • 15. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs
  • 16. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs
  • 17. Copyright Undo Ltd, 2014 undodb-gdb: error: UndoDB's event log is full, so no more history can be recorded. The event log Event log is a fixed size in memory Fills up as your program runs When it’s full:
  • 18. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs When it’s full: Go back in time reverse-next
  • 19. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs When it’s full: Go back in time reverse-next
  • 20. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs When it’s full: Go back in time, or Increase its size undodb-set-max-event-log-size 768M
  • 21. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs When it’s full: Go back in time, or Increase its size, or Select circular mode undodb-set-event-log-mode circular
  • 22. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs When it’s full: Go back in time, or Increase its size, or Select circular mode undodb-set-event-log-mode circular; continue
  • 23. Copyright Undo Ltd, 2014 The event log Event log is a fixed size in memory Fills up as your program runs When it’s full: Go back in time, or Increase its size, or Select circular mode undodb-gdb: error: UndoDB's event log is full...
  • 24. Copyright Undo Ltd, 2014 The Event Log Event log is a fixed size in memory Fills up as your program runs When it’s full: Go back in time, or Increase its size, or Select circular mode
  • 25. Copyright Undo Ltd, 2014 Snapshots
  • 26. Copyright Undo Ltd, 2014 Snapshots
  • 27. Copyright Undo Ltd, 2014 Snapshots
  • 28. Copyright Undo Ltd, 2014 Snapshots
  • 29. Copyright Undo Ltd, 2014 Threads
  • 30. Copyright Undo Ltd, 2014 Threads
  • 31. Copyright Undo Ltd, 2014 Threads Scheduling is serialized, but preemptive −Many race conditions can be reproduced •But not all – e.g. missing or incorrect memory barrier −Bigger impact on performance Record: OS scheduler selects which thread runs next Replay: UndoDB forces scheduling to mirror record
  • 32. Copyright Undo Ltd, 2014 UndoDB Save/Load Collaborate Save a recording and send it to a colleague. Load the recording onto another machine Defer and prioritise Capture now, debug later  Save a recording for analysis later. Capture sporadic/intermittent bugs and save them for later. Protect against losing your data Resilient to power or system failures -- never reproduce a bug a second time.
  • 33. Copyright Undo Ltd, 2014 Record In-The-Field Failures Undo Flight Recorder is a new product to record failures at the customer site A library you link into your code and ship to your customers By default, library is dormant. C API allows your program to enable recording
  • 34. Copyright Undo Ltd, 2014 Flight Recorder Your Executable Ship to customer
  • 35. Copyright Undo Ltd, 2014 Flight Recorder Your Executable Ship to customer
  • 36. Copyright Undo Ltd, 2014 Flight Recorder Your Executable undofr.so Ship to customer
  • 37. Copyright Undo Ltd, 2014 Flight Recorder Your Executable undofr.so Ship to customer Back to you – load into UndoDB recording
  • 38. Copyright Undo Ltd, 2014 Good Kinds of Bug for UndoDB 1.Long run times 2.Frequently-called functions 3.Intermittent bugs 4.Stack corruption 5.Memory leaks 6.Real-time network protocols 7.Race conditions 8.Data structure corruption 9.Dynamic code
  • 39. Copyright Undo Ltd, 2014 Good Kinds of Bug for UndoDB 1.Long run times 2.Frequently-called functions 3.Intermittent bugs 4.Stack corruption 5.Memory leaks 6.Real-time network protocols 7.Race conditions 8.Data structure corruption 9.Dynamic code
  • 40. Copyright Undo Ltd, 2014 Good Kinds of Bug for UndoDB 1.Long run times 2.Frequently-called functions 3.Intermittent bugs 4.Stack corruption 5.Memory leaks 6.Real-time network protocols 7.Race conditions 8.Data structure corruption 9.Dynamic code Demo #1 (square roots)
  • 41. Copyright Undo Ltd, 2014 Good Bugs for UndoDB 1.Long run times 2.Frequently-called functions 3.Intermittent bugs 4.Stack corruption 5.Memory leaks 6.Real-time network protocols 7.Race conditions 8.Data structure corruption 9.Dynamic code Demo #2 (stack smash)
  • 42. Copyright Undo Ltd, 2014 Features and benefits Works on unmodified Linux x86 and ARM systems and programs •No kernel patches or modules, or special hardware requirements •No recompilation or special libraries for program being debugged •No restrictions on application to debug: threads, signals, shared memory, etc Greatest value is on the bugs where: •Effects manifest themselves a long time after underlying bug •Non-deterministic “once in a blue moon” failures •Large, unfamiliar codebases (“how did that happen?”) Full-featured debugger •Attach, watchpoints, etc. •Fits seamlessly into your existing workflow (gdb / Eclipse / Emacs, etc)
  • 43. Copyright Undo Ltd, 2014 Competition Time Get the code at: http://undo-software.com/bugmug Can you find the bug? #bugmug @undosoft support@undo-software.com
  • 44. Copyright Undo Ltd, 2014 Support Questions or problems: support@undo-software.com If you suspect a bug in UndoDB: −Run with --undodb-asserts-1 on the command line, or set UNDODB_debug_level_internal=2 env var to enable internal logging/extra checking −On UndoDB crash, files a la undodb_log.1234 will be created; send these as attachments to Undo −Alternatively, use maint-undodb-dump-internal-log command to dump the logs immediately
  • 45. Copyright Undo Ltd, 2014 Part II UndoDB master class Tips and tricks for better debugging
  • 46. Copyright Undo Ltd, 2014 Timeline “What time is it?”, or “Goto” a particular time: undodb-get-n undodb-goto-n undodb-show-event-log-extent Precise control of timeline: undodb-set-bookmark and undodb-goto-bookmark Tip: Use these commands to binary chop
  • 47. Copyright Undo Ltd, 2014 Record Mode and Replay Mode When you first run, you’re in Record Mode If you step forwards, you stay in Record Mode Issue a reverse operation puts you in Replay Mode
  • 48. Copyright Undo Ltd, 2014 Record/replay continued Replaying forwards to the end of the event log takes you back into record mode (debugger will stop) Use undodb-goto-record-mode to jump straight to record mode −As with undodb-goto-n, will not hit breakpoints State (registers, memory) can be modified in record mode, but not in replay mode User issued function-calls (e.g. ‘call’ command from gdb prompt) can be issued from replay mode or record mode (see below)
  • 49. Copyright Undo Ltd, 2014 The Event Log All “non-deterministic” inputs are recorded −System-calls −Thread-switches −Signals −Non-deterministic instructions −Shared memory reads (incl. DMA) List events maint-undodb-show-events b,e maint-undodb-show-eventstats b,e
  • 50. Copyright Undo Ltd, 2014 More on the Event Log Increase the event-log size dynamically undodb-set-max-event-log-size Stop when the event log gets full (default) undodb-event-log-mode straight Record forever with a circular event log undodb-event-log-mode circular
  • 51. Copyright Undo Ltd, 2014 Performance tuning Start recording later: −Start with --undodb-defer-recording option −Then when you’re ready: undodb-enable-record −Note: you cannot go back to record recording was enabled Overview of performance metrics −maint-undodb-show-exec-summary −Make sure your instrumentation heap is big enough: --undodb-instr-heapsize 512M −Look out for executing code in writable memory approx 2x slower than executing for read-only memory
  • 52. Copyright Undo Ltd, 2014 Snapshots List existing snapshots maint-undodb-show-snapshots Beware memory consumption e.g. --undodb-snapshots 5 Note that reverse opterations may be slower Hint to create a snapshot soon maint-undodb-snapshot (will create a snapshot at next basic-block boundary)
  • 53. Copyright Undo Ltd, 2014 More tips and tricks No symbols/no backtrace? reverse-stepi or reverse-finish undodb-goto-n -1000 Set default command-line options ~/.undodb-gdb.defaults Calling functions in debuggee/inferior −Side-effects are discarded after function is run Function is run in a temporary process −Use our `infcall’ gdb patch to make this bullet-proof e.g. break foo.c:42 if !memcmp( a, b, 32)
  • 54. Copyright Undo Ltd, 2014 More tips and tricks Autotrace feature Attach to an executable by name rather than pid --undodb-autotrace /path/to/myexe cmd cmd is the command as executed; if it or a child process exec’s /path/to/myexec then undodb will attach to that The path must be complete path or a glob Work differently −Don’t try to anticipate where to put breakpoints; run until the bug happens, then “think backwards”