lockout efficient tes0ng for deadlock bugs
play

Lockout: Efficient Tes0ng for Deadlock Bugs Ali - PowerPoint PPT Presentation

Lockout: Efficient Tes0ng for Deadlock Bugs Ali Kheradmand, Baris Kasikci, George Candea 1 Deadlock Set of threads Each holding a lock


  1. Lockout: ¡Efficient ¡Tes0ng ¡for ¡Deadlock ¡Bugs ¡ ¡ ¡ Ali ¡Kheradmand, ¡Baris ¡Kasikci, ¡George ¡Candea ¡ ¡ 1 ¡

  2. Deadlock ¡ • Set ¡of ¡threads ¡ ¡ • Each ¡holding ¡a ¡lock ¡needed ¡by ¡another ¡thread ¡ • Wai?ng ¡for ¡another ¡lock ¡to ¡be ¡released ¡by ¡some ¡ other ¡thread ¡ ¡ 2 ¡

  3. Why ¡Do ¡Deadlocks ¡MaBer? ¡ • Common ¡in ¡modern ¡soDware ¡ • Hard ¡to ¡detect ¡manually ¡ • Occur ¡rarely ¡during ¡execu?on ¡ Chrome ¡ Apache ¡ LimeWire ¡ Eclipse ¡ 3 ¡

  4. Deadlock ¡Detec?on ¡ • Tradi?onal ¡tes?ng ¡ – Deadlocks ¡manifest ¡rarely ¡ ✗ ¡ • Sta?c ¡detec?on ¡ – Fast ¡(run ¡offline) ¡ ✓ ¡ – Few ¡false ¡nega?ves ¡ ✓ ¡ – Many ¡false ¡posi?ves ¡ ✗ ¡ • Dynamic ¡detec?on ¡ – Slow ¡(high ¡run?me ¡overhead) ¡ ✗ ¡ – Many ¡false ¡nega?ves ¡ ✗ ¡ – Few ¡false ¡posi?ves ¡ ✓ ¡ ¡ 4 ¡

  5. Best ¡of ¡Two ¡Worlds ¡ • Normal ¡tests ¡can’t ¡discover ¡enough ¡deadlocks ¡ • Deadlock ¡avoidance ¡or ¡fixing ¡tools ¡tools ¡ (Dimmunix ¡[OSDI’08]) ¡take ¡a ¡long ¡?me ¡ • Need ¡to ¡find ¡the ¡schedules ¡that ¡lead ¡to ¡a ¡deadlock ¡ • How ¡to ¡increase ¡the ¡probability ¡of ¡ encountering ¡a ¡deadlock? ¡ Steer ¡the ¡program ¡towards ¡schedules ¡that ¡ ¡ are ¡likely ¡to ¡cause ¡a ¡deadlock ¡ 5 ¡

  6. Lockout ¡ • Systema?c ¡deadlock ¡tes?ng ¡ • Increases ¡deadlock ¡probability ¡ • By ¡steering ¡the ¡scheduling ¡ • Leverages ¡past ¡program ¡execu?ons ¡ Trigger ¡more ¡deadlocks ¡with ¡the ¡same ¡test ¡suite ¡ 6 ¡

  7. Outline ¡ • Lockout ¡architecture ¡ • Deadlock ¡triggering ¡algorithm ¡ • Preliminary ¡results ¡ • Summary ¡and ¡future ¡work ¡ 7 ¡

  8. Lockout ¡Architecture ¡ Sta?c ¡Phase ¡ Source ¡ Instrumented ¡ Code ¡ Binary ¡ Sta?c ¡ 0100100 1010101 Analysis ¡ Instrumenta?on ¡ cout << “Hello, 0101010 World!\n”; � 0100110 ¡ 1010101 � RaceMob ¡ [SOSP’13] ¡ 8 ¡

  9. Lockout ¡Architecture ¡ Dynamic ¡Phase ¡ End ¡of ¡execu?on ¡ Events ¡ Instrumented ¡ Run?me ¡ Previous ¡execu?ons ¡info ¡ Program ¡ Schedule ¡ perturba?on ¡ Subsequent ¡execu?ons ¡ DeadlockFuzzer ¡ [PLDI’09] ¡ 9 ¡

  10. Outline ¡ • Lockout ¡architecture ¡ • Deadlock ¡triggering ¡algorithm ¡ • Preliminary ¡results ¡ • Summary ¡and ¡future ¡work ¡ 10 ¡

  11. Run?me ¡Lock ¡Order ¡Graph ¡(RLG) ¡ Thread ¡1 ¡ b lock ¡ lock(a) � … � lock(b) � a c … � lock(c) � Lock ¡ ¡ � acquisi?on ¡order ¡ Poten?al ¡deadlock ¡ 11 ¡

  12. Deadlock ¡Triggering ¡ • Selects ¡a ¡directed ¡cycle ¡in ¡RLG ¡ • Delays ¡threads ¡accordingly ¡ • Improves ¡simple ¡preemp?on ¡(CHESS ¡[OSDI’08]) ¡ • Preemp?on ¡before ¡each ¡lock ¡ ¡ lock(a) � d a � � lock(b) � c b � � 12 ¡

  13. Deadlock ¡Triggering ¡ Time ¡ Thread ¡1 ¡ Thread ¡2 ¡ Thread ¡3 ¡ lock(a) � � � lock(b) � � � a … � � � unlock(b) � � � Run?me ¡ unlock(a) � � � c b � lock(b) � � lock(c) � � … � � unlock(c) � � unlock(b) � � � lock(c) � lock(a) � … � unlock(a) � unlock(c) � 13 ¡ �

  14. Deadlock ¡Triggering ¡ Time ¡ Thread ¡1 ¡ Thread ¡2 ¡ Thread ¡3 ¡ Before lock (a) � RT() � � � Continue � Before lock (b) � lock(a) � � � Run?me ¡ RT() � � � Before lock (c) � Delay � � � RT() � Before lock (a) � Continue � � � lock(c) � � ) Before lock (c) � b ( k c o l e r o f e B � � RT() � Delay � Continue � � RT() � � � y a l e � lock(b) � � D � RT() � � a � � � lock(b) � � � � � � c b � � � lock(a) � lock(c) � � 14 ¡ �

  15. Race ¡Dependent ¡Deadlocks ¡ • Preempt ¡before ¡memory ¡accesses ¡ • Ideally ¡only ¡shared ¡memory ¡accesses ¡ • Can ¡be ¡approximated ¡by ¡preemp?ng ¡aDer ¡ locks ¡ • Can ¡be ¡improved ¡using ¡sta?c ¡analysis ¡ • Can ¡be ¡improved ¡using ¡data ¡race ¡detec?on ¡ 15 ¡

  16. Outline ¡ • Lockout ¡architecture ¡ • Deadlock ¡triggering ¡algorithm ¡ • Preliminary ¡results ¡ • Summary ¡and ¡future ¡work ¡ 16 ¡

  17. Lockout ¡Effec?veness ¡ Program ¡ Frac0on ¡of ¡execu0ons ¡resul0ng ¡in ¡deadlock ¡(%) ¡ Na0ve ¡ Simple ¡ Deadlock ¡ Deadlock ¡ preemp0on ¡ triggering ¡ triggering ¡ + ¡ + ¡ ¡ + ¡ Post-­‑lock ¡ Pre-­‑memory ¡ Post-­‑lock ¡ preemp0on ¡ access ¡ preemp0on ¡ preemp0on ¡ Microbench ¡ 0.00066 ¡% ¡ 0.5 ¡% ¡ 50 ¡% ¡ 50 ¡% ¡ SQLite ¡3.3.0 ¡ 0.00064 ¡% ¡ 4 ¡% ¡ 50 ¡% ¡ 50 ¡% ¡ HawkNL ¡1.6b3 ¡ 23 ¡% ¡ 64 ¡% ¡ 50 ¡% ¡ 50 ¡% ¡ Pbzip2 ¡1.1.6 ¡ 0 ¡% ¡ 0 ¡% ¡ 0 ¡% ¡ 0 ¡% ¡ HBpd ¡2.0.65 ¡ 0 ¡% ¡ ¡ 0 ¡% ¡ 0 ¡% ¡ 0 ¡% ¡ Frac?on ¡of ¡execu?ons ¡with ¡deadlocks ¡ increased ¡up ¡to ¡three ¡orders ¡of ¡magnitude ¡ 17 ¡

  18. Outline ¡ • Lockout ¡architecture ¡ • Deadlock ¡triggering ¡algorithm ¡ • Preliminary ¡results ¡ • Summary ¡and ¡future ¡work ¡ 18 ¡

  19. Lockout ¡ • Increases ¡deadlock ¡probability ¡ • Leverages ¡past ¡program ¡execu?ons ¡ • Effec?ve ¡ • Up ¡to ¡3 ¡orders ¡of ¡magnitude ¡more ¡deadlock ¡prone ¡ • Open ¡source: ¡ ¡ • hKps://github.com/dslab-­‑epfl/lockout ¡ ¡ 19 ¡

  20. Future ¡Work ¡ • Increasing ¡effec?veness ¡with ¡low ¡overhead ¡ • Sta?c ¡analysis ¡(data ¡races, ¡shared ¡variables) ¡ • Lockout ¡+ ¡Automa?c ¡failure ¡fixing/avoidance ¡ (Dimmunix ¡[OSDI’08], ¡CFix ¡[OSDI’12], ¡Aviso ¡ [ASPLOS’13]) ¡ • In ¡produc?on ¡ • For ¡tes?ng ¡ • Crowdsourcing ¡(Aviso ¡[ASPLOS’13], ¡RaceMob ¡ [SOSP’13]) ¡ ¡ 20 ¡

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