SlideShare a Scribd company logo
Bugs as Deviant Behavior:
A General Approach to Inferring Errors in
Systems Code
Dawson Engle, David Yu Chen, Seth Hallem,
Andy Chou, Benjamin Chelf
Miroslav Cupak
10/01/2012
Introduction
systems obey rules for correctness and
performance
verification, testing, manual and automatic
inspection
problem with static analysis: what rules to
check?
solution: automatically extract from source
Techniques
problem: finding what is incorrect without
knowing what is correct
tools: contradictions & common behaviour
approach: internal consistency & statistical
analysis
implement checkers and apply them to Linux &
OpenBSD
Terminology
beliefs
MUST
MAY
templates
slots
Internal Consistency
checkers defined by:
the rule template T
the valid slot instances for T
the code actions implying beliefs
the rules for how beliefs combine & the rules for
contradiction
the rules for belief propagation
issues:
inferring beliefs (direct observation,
pre/post-conditions)
relating code (implementation, abstraction)
Statistical Analysis
internal consistency checkers with
modifications:
assume all slot-instance combinations are MUST
beliefs
indicate checks and failures
rank the errors and order the results to get most
relevant results
issues:
large set of cases
pre-processing
noise (large samples, ranking, human-level
operations)
extensible, makes use of empty templates
latent specifications (naming conventions, error
codes)
Checker: Null Pointer Consistency
static null pointer detection
based on internal consistency
associates pointers with belief sets and flags
contradictions
check-then-use
use-then-check
redundant checks
Checker: Statistical Lock Inference
detection of accesses to shared variables
without their locks
problem: finding variable-lock bindings
test MAY beliefs, rank errors
forward and backward propagation of locks
Checker: Security
determine whether the pointer is a kernel (safe)
or a user (tainted) pointer, report intersection
based on dereference counts
problems:
false positives problem due to kernel backdoors
checking if they are called from user or kernel code
manual inspection
Checker: Failure Checking
find routines that are not checked or are
incorrectly checked for failures
routines returning null pointers are checked before
use
unnecessary checking of routines that cannot fail
Checker: Temporal Rules
no A after B (free memory)
B must follow A (lock-unlock)
important preprocessing of traces
Results
finding bugs without special knowledge of the
correctness of the program
many interesting bugs
new surprising bugs
real bug reports and patches
significant portion of false positives (bug/false
positives ratio: null pointer 205/40, security
35/19)
Related work
extension of Checking System Rules Using
System-Specific, Programmer-Written Compiler
Extensions (Using Meta-level Compilation to
Check FLASH Protocol Code)
type systems
specifications
dynamic invariant inference
Questions?
What else can we check? Any ideas for other
checkers or situations?
What else can we check?
check permissions before writing to data
structures
reenable interrupts after disabling them
size limit on variables
hold read locks if variable is not modified
memory allocation before its use
protocol headers
double if statements
waiting on synchronous sends
certain references not allowed in parts of code
How can we use this tool to prevent deadlocks?
How can we use this tool to prevent deadlocks?
lock releasing after acquiring it
kernel cannot call blocking functions with
interrupts disabled
thread holding spin lock cannot block
temporal ordering
What do you see as the biggest problem of the
proposed tools? How would you tackle it?
What do you see as the biggest problem of the proposed tools?
setup cost
manual inspection
false positives (ranking, thresholds)
performance
If you were a developer in a real SW company trying
to extend their QE processes, would you consider
adoption of this tool a good idea? What could
make it more practical?
Do you consider the tool usable in real SW companies?
still a lot of manual work, but it can help
relatively easily extensible
flexibility
scalability
+ IDE integration
+ improve performance (storing history,
running on parts of code, ignore certain paths)
Are the metrics in use objective?
Are the metrics in use objective?
exhaustive all-paths search shifting the rating
preprocesssing step
heuristics
relying on code convention

More Related Content

PDF
Test Case Prioritization for Acceptance Testing of Cyber Physical Systems
PDF
DevOps with GitHub Actions
PDF
How to Choose the Proper Infra (Online, Odoo.sh, On premise)
PPTX
CICD Pipeline Using Github Actions
PPTX
How to Design a Successful Test Automation Strategy
PDF
Test Automation
PDF
Shift Left Testing: Going Beyond Agile
PDF
Introduction to GitHub Actions
Test Case Prioritization for Acceptance Testing of Cyber Physical Systems
DevOps with GitHub Actions
How to Choose the Proper Infra (Online, Odoo.sh, On premise)
CICD Pipeline Using Github Actions
How to Design a Successful Test Automation Strategy
Test Automation
Shift Left Testing: Going Beyond Agile
Introduction to GitHub Actions

What's hot (20)

PDF
Test Automation Architecture
PDF
Ruin your life using robot framework
PPTX
Test Automation in Agile
PPTX
Jira-Zephyr_Training.pptx
PDF
Git Version Control System
PPTX
CI/CD with GitHub Actions
PPTX
functional testing
PPTX
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
PPTX
Guide to Agile testing
PDF
Introducing Pair Programming
PPTX
Git One Day Training Notes
PPT
Introduction to jira
PPTX
Agile Testing Strategy
PPTX
Robot framework
PDF
Agile Test Management Using Jira and Zephyr
PPTX
Cypress Automation
PPT
Scrum Testing Methodology
PPTX
Building a scalable microservice architecture with envoy, kubernetes and istio
PDF
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
PDF
Java Source Code Analysis using SonarQube
Test Automation Architecture
Ruin your life using robot framework
Test Automation in Agile
Jira-Zephyr_Training.pptx
Git Version Control System
CI/CD with GitHub Actions
functional testing
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
Guide to Agile testing
Introducing Pair Programming
Git One Day Training Notes
Introduction to jira
Agile Testing Strategy
Robot framework
Agile Test Management Using Jira and Zephyr
Cypress Automation
Scrum Testing Methodology
Building a scalable microservice architecture with envoy, kubernetes and istio
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
Java Source Code Analysis using SonarQube
Ad

Similar to Bugs as Deviant Behavior: A General Approach to Inferring Errors in Systems Code (20)

PPT
Testing 2 - Thinking Like A Tester
PPT
Getting Unstuck: Working with Legacy Code and Data
PPT
Object oriented sad 6
PPT
Automatic Assessment of Failure Recovery in Erlang Applications
PPTX
Taxonomy of bugs total topic covered presentation
PDF
Bt0081 software engineering2
PPTX
Implementing TDD in for .net Core applications
PPT
software testing mtehododlogies path testing
PDF
Different Methodologies For Testing Web Application Testing
PDF
Manual software-testing-interview-questions-with-answers
PDF
Manual software-testing-interview-questions-with-answers
PPT
Testing 3: Types Of Tests That May Be Required
DOCX
Manuel testing word
PPTX
Software Testing overview jay prakash maurya.pptx
PDF
Testing In Software Engineering
PPTX
Software_Testing_Overview.pptx
PPTX
ST UNIT-1.pptx
PPT
software-testing-strategies888888888.ppt
PPTX
Programming Fundamentals lecture 3
PPTX
Software testing
Testing 2 - Thinking Like A Tester
Getting Unstuck: Working with Legacy Code and Data
Object oriented sad 6
Automatic Assessment of Failure Recovery in Erlang Applications
Taxonomy of bugs total topic covered presentation
Bt0081 software engineering2
Implementing TDD in for .net Core applications
software testing mtehododlogies path testing
Different Methodologies For Testing Web Application Testing
Manual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answers
Testing 3: Types Of Tests That May Be Required
Manuel testing word
Software Testing overview jay prakash maurya.pptx
Testing In Software Engineering
Software_Testing_Overview.pptx
ST UNIT-1.pptx
software-testing-strategies888888888.ppt
Programming Fundamentals lecture 3
Software testing
Ad

More from Miro Cupak (20)

PDF
Exploring the latest and greatest from Java 14
PDF
Exploring reactive programming in Java
PDF
Exploring the last year of Java
PDF
Local variable type inference - Will it compile?
PDF
The Good, the Bad and the Ugly of Java API design
PDF
Local variable type inference - Will it compile?
PDF
Exploring reactive programming in Java
PDF
The good, the bad, and the ugly of Java API design
PDF
Master class in modern Java
PDF
The good, the bad, and the ugly of Java API design
PDF
Exploring reactive programming in Java
PDF
The good, the bad, and the ugly of Java API design
PDF
Writing clean code with modern Java
PDF
The good, the bad, and the ugly of Java API design
PDF
Master class in modern Java
PDF
Exploring reactive programming in Java
PDF
Writing clean code with modern Java
PDF
Exploring what's new in Java 10 and 11 (and 12)
PDF
Exploring what's new in Java 10 and 11
PDF
Exploring what's new in Java in 2018
Exploring the latest and greatest from Java 14
Exploring reactive programming in Java
Exploring the last year of Java
Local variable type inference - Will it compile?
The Good, the Bad and the Ugly of Java API design
Local variable type inference - Will it compile?
Exploring reactive programming in Java
The good, the bad, and the ugly of Java API design
Master class in modern Java
The good, the bad, and the ugly of Java API design
Exploring reactive programming in Java
The good, the bad, and the ugly of Java API design
Writing clean code with modern Java
The good, the bad, and the ugly of Java API design
Master class in modern Java
Exploring reactive programming in Java
Writing clean code with modern Java
Exploring what's new in Java 10 and 11 (and 12)
Exploring what's new in Java 10 and 11
Exploring what's new in Java in 2018

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
history of c programming in notes for students .pptx
PDF
System and Network Administration Chapter 2
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
L1 - Introduction to python Backend.pptx
PDF
AI in Product Development-omnex systems
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
How Creative Agencies Leverage Project Management Software.pdf
top salesforce developer skills in 2025.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Upgrade and Innovation Strategies for SAP ERP Customers
Softaken Excel to vCard Converter Software.pdf
Odoo POS Development Services by CandidRoot Solutions
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
history of c programming in notes for students .pptx
System and Network Administration Chapter 2
PTS Company Brochure 2025 (1).pdf.......
Wondershare Filmora 15 Crack With Activation Key [2025
2025 Textile ERP Trends: SAP, Odoo & Oracle
L1 - Introduction to python Backend.pptx
AI in Product Development-omnex systems
How to Choose the Right IT Partner for Your Business in Malaysia
Operating system designcfffgfgggggggvggggggggg
CHAPTER 2 - PM Management and IT Context
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
How Creative Agencies Leverage Project Management Software.pdf

Bugs as Deviant Behavior: A General Approach to Inferring Errors in Systems Code

  • 1. Bugs as Deviant Behavior: A General Approach to Inferring Errors in Systems Code Dawson Engle, David Yu Chen, Seth Hallem, Andy Chou, Benjamin Chelf Miroslav Cupak 10/01/2012
  • 2. Introduction systems obey rules for correctness and performance verification, testing, manual and automatic inspection problem with static analysis: what rules to check? solution: automatically extract from source
  • 3. Techniques problem: finding what is incorrect without knowing what is correct tools: contradictions & common behaviour approach: internal consistency & statistical analysis implement checkers and apply them to Linux & OpenBSD
  • 5. Internal Consistency checkers defined by: the rule template T the valid slot instances for T the code actions implying beliefs the rules for how beliefs combine & the rules for contradiction the rules for belief propagation issues: inferring beliefs (direct observation, pre/post-conditions) relating code (implementation, abstraction)
  • 6. Statistical Analysis internal consistency checkers with modifications: assume all slot-instance combinations are MUST beliefs indicate checks and failures rank the errors and order the results to get most relevant results issues: large set of cases pre-processing noise (large samples, ranking, human-level operations) extensible, makes use of empty templates latent specifications (naming conventions, error codes)
  • 7. Checker: Null Pointer Consistency static null pointer detection based on internal consistency associates pointers with belief sets and flags contradictions check-then-use use-then-check redundant checks
  • 8. Checker: Statistical Lock Inference detection of accesses to shared variables without their locks problem: finding variable-lock bindings test MAY beliefs, rank errors forward and backward propagation of locks
  • 9. Checker: Security determine whether the pointer is a kernel (safe) or a user (tainted) pointer, report intersection based on dereference counts problems: false positives problem due to kernel backdoors checking if they are called from user or kernel code manual inspection
  • 10. Checker: Failure Checking find routines that are not checked or are incorrectly checked for failures routines returning null pointers are checked before use unnecessary checking of routines that cannot fail
  • 11. Checker: Temporal Rules no A after B (free memory) B must follow A (lock-unlock) important preprocessing of traces
  • 12. Results finding bugs without special knowledge of the correctness of the program many interesting bugs new surprising bugs real bug reports and patches significant portion of false positives (bug/false positives ratio: null pointer 205/40, security 35/19)
  • 13. Related work extension of Checking System Rules Using System-Specific, Programmer-Written Compiler Extensions (Using Meta-level Compilation to Check FLASH Protocol Code) type systems specifications dynamic invariant inference
  • 15. What else can we check? Any ideas for other checkers or situations?
  • 16. What else can we check? check permissions before writing to data structures reenable interrupts after disabling them size limit on variables hold read locks if variable is not modified memory allocation before its use protocol headers double if statements waiting on synchronous sends certain references not allowed in parts of code
  • 17. How can we use this tool to prevent deadlocks?
  • 18. How can we use this tool to prevent deadlocks? lock releasing after acquiring it kernel cannot call blocking functions with interrupts disabled thread holding spin lock cannot block temporal ordering
  • 19. What do you see as the biggest problem of the proposed tools? How would you tackle it?
  • 20. What do you see as the biggest problem of the proposed tools? setup cost manual inspection false positives (ranking, thresholds) performance
  • 21. If you were a developer in a real SW company trying to extend their QE processes, would you consider adoption of this tool a good idea? What could make it more practical?
  • 22. Do you consider the tool usable in real SW companies? still a lot of manual work, but it can help relatively easily extensible flexibility scalability + IDE integration + improve performance (storing history, running on parts of code, ignore certain paths)
  • 23. Are the metrics in use objective?
  • 24. Are the metrics in use objective? exhaustive all-paths search shifting the rating preprocesssing step heuristics relying on code convention