SlideShare une entreprise Scribd logo
1  sur  15
Linux Variability Anomalies:
What Causes Them?
How do They Get Fixed?
MSR 2013, May 18th 2013 -- San Francisco, USA
Sarah Nadi, Christian Dietrich, Reinhard Tartler,
Richard C. Holt, Daniel Lohmann
Configuring the Linux Kernel
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 2
User
Selection
Linux Kernel
Configuration
Customized
KernelLinux User
I’ll customize this
kernel for my
specific needs!
Variability in Linux (e.g.,Adding New Driver)
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 3
New driver to
add?… Here we
go again!
Linux
Developer
...
#ifdef USB
void put_usb(...);
….
#endif
...
usb_foo.c
...
obj-$(USB_FOO) += usb_foo.o
...
Kbuild
(Makefile)
...
config USB_FOO
bool “FOO Support”
depends on USB
...
Kconfig
Maintaining Consistency is hard!!
Variability Anomalies
• Inconsistencies between the 3 artifacts leads to dead and
undead CPP code [Tartler et al., EUROSYS ‘11][Nadi & Holt, CSMR‘12]
• In Linux v3.6, 1,077 variability anomalies detected!
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 4
Linux Developer
OK, help me
avoid them!
How do these anomalies get
introduced?
How do these anomalies get
fixed?
Avoid future anomalies
Automatically suggest solutions
Study Overview
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 5
Exploratory Case Study
Study set of 106 existing
patches (51% accepted)
1
Patterns
Confirmatory Case Study
a) Use undertaker to
detect anomalies
b) Mine git repository over
several releases to
confirm patterns
2
undertaker
Undertaker
• Detects dead & undead
code blocks
• Uses SAT solver
for consistency
checking
• Developed at FAU
[Tartler et al., Eurosys ‘11]
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 6
Referential Variability Anomalies
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 7
Referential
Anomalies
• Caused by missing feature definitions
• Missing features can never be selected
• Almost 40% of detected anomalies are referential
#ifdef USB
//B1
#else
//B2
#endif
Observations from Exploratory Study
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 8
Incorrect Feature
Names
1 2
Incomplete Kconfig
Patches
• Code is not useless – incorrect
feature was used
• Some incorrect features were
typos
• Responses suggest that several
of missing features were
previously renamed/deleted
Research Questions
RQ1: Are misspellings a common cause of variability
anomalies?
RQ2: Are incomplete Kconfig patches a common cause of
variability anomalies?
RQ3: How are variability anomalies fixed?
RQ4: How long do variability anomalies last in Linux?
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 9
Confirmatory Case Study - Overview
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 10
- Feature_X
+Feature_Y
25,410
CPP/Code Patches
- Feature_X
+Feature_Y
10,263
Kconfig Patches
Feature_X
missing
Referential
Anomalies
undertaker
v2.6.37 – v3.6
Kconfig
Patches
Time
cause
Mapping
CPP Patches
Kconfig Patches
Time
fix
Results: Causes of Variability Anomalies
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 11
Incomplete Kconfig patches often cause referential anomalies.
An average of 14% of referential anomalies are caused by
changes to Kconfig that are not completely propagated to
source code.
Incomplete
Kconfig
patches
Time
cause
Results: Fixes for Variability Anomalies
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 12
Referential anomalies are commonly fixed by CPP patches (26%
of the time) .
Time
fix
Kconfig/CPP
patches
Referential anomalies are seldom fixed by Kconfig patches (3% of
the time).
Summary of Results
RQ1: Are misspellings a common cause of variability
anomalies?
RQ2: Are incomplete Kconfig patches a common cause of
variability anomalies?
RQ3: How are variability anomalies fixed?
RQ4: How long do variability anomalies last in Linux?
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 13
Typos do not commonly cause anomalies
Anomalies are caused by incomplete Kconfig patches 14% of the time
Anomalies are often fixed by CPP patches (26% of the time)
On average, anomalies last for 6 releases
What Does it All Mean?
• Strict review process catches spelling mistakes
• Changes to Kconfig are sometimes not properly propagated to
the rest of the kernel
• Anomalies caused by incomplete changes are harder to catch
in the review process
• Developers tend to fix things on the code side since changes to
Kconfig have potentially cross-cutting concerns
• Developers have difficulty keeping everything consistent.
Providing them with automatic tools for these tasks may help.
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 14
Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 15
Questions?
snadi@uwaterloo.ca
http://swag.uwaterloo.ca/~snadi
Incomplete
configuration
patches
Code (CPP)
patches
Time
cause fix
14% 26%

Contenu connexe

Similaire à Linux Variability Anomalies: What Causes Them and How do They get Fixed?

DevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesDevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 Slides
Alex Cruise
 
117 A Outline 25
117 A Outline 25117 A Outline 25
117 A Outline 25
wasntgosu
 
Generics Tutorial
Generics TutorialGenerics Tutorial
Generics Tutorial
wasntgosu
 

Similaire à Linux Variability Anomalies: What Causes Them and How do They get Fixed? (20)

KARMA: Adaptive Android Kernel Live Patching
KARMA: Adaptive Android Kernel Live PatchingKARMA: Adaptive Android Kernel Live Patching
KARMA: Adaptive Android Kernel Live Patching
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
Satisfiability
SatisfiabilitySatisfiability
Satisfiability
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!
 
UNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.pptUNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.ppt
 
Icsm19.ppt
Icsm19.pptIcsm19.ppt
Icsm19.ppt
 
Introduction to multicore .ppt
Introduction to multicore .pptIntroduction to multicore .ppt
Introduction to multicore .ppt
 
Variability, Bugs, and Cognition
Variability, Bugs, and CognitionVariability, Bugs, and Cognition
Variability, Bugs, and Cognition
 
LAS16-106: GNU Toolchain Development Lifecycle
LAS16-106: GNU Toolchain Development LifecycleLAS16-106: GNU Toolchain Development Lifecycle
LAS16-106: GNU Toolchain Development Lifecycle
 
Sattose 2020 presentation
Sattose 2020 presentationSattose 2020 presentation
Sattose 2020 presentation
 
Kernel Recipes 2015: How to choose a kernel to ship with a product
Kernel Recipes 2015: How to choose a kernel to ship with a productKernel Recipes 2015: How to choose a kernel to ship with a product
Kernel Recipes 2015: How to choose a kernel to ship with a product
 
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
 
How aspects clean your code
How aspects clean your codeHow aspects clean your code
How aspects clean your code
 
DevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesDevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 Slides
 
Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation
 
117 A Outline 25
117 A Outline 25117 A Outline 25
117 A Outline 25
 
Generics Tutorial
Generics TutorialGenerics Tutorial
Generics Tutorial
 
HIS 2017 Mark Batty-Industrial concurrency specification for C/C++
HIS 2017 Mark Batty-Industrial concurrency specification for C/C++HIS 2017 Mark Batty-Industrial concurrency specification for C/C++
HIS 2017 Mark Batty-Industrial concurrency specification for C/C++
 
An Overview of Distributed Debugging
An Overview of Distributed DebuggingAn Overview of Distributed Debugging
An Overview of Distributed Debugging
 
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika TripathiComputer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Linux Variability Anomalies: What Causes Them and How do They get Fixed?

  • 1. Linux Variability Anomalies: What Causes Them? How do They Get Fixed? MSR 2013, May 18th 2013 -- San Francisco, USA Sarah Nadi, Christian Dietrich, Reinhard Tartler, Richard C. Holt, Daniel Lohmann
  • 2. Configuring the Linux Kernel Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 2 User Selection Linux Kernel Configuration Customized KernelLinux User I’ll customize this kernel for my specific needs!
  • 3. Variability in Linux (e.g.,Adding New Driver) Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 3 New driver to add?… Here we go again! Linux Developer ... #ifdef USB void put_usb(...); …. #endif ... usb_foo.c ... obj-$(USB_FOO) += usb_foo.o ... Kbuild (Makefile) ... config USB_FOO bool “FOO Support” depends on USB ... Kconfig Maintaining Consistency is hard!!
  • 4. Variability Anomalies • Inconsistencies between the 3 artifacts leads to dead and undead CPP code [Tartler et al., EUROSYS ‘11][Nadi & Holt, CSMR‘12] • In Linux v3.6, 1,077 variability anomalies detected! Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 4 Linux Developer OK, help me avoid them! How do these anomalies get introduced? How do these anomalies get fixed? Avoid future anomalies Automatically suggest solutions
  • 5. Study Overview Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 5 Exploratory Case Study Study set of 106 existing patches (51% accepted) 1 Patterns Confirmatory Case Study a) Use undertaker to detect anomalies b) Mine git repository over several releases to confirm patterns 2 undertaker
  • 6. Undertaker • Detects dead & undead code blocks • Uses SAT solver for consistency checking • Developed at FAU [Tartler et al., Eurosys ‘11] Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 6
  • 7. Referential Variability Anomalies Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 7 Referential Anomalies • Caused by missing feature definitions • Missing features can never be selected • Almost 40% of detected anomalies are referential #ifdef USB //B1 #else //B2 #endif
  • 8. Observations from Exploratory Study Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 8 Incorrect Feature Names 1 2 Incomplete Kconfig Patches • Code is not useless – incorrect feature was used • Some incorrect features were typos • Responses suggest that several of missing features were previously renamed/deleted
  • 9. Research Questions RQ1: Are misspellings a common cause of variability anomalies? RQ2: Are incomplete Kconfig patches a common cause of variability anomalies? RQ3: How are variability anomalies fixed? RQ4: How long do variability anomalies last in Linux? Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 9
  • 10. Confirmatory Case Study - Overview Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 10 - Feature_X +Feature_Y 25,410 CPP/Code Patches - Feature_X +Feature_Y 10,263 Kconfig Patches Feature_X missing Referential Anomalies undertaker v2.6.37 – v3.6 Kconfig Patches Time cause Mapping CPP Patches Kconfig Patches Time fix
  • 11. Results: Causes of Variability Anomalies Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 11 Incomplete Kconfig patches often cause referential anomalies. An average of 14% of referential anomalies are caused by changes to Kconfig that are not completely propagated to source code. Incomplete Kconfig patches Time cause
  • 12. Results: Fixes for Variability Anomalies Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 12 Referential anomalies are commonly fixed by CPP patches (26% of the time) . Time fix Kconfig/CPP patches Referential anomalies are seldom fixed by Kconfig patches (3% of the time).
  • 13. Summary of Results RQ1: Are misspellings a common cause of variability anomalies? RQ2: Are incomplete Kconfig patches a common cause of variability anomalies? RQ3: How are variability anomalies fixed? RQ4: How long do variability anomalies last in Linux? Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 13 Typos do not commonly cause anomalies Anomalies are caused by incomplete Kconfig patches 14% of the time Anomalies are often fixed by CPP patches (26% of the time) On average, anomalies last for 6 releases
  • 14. What Does it All Mean? • Strict review process catches spelling mistakes • Changes to Kconfig are sometimes not properly propagated to the rest of the kernel • Anomalies caused by incomplete changes are harder to catch in the review process • Developers tend to fix things on the code side since changes to Kconfig have potentially cross-cutting concerns • Developers have difficulty keeping everything consistent. Providing them with automatic tools for these tasks may help. Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 14
  • 15. Nadi et al. - MSR 2013 Causes & Fixes of Variability Anomalies 15 Questions? snadi@uwaterloo.ca http://swag.uwaterloo.ca/~snadi Incomplete configuration patches Code (CPP) patches Time cause fix 14% 26%