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)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 

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%