Baris ¡Kasikci, ¡Cris,an ¡Zamfir, ¡and ¡George ¡Candea
School ¡of ¡Computer ¡& ¡Communica3on ¡Sciences
CoRD: Collabora,ve Data Race Detec,on Baris Kasikci, - - PowerPoint PPT Presentation
CoRD: Collabora,ve Data Race Detec,on Baris Kasikci, Cris,an Zamfir, and George Candea School of Computer & Communica3on Sciences Data Races 2 Data Races
Baris ¡Kasikci, ¡Cris,an ¡Zamfir, ¡and ¡George ¡Candea
School ¡of ¡Computer ¡& ¡Communica3on ¡Sciences
2
2
2
2
2
3
3
Races ¡are ¡numerous ¡in ¡modern ¡soDware
3
Races ¡are ¡numerous ¡in ¡modern ¡soDware 1000 ¡Races
4
4
Compilers ¡can ¡arbitrarily ¡break ¡racy ¡programs
4
How ¡to ¡Ensure ¡SoDware ¡is ¡ Race-‑free?
5
How ¡to ¡Ensure ¡SoDware ¡is ¡ Race-‑free?
5
✔ ✔
×
✔
×
✔
× ×
How ¡to ¡Ensure ¡SoDware ¡is ¡ Race-‑free?
5
✔ ✔
×
✔
×
✔
× ×
How ¡to ¡Ensure ¡SoDware ¡is ¡ Race-‑free?
5
Exis,ng ¡detectors ¡have ¡important ¡limita,ons ✔ ✔
×
✔
How ¡to ¡Ensure ¡SoDware ¡is ¡ Race-‑free?
6
✔ ✔ ✔
7
✔ ✔ ✔
CoRD
✔
7
✔ ✔ ✔
CoRD
✔
Sta,cally ¡detect ¡ poten,al ¡races ¡
7
✔ ✔ ✔
CoRD
✔
Sta,cally ¡detect ¡ poten,al ¡races ¡ Dynamically ¡validate ¡ detected ¡races
7
✔ ✔ ✔
CoRD
Effec,vely ¡detected ¡8 ¡real ¡races ¡in ¡two ¡ real ¡programs ¡with ¡1% ¡overhead ✔
Sta,cally ¡detect ¡ poten,al ¡races ¡ Dynamically ¡validate ¡ detected ¡races
CoRD ¡Architecture
P P P P virtual clearing house P P P P
Hive
8
CoRD ¡Architecture
CoRD ¡Architecture
P P P P virtual clearing house
instances ¡of ¡ program ¡P
P P P P
Hive
8
CoRD ¡Architecture
CoRD ¡Architecture
P P P P virtual clearing house
instances ¡of ¡ program ¡P
P P P P
Hive
Sta,cally ¡detect ¡ poten,al ¡races ¡in ¡P
8
CoRD ¡Architecture
CoRD ¡Architecture
P P P P virtual clearing house
instances ¡of ¡ program ¡P
P P P P
Hive
pods Sta,cally ¡detect ¡ poten,al ¡races ¡in ¡P
8
CoRD ¡Architecture
CoRD ¡Architecture
P P P P virtual clearing house
instances ¡of ¡ program ¡P
P P P P
Hive
pods Sta,cally ¡detect ¡ poten,al ¡races ¡in ¡P Dynamically ¡ validate ¡races
8
CoRD ¡Architecture
P P P P virtual clearing house
1 ¡Google ¡chrome ¡blog. ¡hFp://chrome.blogspot. ¡ch/2012_06_01_archive.html ¡ ¡ 2 ¡hFps://plus.google.com/114250946512808775436/posts/VaQu9sNxJuY, ¡2012 ¡ 3 ¡R. ¡Cozza ¡et ¡al, ¡Market ¡Share: ¡Mobile ¡Devices ¡by ¡Region ¡and ¡Country, ¡Gartner, ¡Feb ¡2012 ¡ 4 ¡hFp://arstechnica.com/informa3on-‑technology/2009/10/windows-‑7-‑had-‑8-‑million-‑testers-‑biggest-‑beta-‑ever/9
P P P P virtual clearing house
computers ¡ running ¡Chrome ¡1
300 ¡Million
1 ¡Google ¡chrome ¡blog. ¡hFp://chrome.blogspot. ¡ch/2012_06_01_archive.html ¡ ¡ 2 ¡hFps://plus.google.com/114250946512808775436/posts/VaQu9sNxJuY, ¡2012 ¡ 3 ¡R. ¡Cozza ¡et ¡al, ¡Market ¡Share: ¡Mobile ¡Devices ¡by ¡Region ¡and ¡Country, ¡Gartner, ¡Feb ¡2012 ¡ 4 ¡hFp://arstechnica.com/informa3on-‑technology/2009/10/windows-‑7-‑had-‑8-‑million-‑testers-‑biggest-‑beta-‑ever/9
P P P P virtual clearing house
computers ¡ running ¡Chrome ¡1
300 ¡Million
servers ¡owned ¡ by ¡Google ¡2
1.8 ¡Million
1 ¡Google ¡chrome ¡blog. ¡hFp://chrome.blogspot. ¡ch/2012_06_01_archive.html ¡ ¡ 2 ¡hFps://plus.google.com/114250946512808775436/posts/VaQu9sNxJuY, ¡2012 ¡ 3 ¡R. ¡Cozza ¡et ¡al, ¡Market ¡Share: ¡Mobile ¡Devices ¡by ¡Region ¡and ¡Country, ¡Gartner, ¡Feb ¡2012 ¡ 4 ¡hFp://arstechnica.com/informa3on-‑technology/2009/10/windows-‑7-‑had-‑8-‑million-‑testers-‑biggest-‑beta-‑ever/9
P P P P virtual clearing house
computers ¡ running ¡Chrome ¡1
300 ¡Million
servers ¡owned ¡ by ¡Google ¡2
1.8 ¡Million
1 ¡Google ¡chrome ¡blog. ¡hFp://chrome.blogspot. ¡ch/2012_06_01_archive.html ¡ ¡ 2 ¡hFps://plus.google.com/114250946512808775436/posts/VaQu9sNxJuY, ¡2012 ¡ 3 ¡R. ¡Cozza ¡et ¡al, ¡Market ¡Share: ¡Mobile ¡Devices ¡by ¡Region ¡and ¡Country, ¡Gartner, ¡Feb ¡2012 ¡ 4 ¡hFp://arstechnica.com/informa3on-‑technology/2009/10/windows-‑7-‑had-‑8-‑million-‑testers-‑biggest-‑beta-‑ever/mobile ¡devices ¡bought ¡in ¡2011 ¡3
1.8 ¡Billion
9
P P P P virtual clearing house
computers ¡ running ¡Chrome ¡1
300 ¡Million
servers ¡owned ¡ by ¡Google ¡2
1.8 ¡Million
1 ¡Google ¡chrome ¡blog. ¡hFp://chrome.blogspot. ¡ch/2012_06_01_archive.html ¡ ¡ 2 ¡hFps://plus.google.com/114250946512808775436/posts/VaQu9sNxJuY, ¡2012 ¡ 3 ¡R. ¡Cozza ¡et ¡al, ¡Market ¡Share: ¡Mobile ¡Devices ¡by ¡Region ¡and ¡Country, ¡Gartner, ¡Feb ¡2012 ¡ 4 ¡hFp://arstechnica.com/informa3on-‑technology/2009/10/windows-‑7-‑had-‑8-‑million-‑testers-‑biggest-‑beta-‑ever/mobile ¡devices ¡bought ¡in ¡2011 ¡3
1.8 ¡Billion
9
Windows ¡7 ¡ ¡ beta ¡testers4
8 ¡Million
Sta,c ¡Race ¡Detec,on
10
Sta,c ¡Race ¡Detec,on
10
Sta,c ¡Race ¡Detec,on
10
CFG ¡entry
Sta,c ¡Race ¡Detec,on
10
CFG ¡entry
Sta,c ¡Race ¡Detec,on
10
CFG ¡entry main() g() f()
Sta,c ¡Race ¡Detec,on
10
CFG ¡entry main() g() f()
Sta,c ¡Race ¡Detec,on
10
CFG ¡entry main() g() f()
11
11
12
Sta,c ¡Race ¡Detec,on
12
Sta,c ¡Race ¡Detec,on
x = 0
12
Sta,c ¡Race ¡Detec,on
x = 1 lock(l) unlock(l) Path ¡1 x = 0
12
Sta,c ¡Race ¡Detec,on
x = 1 lock(l) unlock(l) Path ¡1 x = 2 lock(k) unlock(k) Path ¡2 x = 0
12
Sta,c ¡Race ¡Detec,on
x = 1 lock(l) unlock(l) Path ¡1 x = 2 lock(k) unlock(k) Path ¡2 LS1 = {l} LS1 = {k} x = 0
13
LS1 = {l} x = 2 x = 1 LS1 = {k}
Sta,c ¡Race ¡Detec,on
13
LS1 = {l} x = 2 x = 1 LS1 = {k}
Sta,c ¡Race ¡Detec,on
13
LS1 = {l} x = 2 x = 1 LS1 = {k}
Sta,c ¡Race ¡Detec,on
=> x = 1 and x = 2 are ¡RACING!
13
LS1 = {l} x = 2 x = 1 LS1 = {k}
Sta,c ¡Race ¡Detec,on
Top-‑down, ¡flow ¡sensi,ve, ¡interprocedural, ¡lockset-‑based
=> x = 1 and x = 2 are ¡RACING!
Dynamic ¡Race ¡Valida,on
14
Hive
x = 2 x = 1 x = 2 x = 1
Dynamic ¡Race ¡Valida,on
14
Hive
P Pod ¡2 P Pod ¡1
x = 2 x = 1 x = 2 x = 1
Dynamic ¡Race ¡Valida,on
14
Hive
P Pod ¡2 P Pod ¡1
x = 2 x = 1 x = 2 x = 1 Time
Dynamic ¡Race ¡Valida,on
14
Hive
P Pod ¡2 P Pod ¡1
x = 2 x = 1 x = 2 x = 1 Time
e x e c u t e d executed
RACE
Dynamic ¡Race ¡Valida,on
14
Hive
P Pod ¡2 P Pod ¡1
x = 2 x = 1 x = 2 x = 1 Time
e x e c u t e d executed
RACE
d e a d l
k executed
RACE ¡CAUSES ¡ DEADLOCK
Dynamic ¡Race ¡Valida,on
14
Hive
P Pod ¡2 P Pod ¡1
x = 2 x = 1 x = 2 x = 1 Time
e x e c u t e d executed
RACE
e x e c u t e d crash
RACE ¡CAUSES ¡ CRASH
d e a d l
k executed
RACE ¡CAUSES ¡ DEADLOCK
Dynamic ¡Race ¡Valida,on
14
Hive
P Pod ¡2 P Pod ¡1
x = 2 x = 1 x = 2 x = 1 Time
e x e c u t e d executed
RACE
e x e c u t e d not ¡executed
LIKELY ¡FP
e x e c u t e d crash
RACE ¡CAUSES ¡ CRASH
d e a d l
k executed
RACE ¡CAUSES ¡ DEADLOCK
Dynamic ¡Race ¡Valida,on
14
Hive
P Pod ¡2 P Pod ¡1
x = 2 x = 1 x = 2 x = 1 Time
e x e c u t e d executed
RACE
e x e c u t e d not ¡executed
LIKELY ¡FP
n
¡ e x e c u t e d not ¡executed
NOT ¡ EXECUTED
e x e c u t e d crash
RACE ¡CAUSES ¡ CRASH
d e a d l
k executed
RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
88 122 RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
88 122 ¡ ¡0 ¡ ¡ ¡1 RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
88 122 ¡ ¡4 ¡ ¡ ¡0 ¡ ¡0 ¡ ¡ ¡1 RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
88 122 ¡ ¡4 ¡ ¡ ¡0 ¡ ¡0 ¡ ¡ ¡3 ¡ ¡0 ¡ ¡ ¡1 RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
88 122 ¡ ¡4 ¡ ¡ ¡0 ¡ ¡0 ¡ ¡ ¡3 ¡ ¡0 ¡ ¡ ¡1 ¡ ¡37 ¡ ¡ ¡63 RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
88 122 ¡ ¡4 ¡ ¡ ¡0 ¡ ¡0 ¡ ¡ ¡3 ¡ ¡0 ¡ ¡ ¡1 ¡ ¡37 ¡ ¡ ¡63 ¡48 ¡ ¡ ¡54 RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
SQLite Pbzip2
88 122 ¡ ¡4 ¡ ¡ ¡0 ¡ ¡0 ¡ ¡ ¡3 ¡ ¡0 ¡ ¡ ¡1 ¡ ¡37 ¡ ¡ ¡63 ¡48 ¡ ¡ ¡54 0.99% 0.91% RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
Detec,on ¡Results ¡and ¡Efficiency
15
TOTAL RUNTIME ¡ ¡ OVERHEAD
Effec,ve ¡and ¡low ¡overhead
SQLite Pbzip2
88 122 ¡ ¡4 ¡ ¡ ¡0 ¡ ¡0 ¡ ¡ ¡3 ¡ ¡0 ¡ ¡ ¡1 ¡ ¡37 ¡ ¡ ¡63 ¡48 ¡ ¡ ¡54 0.99% 0.91% RACE LIKELY ¡FP NOT ¡ EXECUTED RACE ¡CAUSES ¡ CRASH RACE ¡CAUSES ¡ DEADLOCK
CoRD ThreadSani,zer
Comparison ¡to ¡Other ¡Detectors
16
0.99% 0.91% 972% 3,001%
SQLite Pbzip2
CoRD ThreadSani,zer
Comparison ¡to ¡Other ¡Detectors
16
0.99% 0.91% 972% 3,001%
SQLite Pbzip2
don’t ¡provide ¡any ¡classifica,on
Summary
17
Roadmap
18