Analyzing the Internal Consistency of the Linux KConfig Model

advertisement
Analyzing the Internal Consistency
of the Linux KConfig Model
Stefan Hengelein
Daniel Lohmann
stefan.hengelein@fau.de
dl@cs.fau.de
System Software Group
Friedrich-Alexander University Erlangen-Nürnberg (FAU)
https://cados.cs.fau.de
FOSD Meeting ’15
supported by
The VAMOS/CADOS approach so far
Check for Satisfiability
MEMORY MODEL
FLATMEM
SPARSEMEM
DISCONTIGMEM
Makefile
arch/x86/init.c
arch/x86/entry32.S
arch/x86/...
lib/Makefile
kernel/sched.c
...
depe n d
s on
ϕCPP
#ifdef CONFIG_HOTPLUG_CPU
...
#endif
Hengelein
NUMA
EuroSys’11
GPCE’10
SPLC’12
USENIX’14
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
2 – 16
The VAMOS/CADOS approach so far
Combine and Check for Satisfiability
MEMORY MODEL
FLATMEM
SPARSEMEM
DISCONTIGMEM
Makefile
arch/x86/init.c
arch/x86/entry32.S
arch/x86/...
lib/Makefile
kernel/sched.c
...
depe n d
s on
ϕCPP ∧ ϕKconfig
#ifdef CONFIG_HOTPLUG_CPU
...
#endif
Hengelein
NUMA
EuroSys’11
GPCE’10
SPLC’12
USENIX’14
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
2 – 16
The VAMOS/CADOS approach so far
Combine and Check for Satisfiability
MEMORY MODEL
FLATMEM
SPARSEMEM
DISCONTIGMEM
Makefile
arch/x86/init.c
arch/x86/entry32.S
arch/x86/...
lib/Makefile
kernel/sched.c
...
depe n d
s on
ϕCPP ∧ϕKconfig ∧ϕKbuild
#ifdef CONFIG_HOTPLUG_CPU
...
#endif
Hengelein
NUMA
EuroSys’11
GPCE’10
SPLC’12
USENIX’14
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
2 – 16
But, what about...
Check for Satisfiability
MEMORY MODEL
FLATMEM
SPARSEMEM
DISCONTIGMEM
Makefile
arch/x86/init.c
arch/x86/entry32.S
arch/x86/...
lib/Makefile
kernel/sched.c
...
Hengelein
depe n d
NUMA
s on
ϕKconfig
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
3 – 16
But, what about...
Combine and Check for Satisfiability
MEMORY MODEL
FLATMEM
SPARSEMEM
DISCONTIGMEM
Makefile
arch/x86/init.c
arch/x86/entry32.S
arch/x86/...
lib/Makefile
kernel/sched.c
...
Hengelein
depe n d
NUMA
s on
ϕKconfig ∧ ϕKbuild
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
3 – 16
Defect Types
Logical:
Contradiction in direct dependencies
Contradiction in direct dependencies + transitive dependencies
Missing:
Force disable undefined options on the current architecture
Undead:
always on symbols intended undead
Transitive always on, selected by option that is always on itself
Unreachable Symbols:
No prompt, no default, no selects
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
4 – 16
Defect Types
v4.0
Logical:
Contradiction in direct dependencies
Contradiction in direct dependencies + transitive dependencies
0
1
Missing:
Force disable undefined options on the current architecture
39
Undead:
always on symbols intended undead
Transitive always on, selected by option that is always on itself
Unreachable Symbols:
No prompt, no default, no selects
Hengelein
28
unique: 430
accumulated: 1434
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
4 – 16
Example - Logical Defect in KConfig
menu " TI OMAP / AM / DM / DRA Family "
depends on ARCH_MULTI_V6
config OM AP4_ER RATA_I688
bool " OMAP4 errata : Async Bridge Corruption "
depends on ! ARCH_MULTIPLATFORM
endmenu
menu " Multiple platform selection "
depends on ARCH_MULTIPLATFORM
config ARCH_MULTI_V6
bool " ARMv6 based platforms ( ARM11 )"
endmenu
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
5 – 16
Example - Logical Defect in KConfig
menu " TI OMAP / AM / DM / DRA Family "
depends on ARCH_MULTI_V6
config OM AP4_ER RATA_I688
bool " OMAP4 errata : Async Bridge Corruption "
depends on ! ARCH_MULTIPLATFORM
endmenu
menu " Multiple platform selection "
depends on ARCH_MULTIPLATFORM
config ARCH_MULTI_V6
bool " ARMv6 based platforms ( ARM11 )"
endmenu
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
5 – 16
Example - Logical Defect in KConfig
menu " TI OMAP / AM / DM / DRA Family "
depends on ARCH_MULTI_V6
config OM AP4_ER RATA_I688
bool " OMAP4 errata : Async Bridge Corruption "
depends on ! ARCH_MULTIPLATFORM
endmenu
menu " Multiple platform selection "
depends on ARCH_MULTIPLATFORM
config ARCH_MULTI_V6
bool " ARMv6 based platforms ( ARM11 )"
endmenu
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
5 – 16
Example - Logical Defect in KConfig
menu " TI OMAP / AM / DM / DRA Family "
depends on ARCH_MULTI_V6
config OM AP4_ER RATA_I688
bool " OMAP4 errata : Async Bridge Corruption "
depends on ! ARCH_MULTIPLATFORM
endmenu
menu " Multiple platform selection "
depends on ARCH_MULTIPLATFORM
config ARCH_MULTI_V6
bool " ARMv6 based platforms ( ARM11 )"
endmenu
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
5 – 16
Example - Logical Defect in KConfig
menu " TI OMAP / AM / DM / DRA Family "
depends on ARCH_MULTI_V6
config OM AP4_ER RATA_I688
bool " OMAP4 errata : Async Bridge Corruption "
depends on ! ARCH_MULTIPLATFORM
endmenu
menu " Multiple platform selection "
depends on ARCH_MULTIPLATFORM
config ARCH_MULTI_V6
bool " ARMv6 based platforms ( ARM11 )"
endmenu
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
5 – 16
Example - Logical Defect in KConfig
menu " TI OMAP / AM / DM / DRA Family "
depends on ARCH_MULTI_V6
config OM AP4_ER RATA_I688
bool " OMAP4 errata : Async Bridge Corruption "
depends on ! ARCH_MULTIPLATFORM
endmenu
menu " Multiple platform selection "
depends on ARCH_MULTIPLATFORM
config ARCH_MULTI_V6
bool " ARMv6 based platforms ( ARM11 )"
endmenu
Conclusion
Patch submitted (https://lkml.org/lkml/2015/2/25/503)
Applied to “omap-for-v4.1/fixes-not-urgent”, not yet merged
Deleted 105 lines of code
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
5 – 16
Example - Missing Defect in KConfig
config GPIO_MB86S7X
bool " GPIO support for Fujitsu MB86S7x Platforms "
depends on ARCH_MB86S7X
help
Say yes here to support the GPIO controller in
Fujitsu MB86S70 SoCs .
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
6 – 16
Example - Missing Defect in KConfig
never defined
config GPIO_MB86S7X
bool " GPIO support for Fujitsu MB86S7x Platforms "
depends on ARCH_MB86S7X
help
Say yes here to support the GPIO controller in
Fujitsu MB86S70 SoCs .
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
6 – 16
Example - Missing Defect in KConfig
never defined
config GPIO_MB86S7X
bool " GPIO support for Fujitsu MB86S7x Platforms "
depends on ARCH_MB86S7X
help
Say yes here to support the GPIO controller in
Fujitsu MB86S70 SoCs .
Conclusion
GPIO MB86S7X is only used to compile one file
Currently 232 lines of dead code
Introduced with commit 0da094d8 (2015-01-19)
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
6 – 16
Example - Undead in KConfig
Undead:
config X86
def_bool y
...
select ANON_INODES
...
config ANON_INODES
bool
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
7 – 16
Example - Undead in KConfig
Undead:
config X86
def_bool y
...
select ANON_INODES
...
remove
config ANON_INODES
bool
replace with “def bool y”
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
7 – 16
Unreachable Symbols
Definition:
No prompt
No default or default n
No selects on symbol
config SND_SOC_AU1XI2SC
tristate
However:
There is almost always code behind these symbols
Often:
The same unreachable symbol is defined on multiple architectures
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
8 – 16
v2
.6
v2 .31
.6
v2 .32
.6
v2 .33
.6
v2 .34
.6
v2 .35
.6
v2 .36
.6
v2 .37
.6
v2 .38
.6
.3
9
v3
.0
v3
.1
v3
.2
v3
.3
v3
.4
v3
.5
v3
.6
v3
.7
v3
.8
v3
v3 .9
.1
v3 0
.1
v3 1
.1
v3 2
.1
v3 3
.1
v3 4
.1
v3 5
.1
v3 6
.1
v3 7
.1
v3 8
.1
9
v4
.0
unique_unreachable_symbols
400
300
200
100
version
v2
.6
v2 .31
.6
v2 .32
.6
v2 .33
.6
v2 .34
.6
v2 .35
.6
v2 .36
.6
v2 .37
.6
v2 .38
.6
.3
9
v3
.0
v3
.1
v3
.2
v3
.3
v3
.4
v3
.5
v3
.6
v3
.7
v3
.8
v3
v3 .9
.1
v3 0
.1
v3 1
.1
v3 2
.1
v3 3
.1
v3 4
.1
v3 5
.1
v3 6
.1
v3 7
.1
v3 8
.1
9
v4
.0
1.62 %
1.63 %
1.94 %
2.01 %
2.02 %
1.97 %
2.15 %
2.23 %
2.27 %
2.23 %
2.29 %
2.26 %
2.33 %
2.33 %
2.44 %
2.43 %
2.6 %
2.65 %
2.79 %
2.7 %
2.79 %
2.71 %
2.74 %
2.83 %
2.88 %
2.95 %
2.93 %
2.91 %
2.93 %
2.96 %
unique_unreachable_symbols
400
300
200
100
version
Unreachable Symbols
Do unreachable symbols cause problems?
Functional Bugs? Didn’t find one, yet
Dead code / dead files
At least one is intentional: BROKEN
Why are they in the kernel?
Removed selects and forgot to remove symbol/code?
Not yet fully implemented features?
Used downstream kernels?
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
10 – 16
Studying the Impact of Unreachable Symbols
Symbols can never be enabled
⇒ Force disable them for dead analysis
Dead analysis on Linux/v4.0 with file preconditions:
defects
current
1461
+ unreachable information
1808
+347 (+23%)
49 files are dead
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
11 – 16
# B00 : sound / soc / au1x / i2sc . c :0:0: sound / soc / au1x / i2sc . c :0:0:
B00
&&
( B0 <-> CONFIG_PM )
&& ( B1 <-> ( ! ( B0 ) )
...
&& ( CONFIG_FUTEX -> ( CO NFIG _RT _MU TEX ES ) )
&& ( C O N FIG _GEN ERI C_I O -> (( CONFIG_HAS_IOMEM ) ) )
&& ( C O N FIG_HAS_IOMEM -> (! CONFIG_NO_IOMEM && ((! CONFIG_NO_IOMEM ) ->
C O NFIG _GE NER IC_ IO ) && (! CONFIG_NO_IOMEM ) ) )
&& ( CONFIG_I2C -> (! CON FIG _I2C _MO DUL E && CON FIG _RT _MU TEXE S ) )
&& ( C O N FIG _I2C _MO DUL E -> (! CONFIG_I2C && CONFIG_MODULES && C ONFI G_R T_M UTE XES ) )
&& ( CONFIG_INPUT -> (! CONFIG_UML && ! C O N F I G _ I N P UT _ M O D U L E ) )
&& ( C O N F I G _ IN P U T _ M O D U LE -> (! CONFIG_UML && ! CONFIG_INPUT && CONFIG_MODULES ) )
&& ( C O N FIG _RT_ MUT EXE S -> (( CONFIG_FUTEX || CONFIG_I2C || CON FIG _I2 C_MO DUL E ) ) )
&& ( CONFIG_SND -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML ) && !
C O NFIG _SN D_M ODU LE ) )
&& ( F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c -> (( CONFIG_SND || CON FIG _SND _MO DUL E )
&& ( CONFIG_SND_SOC || C O N F I G _ S N D _ S O C _ M O D U L E )
&& ( C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C || C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C _ M O D U L E ) ) )
&& ( C O N F I G _ S N D _ A C 9 7 _ C O D E C -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML &&
CONFIG_SND ) && ! C O N F I G _ S N D _ A C 9 7 _ C O D E C _ M O D U L E && (((( C ON F I G _ S O U N D_ M O D U L E ||
CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && ( CONF IG_ SND _MO DULE ||
CONFIG_SND ) ) ) -> C O NF IG _ SN D _V MA S TE R ) ) )
&& ( C O N F I G _ S N D _ A C 9 7 _ C O D E C _ M O D U L E -> ((( C O N F I G _ S OU N D _ M O D U L E || CONFIG_SOUND ) && !
CONFIG_M68K && ! CONFIG_UML && ( CON FIG _SN D_MO DUL E || CONFIG_SND ) ) && !
C O N F I G _ S N D _ A C 9 7 _ C O D E C && CONFIG_MODULES && (((( C O NF I G _ S O U N D _M O D U L E ||
CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && ( CONF IG_ SND _MO DULE ||
CONFIG_SND ) ) ) -> C O NF IG _ SN D _V MA S TE R ) ) )
&& ( C O N FIG _SND _CA 010 6 -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML &&
CONFIG_SND && CONFIG_SND_PCI ) && ! C O N F I G _ S N D _ C A 0 1 0 6 _ M O D U L E && ((((
C O N F I G_ S O U N D _ M O DU L E || CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && (
C O NFIG _SN D_M ODU LE || CONFIG_SND ) && CONFIG_SND_PCI ) ) -> C ON FI G _S N D_ VM A ST E R ) ) )
&& ( C O N F I G _ S N D _ C A 0 1 0 6 _ M O D U L E -> ((( C O N F I G _ S O UN D _ M O D U L E || CONFIG_SOUND ) && !
CONFIG_M68K && ! CONFIG_UML && ( CON FIG _SN D_MO DUL E || CONFIG_SND ) &&
CONFIG_SND_PCI ) && ! CO NFI G_SN D_C A01 06 && CONFIG_MODULES && ((((
C O N F I G_ S O U N D _ M O DU L E || CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && (
C O NFIG _SN D_M ODU LE || CONFIG_SND ) && CONFIG_SND_PCI ) ) -> C ON FI G _S N D_ VM A ST E R ) ) )
&& ! C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C && ! C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C _ M O D U L E
&& ( C ONFIG_SND_HDA -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML && CONFIG_SND )
&& ! C O N F I G _ S N D _ H D A _ M O D U L E && (((( C O N F I G_ S O U N D _ M O D UL E || CONFIG_SOUND ) && !
CONFIG_M68K && ! CONFIG_UML && ( CON FIG _SN D_MO DUL E || CONFIG_SND ) ) ) ->
# B00 : sound / soc / au1x / i2sc . c :0:0: sound / soc / au1x / i2sc . c :0:0:
B00
&&
( B0 <-> CONFIG_PM )
&& ( B1 <-> ( ! ( B0 ) )
...
&& ( CONFIG_FUTEX -> ( CO NFIG _RT _MU TEX ES ) )
&& ( C O N FIG _GEN ERI C_I O -> (( CONFIG_HAS_IOMEM ) ) )
&& ( C O N FIG_HAS_IOMEM -> (! CONFIG_NO_IOMEM && ((! CONFIG_NO_IOMEM ) ->
C O NFIG _GE NER IC_ IO ) && (! CONFIG_NO_IOMEM ) ) )
&& ( CONFIG_I2C -> (! CON FIG _I2C _MO DUL E && CON FIG _RT _MU TEXE S ) )
&& ( C O N FIG _I2C _MO DUL E -> (! CONFIG_I2C && CONFIG_MODULES && C ONFI G_R T_M UTE XES ) )
&& ( CONFIG_INPUT -> (! CONFIG_UML && ! C O N F I G _ I N P UT _ M O D U L E ) )
&& ( C O N F I G _ IN P U T _ M O D U LE -> (! CONFIG_UML && ! CONFIG_INPUT && CONFIG_MODULES ) )
&& ( C O N FIG _RT_ MUT EXE S -> (( CONFIG_FUTEX || CONFIG_I2C || CON FIG _I2 C_MO DUL E ) ) )
&& ( CONFIG_SND -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML ) && !
C O NFIG _SN D_M ODU LE ) )
&& ( F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c -> (( CONFIG_SND || CONF IG_ SND _MO DULE )
&& ( CONFIG_SND_SOC || C O N F I G _ S N D _ S O C _ M O D U L E )
&& ( C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C || C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C _ M O D U L E ) ) )
&& ( C O N F I G _ S N D _ A C 9 7 _ C O D E C -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML &&
CONFIG_SND ) && ! C O N F I G _ S N D _ A C 9 7 _ C O D E C _ M O D U L E && (((( C ON F I G _ S O U N D_ M O D U L E ||
CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && ( CONF IG_ SND _MO DULE ||
CONFIG_SND ) ) ) -> C O NF IG _ SN D _V MA S TE R ) ) )
&& ( C O N F I G _ S N D _ A C 9 7 _ C O D E C _ M O D U L E -> ((( C O N F I G _ S OU N D _ M O D U L E || CONFIG_SOUND ) && !
CONFIG_M68K && ! CONFIG_UML && ( CON FIG _SN D_MO DUL E || CONFIG_SND ) ) && !
C O N F I G _ S N D _ A C 9 7 _ C O D E C && CONFIG_MODULES && (((( C O NF I G _ S O U N D _M O D U L E ||
CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && ( CONF IG_ SND _MO DULE ||
CONFIG_SND ) ) ) -> C O NF IG _ SN D _V MA S TE R ) ) )
&& ( C O N FIG _SND _CA 010 6 -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML &&
CONFIG_SND && CONFIG_SND_PCI ) && ! C O N F I G _ S N D _ C A 0 1 0 6 _ M O D U L E && ((((
C O N F I G_ S O U N D _ M O DU L E || CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && (
C O NFIG _SN D_M ODU LE || CONFIG_SND ) && CONFIG_SND_PCI ) ) -> C ON FI G _S N D_ VM A ST E R ) ) )
&& ( C O N F I G _ S N D _ C A 0 1 0 6 _ M O D U L E -> ((( C O N F I G _ S O UN D _ M O D U L E || CONFIG_SOUND ) && !
CONFIG_M68K && ! CONFIG_UML && ( CON FIG _SN D_MO DUL E || CONFIG_SND ) &&
CONFIG_SND_PCI ) && ! CO NFI G_SN D_C A01 06 && CONFIG_MODULES && ((((
C O N F I G_ S O U N D _ M O DU L E || CONFIG_SOUND ) && ! CONFIG_M68K && ! CONFIG_UML && (
C O NFIG _SN D_M ODU LE || CONFIG_SND ) && CONFIG_SND_PCI ) ) -> C ON FI G _S N D_ VM A ST E R ) ) )
&& ! C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C && ! C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C _ M O D U L E
&& ( C ONFIG_SND_HDA -> (( CONFIG_SOUND && ! CONFIG_M68K && ! CONFIG_UML && CONFIG_SND )
&& ! C O N F I G _ S N D _ H D A _ M O D U L E && (((( C O N F I G_ S O U N D _ M O D UL E || CONFIG_SOUND ) && !
CONFIG_M68K && ! CONFIG_UML && ( CON FIG _SN D_MO DUL E || CONFIG_SND ) ) ) ->
MUS-Analysis
New “-u” flag for the undertaker:
Calculate the minimal unsatisfiable subset (MUS) after dead
analysis
Based on the PicoMUS Tool (part of the PicoSAT Toolchain1 )
MUS-report:
ATTENTION: This formula might be incomplete or even inconclusive!
Minimized Formula from:
p cnf 2794 6581
to
p cnf 2794 559
( B00 )
^ ( CONFIG_SND_SOC_AU1XI2SC v CONFIG_SND_SOC_AU1XI2SC_MODULE )
^ (! F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c )
^ (! CONFIG_SND_SOC_AU1XI2SC )
^ (! CONFIG_SND_SOC_AU1XI2SC_MODULE )
^ (! B00 v F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c )
1
http://fmv.jku.at/picosat/
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
13 – 16
Example: Impact of an Unreachable Defect
Force disable unreachable symbols in dead analysis
Newly found defect:
sound/soc/au1x/i2sc.c.B00.kbuild.globally.dead
MUS-Formula:
( B00 ) ^ ( C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C ) ^
(! F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c ) ^ ( ! C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C )
^ (! B00 v F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c )
File preconditions:
F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c "... && C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C "
Symbol unreachable: SND SOC AU1XI2SC
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
14 – 16
Example: Impact of an Unreachable Defect
Force disable unreachable symbols in dead analysis
Newly found defect:
sound/soc/au1x/i2sc.c.B00.kbuild.globally.dead
MUS-Formula:
( B00 ) ^ ( C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C ) ^
(! F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c ) ^ ( ! C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C )
^ (! B00 v F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c )
File preconditions:
F I L E _ s o u n d _ s o c _ a u 1 x _ i 2 s c . c "... && C O N F I G _ S N D _ S O C _ A U 1 X I 2 S C "
Symbol unreachable: SND SOC AU1XI2SC
Conclusion
The whole file is dead (323 lines of code)
Introduced with commit b3c70c9e (2011-07-25)
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
14 – 16
Summary and Conclusions
Found logical, missing and undead defects in KConfig
Identified more dead code
Identified more redundant code
Maybe even functional defects
Logical defects are very rare in KConfig
Fixed the one logical defect in the current linux-next
Undertaker–CheckPatch now warns if options become
unreachable
MUS-Analysis helps to identify defects
Hengelein
Analyzing the Internal Consistency of the Linux KConfig Model (FOSD Meeting ’15)
15 – 16
Questions?
stefan.hengelein@fau.de
Download