80
A Technique for Enabling and Supporting Debugging of Field Failures James Clause and Alessandro Orso Georgia Institute of Technology This work was supported in part by NSF awards CCF-0541080 and CCR-0205422 to Georgia Tech. 1

A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Embed Size (px)

Citation preview

Page 1: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

A Technique for Enabling and Supporting Debugging of

Field Failures

James Clause and Alessandro OrsoGeorgia Institute of Technology

This work was supported in part by NSF awardsCCF-0541080 and CCR-0205422 to Georgia Tech.

1

Page 2: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)
Page 3: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)
Page 4: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)
Page 5: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)
Page 6: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)
Page 7: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

3

Page 8: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

3

Field failures: Anomalous behavior (or crashes) of deployed software that occur on user machines

Page 9: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

4

Page 10: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Crash logs

4

Page 11: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Crash logs

User-providedinformation

4

Page 12: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Our solution

5

Page 13: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Our solution

5

Record

Page 14: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Our solution

5

Record

Replay

Page 15: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Our solution

5

Record

Replay

Minimize

Page 16: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Our solution

5

Record

Replay

Minimize

Debug

Page 17: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Usage Scenario

6

In house In the field

Replay / Minimize(off line)

Record (on line)Develop

Replay / Debug

Execution

repository

✔/✘

Page 18: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Existing record / replay approaches

7

Regression testing

(e.g. Elbaum et al. 06, Orso et al. 06, Orso and Kennedy 05, Saff et al. 05, Mercury WinRunner)

• Replay only a portion of an execution by recording events for specific subsystems

Both types of technique are not amenable tominimization and may cause unacceptable overhead

Deterministic debugging

(e.g. Chen et al. 01, King et al. 05, Narayanasamy et al. 05, Netzer and Weaver 94, Srinivasan et al. 04, VMWare)

• Replay an entire execution by recording every component of an application

Page 19: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Outline

✓Motivation & background

• Our technique

• record

• replay

• minimization

• Empirical evaluation

• Conclusion & future work

8

Page 20: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Record & Replay

• Goal: develop an approach that has low overhead and is amenable to minimization

• Key insight: avoid focusing on low-level (internal) events

• expensive (large number of events)

• not amenable to minimization (high interdependence)

9

Page 21: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Record & Replay

• Goal: develop an approach that has low overhead and is amenable to minimization

• Key insight: avoid focusing on low-level (internal) events

• expensive (large number of events)

• not amenable to minimization (high interdependence)

➡ Focus on high-level (external) interactions with the environment

• efficient (fewer, more “expensive” interactions)

• amenable to minimization (low interdependence)

10

Page 22: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment interactions

11

Page 23: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment interactions

Streams

11

Page 24: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment interactions

Streams Files

11

Page 25: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment interactions

Streams Files

11

Page 26: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment interactions

Streams Files

11

Interaction events: FILE — interaction with a file POLL — checks for availability of data on a stream PULL — read data from a stream

Page 27: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

Page 28: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

Page 29: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

Page 30: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

POLL KEYBOARD NOK

Page 31: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

POLL KEYBOARD NOK

Page 32: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

KEYBOARD: {5680}

POLL KEYBOARD OK

POLL KEYBOARD NOK

Page 33: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

KEYBOARD: {5680}

POLL KEYBOARD OK

POLL KEYBOARD NOK

Page 34: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

KEYBOARD: {5680} hello

POLL KEYBOARD OK

PULL KEYBOARD 5

POLL KEYBOARD NOK

Page 35: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

KEYBOARD: {5680} hello

POLL KEYBOARD OK

PULL KEYBOARD 5

POLL KEYBOARD NOK

Page 36: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

KEYBOARD: {5680} hello

POLL KEYBOARD OK

PULL KEYBOARD 5

POLL KEYBOARD NOK

POLL NETWORK OK

NETWORK: {3405}

Page 37: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

KEYBOARD: {5680} hello

POLL KEYBOARD OK

PULL KEYBOARD 5

POLL KEYBOARD NOK

POLL NETWORK OK

NETWORK: {3405}

Page 38: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Event log:

Environment data (files):

12

Environment data (streams):

FILE foo.1

foo.1

KEYBOARD: {5680} hello

POLL KEYBOARD OK

PULL KEYBOARD 5

POLL KEYBOARD NOK

POLL NETWORK OK

NETWORK: {3405}

Page 39: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment data (files):

13

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2...PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK...

foo.1 foo.2 bar.1

Page 40: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment data (files):

14

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2...PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK...

foo.1 foo.2 bar.1

Page 41: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment data (files):

14

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2...PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK...

foo.1 foo.2 bar.1

Page 42: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment data (files):

14

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2...PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK...

foo.1 foo.2 bar.1

Page 43: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment data (files):

14

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2...PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK...

foo.1 foo.2 bar.1

Page 44: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment data (files):

14

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2...PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK...

foo.1 foo.2 bar.1

Page 45: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Environment data (files):

14

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2...PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK...

foo.1 foo.2 bar.1

✔✔

✔✔✔✔

✔✔

✔✔

✔✔

Page 46: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize

15

Goal: focus debugging effort

Page 47: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize

15

Goal: focus debugging effort

Executionrecording

Page 48: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize

15

Goal: focus debugging effort

Executionrecording

Time

minimization

Page 49: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize

15

Goal: focus debugging effort

Executionrecording

Executionrecording

Time

minimization

Page 50: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize

15

Goal: focus debugging effort

Executionrecording

Executionrecording

Time

minimization

✂Data

minimization

Page 51: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize

15

Goal: focus debugging effort

Executionrecording

Executionrecording

Executionrecording

Time

minimization

✂Data

minimization

Page 52: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: time

Environment data (files):

16

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK

Page 53: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: time

Environment data (files):

16

Event log:

Environment data (streams):KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

FILE foo.1POLL KEYBOARD NOKPOLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1POLL NETWORK NOKPOLL NETWORK OKFILE foo.2PULL NETWORK 1024FILE foo.2POLL KEYBOARD NOK

Page 54: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: time

Environment data (files):

17

Event log:

Environment data (streams):

FILE foo.1

POLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1

POLL NETWORK OKFILE foo.2PULL NETWORK 1024FILE foo.2

KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

Page 55: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: time

Environment data (files):

17

Event log:

Environment data (streams):

FILE foo.1

POLL KEYBOARD OKPULL KEYBOARD 1POLL NETWORK OKPULL NETWORK 1024FILE bar.1

POLL NETWORK OKFILE foo.2PULL NETWORK 1024FILE foo.2

KEYBOARD: {5680}hello ❙ {4056}c ❙ {300}...

NETWORK: {3405}<html><body>... ❙ {202}...

Page 56: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 57: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 58: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 59: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 60: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 61: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 62: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 63: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 64: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 65: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 66: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 67: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 68: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 69: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimize: data

18

Atoms

Chunks

Whole

entities

Data minimization Environment

Page 70: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

The tool: ADDAAssisting the Debugging

of Deployed Applications

• Record and Replay:

• Works on x86 (c-lib based) binaries

• Based on dynamic instrumentation (Pin)

• Maps c-library calls to interaction events

• Minimization:

• Set of extensible scripts

19

Page 71: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Limitations

Two main limitations:

• Technique: May not replay non-deterministic failures

• Implementation:Does not handle window system events (yet)

20

Page 72: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Empirical evaluation

• Research questions

• Can ADDA produce minimized executions that can be used to debug the original failure?

• How much overhead does ADDA impose?

• Subject:

• Pine — widely-used email / news client

• Data:

• Two real field failures from Pine’s history

• Set of 20 failing executions, 10 per failure

21

Page 73: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Empirical evaluation

• Research questions

• Can ADDA produce minimized executions that can be used to debug the original failure?

• How much overhead does ADDA impose?

• Subject:

• Pine — widely-used email / news client

• Data:

• Two real field failures from Pine’s history

• Set of 20 failing executions, 10 per failure

22

Page 74: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimization results

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

# entities streams size files size

23

Ave

rage

val

ue a

fter

min

imiz

atio

n

Header-color fault Address book fault

Page 75: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimization results

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

# entities streams size files size

23

Ave

rage

val

ue a

fter

min

imiz

atio

n

Header-color fault Address book fault

Moreover, these results are conservative: recorded executions only contain the minimal amount of data needed to perform an action.

Page 76: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Minimization results

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

# entities streams size files size

23

Ave

rage

val

ue a

fter

min

imiz

atio

n

Header-color fault Address book fault

Overhead• Offline: less than 75 minutes for minimization

• Online: negligible overhead while recording

Moreover, these results are conservative: recorded executions only contain the minimal amount of data needed to perform an action.

Page 77: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Specific Example: Address Book Failure

• Complete execution

• 34 entities (files and streams)

• ≈800kb

• Minimized execution

• 5 partial entities (4 files,1 stream)

• ≈72kb

Page 78: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Future work

• More studies: additional applications and real users

• Extend technique / implementation

• Support windowing system

• Investigate ad-hoc minimization algorithms

• Include non-deterministic events (if needed)

25

Page 79: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Conclusions

• Novel approach that supports debugging

field failures

• Prototype implementation for x86 binaries

• Preliminary empirical evaluation: for the cases considered, our technique can

1. minimize failing executions,

2. preserve their failing behavior, and

3. impose low overhead on users26

Page 80: A Technique for Enabling and Supporting Debugging of Field Failures (ICSE 2007)

Questions?

27