Automated Concurrency-Bug Fixing Guoliang Jin, Wei Zhang, Dongdong - - PowerPoint PPT Presentation

automated concurrency bug fixing
SMART_READER_LITE
LIVE PREVIEW

Automated Concurrency-Bug Fixing Guoliang Jin, Wei Zhang, Dongdong - - PowerPoint PPT Presentation

Automated Concurrency-Bug Fixing Guoliang Jin, Wei Zhang, Dongdong Deng, Den Libit, Shan Lu (OSDI 2012) Presented by: Kevin Burns October 2, 2013 Outline Paper Presentation Background/Motivation CFix Overview Bug Understanding Fix Strategy


slide-1
SLIDE 1

Automated Concurrency-Bug Fixing

Guoliang Jin, Wei Zhang, Dongdong Deng, Den Libit, Shan Lu (OSDI 2012) Presented by: Kevin Burns October 2, 2013

slide-2
SLIDE 2

Outline

Paper Presentation

Background/Motivation CFix Overview

Bug Understanding Fix Strategy Design Synchronization Enforcement Patch Testing and Selection Patch Merging Run-Time Support

Experimentation Setup Results Conclusion

Evaluation (Opinions)

slide-3
SLIDE 3

Background

Concurrency related bugs

Common Hard to detect Challenging to avoid Manual intervention is tedious and time consuming Can have drastic consequences in real-world applications

Therac 25 Facebook IPO

slide-4
SLIDE 4

Background - Trends/Scope of this work

Existing automated bug fixing tools and techniques

Quickstep Lock operations intelligently inserted from annotations Atomic region detection from profiling

Many bug detectors exist to detect the following:

Data races Order violations Atomicity violations Abnormal inter-thread dependencies

slide-5
SLIDE 5

Motivation

No existing automated bug fixing tool with the focus of performance and patch simplicity Need for a flexible framework to support the many exisiting bug detectors

slide-6
SLIDE 6

Background - LLVM

source: LLVM’s website http://www.aosabook.org/en/llvm.html

3-stage compiler Makes user optimizations easy via LLVM Intermediate Representation (IR)

Supports lightweight runtime optimizations Cross-function/interprocedural optimizations Whole program analysis Aggressive restructuring transformations

slide-7
SLIDE 7

CFix Overview

source: Jin et al.(2012) presentation [3]

A framework to automate the process of concurrency bug fixing Focusses on both Atomicity Violations (AV) and Order Violations (OV) separated into two distinct tools

AFix - Static analysis + code transformation to insert locks to fix AVs OFix - Static analysis and patch generation to fix OVs

All done inside LLVM’s optimizer phase

slide-8
SLIDE 8

CFix Stage 1 - Bug Understanding

source: Jin et al.(2012) presentation [3]

slide-9
SLIDE 9

CFix Stage 2 - Fix Strategy Design Overview

With a large variation of bugs, how do we design a small subset of strategies to cover all of them? Approach Taken: combine mutual exclusion enforcement and

  • rder relationship enforcement
slide-10
SLIDE 10

CFix Stage 2 - Fix Strategy Table

source: Jin et al.(2012) paper [2]

slide-11
SLIDE 11

CFix Stage 3 - Synchronization Enforcement Overview

How do we verify correctness, while maintaining performance and code simplicity Approach Taken: enforcing both order relationships (OFix) and mutual exclusion (AFix)

slide-12
SLIDE 12

CFix Stage 3 - Synchronization Enforcement OFix

Automatically fixes order violations Takes in call stacks as inputs Seperated into two types allA-B and firstA-B

allA-B: operation B cannot execute until all instances of

  • peration A has executed

firstA-B: operation B cannot execute until at least one instance of operation A has executed

slide-13
SLIDE 13

CFix Stage 3 - Synchronization Enforcement OFix Example

source: Jin et al.(2012) presentation [3] source: Jin et al.(2012) presentation [3]

slide-14
SLIDE 14

CFix Stage 3 - Synchronization Enforcement AFix

Four steps to ensure mutual exclusion

Put p and c into critical region Put r into critical region Make the above two regions mutually exclusive to one another Select or introduce a lock to protect the two regions

slide-15
SLIDE 15

CFix Stage 3 - Synchronization Enforcement AFix Example

source: Jin et al.(2012) presentation [3]

slide-16
SLIDE 16

CFix Stage 4 - Patch Testing and Selection

How do you test a multi-threaded application for correctness? How do you decide which patch is better than the others

slide-17
SLIDE 17

CFix Stage 4 - Patch Testing and Selection

Answer: CFix is designed to include patch-oriented testing

Static analysis and interleaving testing Executes the patched software with and without external interference

slide-18
SLIDE 18

CFix Stage 5 - Patch Merging

To guarantee simplicity, correctness, and performance, CFix follows four guidelines while patch merging

The final patch must have fewer signal and wait operations than all the individual unmerged patches The bugs must still be fixed Must not generate new deadlocks Significant performance loss is unacceptable

slide-19
SLIDE 19

CFix Run-Time Support

Low overhead ongoing process to monitor any future deadlocks appear that didn’t surface during testing

slide-20
SLIDE 20

Experimentation Setup

CFix was evaluated on 13 real-world bug cases Seperated into AV and OV bugged applications Identical LLVM settings on an 8-core Intel Xeon running RHEL 5

slide-21
SLIDE 21

Results

source: Jin et al.(2012) presentation [2]

slide-22
SLIDE 22

Conclusion

Limitations

OFix is not universal order violation bug fixer, only tries 2 different ordering OFix is also limited by it’s use of using call stacks to identify

  • perations. Therefore, it cannot fix order violation bugs that
  • ccur on the same stack

Conclusions

CFix fixes the more common types of OV and AV For the fixes it does make, performance and code complexity are not greatly compromised Creates great platform for future automated bug fixers CFix’s feedback is valuable to developers and bug detectors

slide-23
SLIDE 23

Evaluation (Opinions)

Related work being at the end of the paper No mention of source code release Would like to see more quantitative numbers against existing tools Liked the diagrams and number of examples Definitely a major research contribution Would like to see more clearly defined future work Details on how run-time support were lacking

slide-24
SLIDE 24

Bibliography

  • G. Jin, L. Song, W. Zhang, S. Lu, and B. Liblit.

Automated atomicity-violation fixing. In ACM SIGPLAN Notices, volume 46, pages 389–400. ACM, 2011.

  • G. Jin, W. Zhang, D. Deng, B. Liblit, and S. Lu.

Automated concurrency-bug fixing. In Symposium on Operating System Design and Implementation, 2012a.

  • G. Jin, W. Zhang, D. Deng, B. Liblit, and S. Lu.

Cfix automated concurrency-bug fixing. Presented at the Symposium on Operating System Design and Implementation, Hollywood, CA, 2012b.