racemob crowdsourced data race detec on
play

RaceMob: Crowdsourced Data Race Detec,on Baris Kasikci, - PowerPoint PPT Presentation

RaceMob: Crowdsourced Data Race Detec,on Baris Kasikci, Cris,an Zamfir, and George Candea School of Computer & Communica3on Sciences Tuesday 12 November 13 Data Races


  1. RaceMob: ¡Crowdsourced ¡ Data ¡Race ¡Detec,on Baris ¡Kasikci, ¡Cris,an ¡Zamfir, ¡and ¡George ¡Candea School ¡of ¡Computer ¡& ¡Communica3on ¡Sciences Tuesday 12 November 13

  2. Data ¡Races • Accesses ¡to ¡shared ¡memory ¡loca,on shared x • By ¡mul3ple ¡threads Thread ¡2 Thread ¡1 • At ¡least ¡one ¡of ¡the ¡accesses ¡is ¡a ¡write x = 2 x = 1 • Synchroniza3on ¡opera3ons ¡do ¡not ¡enforce ¡an ¡ order ¡among ¡the ¡accesses 2 Tuesday 12 November 13

  3. Spectrum ¡of ¡Data ¡Races Kept ¡for ¡ ??? Caused ¡massive ¡ performance losses 2003 ¡Blackout 3 Tuesday 12 November 13

  4. PiLalls • Programs ¡with ¡data ¡races ¡are ¡incorrect ¡ according ¡to ¡POSIX ¡& ¡C/C++ ¡standards • Compilers ¡can ¡break ¡correctness ¡of ¡ programs ¡with ¡data ¡races ¡[HotPar’11] • Harmless ¡data ¡races ¡can ¡become ¡harmful Developers ¡need ¡to ¡know ¡every ¡true ¡data ¡race 4 Tuesday 12 November 13

  5. × × × × How ¡to ¡Find ¡All ¡Data ¡Races? ¡ • Dynamic ¡race ¡detectors ¡ • Sta,c ¡race ¡detectors • Per-­‑run ¡analysis • Full ¡path ¡analysis ✔ • Expensive ¡ ( ≤ ¡ 200x) • Cheap ¡ (0 ¡run3me ¡overhead) ✔ • Many ¡false ¡nega5ves • Few ¡false ¡nega5ves ✔ • Few ¡false ¡posi5ves ¡ (~0%) • Many ¡false ¡posi5ves ¡(~80%) ✔ Exis,ng ¡detectors ¡are ¡not ¡prac,cal 5 Tuesday 12 November 13

  6. How ¡to ¡Find ¡All ¡Data ¡Races? ¡ • Full ¡path ¡analysis ✔ • Cheap ¡ (0 ¡run3me ¡overhead) ✔ • Few ¡false ¡nega5ves ✔ • Few ¡false ¡posi5ves ¡ (~0%) ✔ 6 Tuesday 12 November 13

  7. • Full ¡path ¡analysis ✔ RaceMob • Cheap ¡ (0 ¡run3me ¡overhead) ✔ • Few ¡false ¡nega2ves ✔ • Few ¡false ¡posi2ves ¡ (~0%) ✔ Dynamic ¡ Sta,c ¡ On-­‑demand Context ¡ All Poten5ally Detec,on Valida,on Likely Inference Memory True Racing Racing Races Accesses Accesses Accesses Crowdsourcing Race ¡& Hang X Race ¡& Crash X X 7 Tuesday 12 November 13

  8. Issues Usage ¡Model program Users ¡run ¡ instrumented programs Applica,on ¡Home (e.g., ¡AppStore) RaceMob 8 Tuesday 12 November 13

  9. Insights • Use ¡sta,c ¡race ¡detec,on ¡to ¡prune ¡memory ¡ accesses ¡that ¡need ¡not ¡be ¡monitored • Cost ¡of ¡dynamic ¡detec,on ¡can ¡be ¡ amor,zed ¡across ¡many ¡users • Using ¡the ¡crowd, ¡we ¡can ¡detect ¡races ¡that ¡ ”majer” 9 Tuesday 12 November 13

  10. RaceMob Dynamic ¡ Sta,c ¡ On-­‑demand Context ¡ All Detec,on Poten5ally Valida,on Inference Likely True Memory Racing Racing Races Accesses Accesses Accesses Crowdsourcing Race ¡& Hang X Detected ¡106 ¡real ¡ races ¡in ¡10 ¡ Race ¡& Crash X programs ¡with ¡2.3% ¡ X average ¡overhead 10 Tuesday 12 November 13

  11. Sta,c ¡Data ¡Race ¡Detec,on • We ¡use ¡RELAY ¡[FSE’07] • Analyzes ¡en3re ¡program ¡paths ¡at ¡once • Computes ¡& ¡composes ¡per-­‑func3on ¡summaries ¡to ¡scale • Tracks ¡locks Example Thread ¡1 Thread ¡2 LS 1 = {} x = 1 lock(l) lock(l) ... ... unlock(l) unlock(l) x = 2 LS 2 = {} x ¡= ¡1 ¡and ¡x ¡= ¡2 ¡are ¡poten,ally ¡racing 11 Tuesday 12 November 13

  12. RaceMob Dynamic ¡ Sta,c ¡ On-­‑demand Context ¡ All Detec,on Poten5ally Valida,on Inference Likely True Memory Racing Racing Races Accesses Accesses Accesses Crowdsourcing Race ¡& Hang X Race ¡& Crash X X 12 Tuesday 12 November 13

  13. Dynamic ¡Context ¡Inference ¡(DCI) • Inaccuracy ¡in ¡sta,c ¡data ¡race ¡detec,on • Pointer ¡alias ¡analysis ¡errors • Inability ¡to ¡infer ¡mul3threaded ¡program ¡context • DCI ¡checks ¡at ¡run,me: } • If ¡accesses ¡are ¡from ¡different ¡threads If ¡yes, ¡accesses ¡ • If ¡accesses ¡alias are ¡likely ¡racing Dynamic ¡context ¡inference ¡reduced ¡ the ¡set ¡of ¡accesses ¡to ¡monitor ¡by ¡53% 13 Tuesday 12 November 13

  14. DCI ¡Example Alice Thread ¡2 Thread ¡1 Address ¡= ¡0xBEEF x = 1 ThreadID ¡= ¡1 lock(l) ... unlock(l) lock(l) ... unlock(l) Address ¡= ¡0xBEEF x = 2 ThreadID ¡= ¡2 Proceed ¡to ¡on-­‑demand ¡data ¡race ¡valida,on 14 Tuesday 12 November 13

  15. RaceMob Dynamic ¡ Sta,c ¡ On-­‑demand Context ¡ All Detec,on Poten5ally Valida,on Likely Inference True Memory Racing Racing Races Accesses Accesses Accesses Crowdsourcing Race ¡& Hang X Race ¡& Crash X X 15 Tuesday 12 November 13

  16. On-­‑demand ¡Data ¡Race ¡Valida,on • Happens-­‑before ¡based Thread ¡1 Thread ¡2 x=1 • Track ¡synchroniza3on unlock(l) • Few ¡false ¡posi3ves lock(l) • Minimal ¡tracking x=2 • Only ¡memory ¡accesses ¡of ¡the ¡target ¡data ¡race • Synchroniza3on ¡in ¡between ¡these ¡accesses • Un,l ¡enough ¡happens-­‑before ¡edges ¡form • Steers ¡thread ¡schedule ¡to ¡expose ¡races 16 Tuesday 12 November 13

  17. On-­‑demand ¡Valida,on ¡Example Alice Bob Thread ¡1 Thread ¡2 Thread ¡2 Thread ¡1 x = 1 x = 1 lock(l) lock(l) ... ... unlock(l) HB unlock(l) No HB x = 2 x = 1 lock(l) ... lock(l) unlock(l) ... x = 2 unlock(l) No ¡Race Race 17 Tuesday 12 November 13

  18. Detec,on ¡Results RACE RACE & CRASH RACE & HANG NO RACE NOT ALIASING NOT MULTITHREADED NOT SEEN Applica,on ¡Home (AppStore, ¡Play) program RaceMob 18 Tuesday 12 November 13

  19. RaceMob Dynamic ¡ Sta,c ¡ On-­‑demand Context ¡ All Detec,on Poten5ally Valida,on Likely Inference True Memory Racing Racing Races Accesses Accesses Accesses Crowdsourcing Race ¡& Hang X Race ¡& Crash X X 19 Tuesday 12 November 13

  20. Evalua,on memcached Pbzip2 pfscan SPLASH-2 • Detec,on ¡effec,veness • Contribu,on ¡of ¡techniques ¡to ¡reducing ¡overhead • Breakdown ¡of ¡overhead • Comparison ¡to ¡other ¡detectors • Comparison ¡to ¡concurrency ¡tes,ng ¡tools • Scalability ¡analysis 20 Tuesday 12 November 13

  21. Evalua,on memcached Pbzip2 pfscan SPLASH-2 • Detec,on ¡effec,veness • Contribu,on ¡of ¡techniques ¡to ¡reducing ¡overhead • Breakdown ¡of ¡overhead • Comparison ¡to ¡other ¡detectors • Comparison ¡to ¡concurrency ¡tes,ng ¡tools • Scalability ¡analysis 21 Tuesday 12 November 13

  22. Detec,on ¡Effec,veness 841 106 ¡true ¡ 267 data ¡races 212 172 100 84 3 3 n h e g d g l e e a s c n e n c a e t a a d i a o r s s R H a R C T a ¡ t e ¡ ¡ ¡ i o o & & l r A N N h ¡ ¡ e ¡ e t t c , o c a a N l u R R M ¡ RaceMob ¡detected ¡and ¡confirmed ¡106 ¡data ¡races t o N 22 Tuesday 12 November 13

  23. How ¡Does ¡Each ¡Technique ¡ Lower ¡the ¡Overhead ¡? Dynamic ¡detec,on Sta,c ¡+ ¡dynamic ¡detec,on RaceMob ¡(sta,c ¡+ ¡dynamic ¡+ ¡DCI ¡+on-­‑demand ¡valida,on) ¡aggregate RaceMob ¡per-­‑user 30 x 30 x Detec,on ¡,me/ ¡Na,ve ¡execu,on ¡,me 30 26.1 x 23 16 8 6.3 x 5.4 x 3.6 x 1.03 x 1.01 x 1 Ocean ¡(CPU-­‑bound) Pbzip2 ¡(I/O-­‑bound) All ¡techniques ¡are ¡required ¡for ¡low ¡overhead 23 Tuesday 12 November 13

  24. Breakdown ¡of ¡overhead 5.00 % Instrumenta,on Valida,on Run,me ¡overhead ¡vs. ¡na,ve ¡execu,on 3.75 % 2.50 % 1.25 % 1.00 % 0 Apache SQLite Memcached Fmm Barnes Ocean Pbzip2 Knot Aget Pfscan 2.3% ¡average ¡run,me ¡overhead ¡per-­‑user 24 Tuesday 12 November 13

  25. RaceMob Dynamic ¡ Sta,c ¡ On-­‑demand Context ¡ All Detec,on Poten5ally Valida,on Likely Inference True Memory Racing Racing Races Accesses Accesses Accesses Crowdsourcing Race ¡& Hang X Detected ¡106 ¡real ¡ races ¡in ¡10 ¡ Race ¡& Crash X programs ¡with ¡2.3% ¡ X average ¡overhead 25 Tuesday 12 November 13

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend