16. @_jon_bell_ 5/23/13
Records all
external interaction
Recording External Inputs
Other
applications on
the Network
Files on the
user's disk
Inputs from the user
(e.g. keyboard)
Our
application
Recording System
17. @_jon_bell_ 5/23/13
Record and Replay:
Workflow
R+R System
Application
Instrumented for log
Instrumented for
replay
R+R system generates
test case
Bug successfully
reproduced in the lab
Used in the
field
Crashes
Crashes
18. @_jon_bell_ 5/23/13
Recording Inputs
• Previous work looks at logging system calls
• e.g. read, write, open
• Can lead to very high overhead inVM-
based languages, which perform many such
operations just to setup theVM!
20. @_jon_bell_ 5/23/13
Reading a File: Log
System Calls
public class ReadFile {
public static void main(String[] args) throws
FileNotFoundException {
String text = new Scanner(new
File("testFile")).useDelimiter("A").next();
}
}
684 System Calls
$ java ReadFile
21. @_jon_bell_ 5/23/13
Reading a File:API Logging
public class ReadFile {
public static void main(String[] args) throws
FileNotFoundException {
String text = new Scanner(new
File("testFile")).useDelimiter("A").next();
}
}
1 “External” API call
$ java ReadFile
22. @_jon_bell_ 5/23/13
Language VM (.NET CLR, JVM, etc)
Outside world (sources of
external input)
Normal APIApplication
Chronicler
Language API
External-input API
API Level Logging:The
Challenge
23. @_jon_bell_ 5/23/13
Language VM (.NET CLR, JVM, etc)
Outside world (sources of
external input)
Normal APIApplication
Chronicler
Language API
External-input API
API Level Logging:The
Challenge
Must determine reliably
25. @_jon_bell_ 5/23/13
External Inputs in Java
Outside world (sources of
external input)
Native Methods in API
Language VM (.NET CLR, JVM, etc)
Language API
26. @_jon_bell_ 5/23/13
External Inputs in Java
Outside world (sources of
external input)
Native Methods in API
Language VM (.NET CLR, JVM, etc)
Language API
API Calling Native Methods
30. @_jon_bell_ 5/23/13
Managing Log Explosion
Outside world
(external input)
Native methods in API receiving external input
Language VM (.NET CLR, JVM, etc)
Language API
API calling external input methods
Outside world
(not input-
providing)
31. @_jon_bell_ 5/23/13
Managing Log Explosion
• Stop list: approx 70 native methods that do
NOT gather external input
• Also includes StrictMath, some image
processing
• Not necessary to be complete in the
stop list
32. @_jon_bell_ 5/23/13
Managing Log Explosion
• Stop list: approx 70 native methods that do
NOT gather external input
• Also includes StrictMath, some image
processing
• Not necessary to be complete in the
stop list
• Result: decrease log sites by ~25%
33. @_jon_bell_ 5/23/13
Implementation
• Targets Java
• Bytecode transformation (no source!)
• Logs all external inputs from the API
• Plenty of clever tricks: details in the paper
(fast logging, callbacks, finalizers, and more!)
46. @_jon_bell_ 5/23/13
Limitations and Future
Work
• AssumesVM correctness
• Thread Interleavings
• Employ developer-side race detectors [e.g. Naik]
• Integrate with existing thread access loggers [e.g. Huang]
• Privacy
• Symbolic execution on the client to generate new inputs
[e.g. Castro, Clause]
47. @_jon_bell_ 5/23/13
Chronicler: Lightweight Recording to
Reproduce Field Failures
Jonathan Bell, Nikhil Sarda and Gail Kaiser
Columbia University, NewYork, NY USA
https://github.com/Programming-Systems-Lab/chroniclerj
jbell@cs.columbia.edu