Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bugaboo at MICRO 2009

Bugaboo at MICRO 2009

A talk I gave at MICRO 2009 on Bugaboo, a new technique and computer architecture design for debugging concurrent programs.

Brandon Lucia

May 28, 2012
Tweet

More Decks by Brandon Lucia

Other Decks in Research

Transcript

  1. Bugaboo: Finding Concurrency Bugs With Context-Aware Communication Graphs Brandon Lucia,

    Luis Ceze University of Washington SAfe Multi-Processor Architecture Lab Monday, May 28, 2012
  2. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Concurrency Bugs Make Bad Things Happen 2 *http://www.availabilitydigest.com/private/0203/northeast_blackout.pdf Monday, May 28, 2012
  3. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Concurrency Bugs Make Bad Things Happen 2 *http://www.availabilitydigest.com/private/0203/northeast_blackout.pdf Monday, May 28, 2012
  4. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Concurrency Bugs Make Bad Things Happen • Concurrency bugs manifest under certain instruction interleavings • Interleavings happen nondeterministically • We need good tools to help find concurrency bugs 2 *http://www.availabilitydigest.com/private/0203/northeast_blackout.pdf Monday, May 28, 2012
  5. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    From Interleavings To Communication 3 blkOut = 0 while (blkOut) blkOut = 1 Interleaving Monday, May 28, 2012
  6. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    From Interleavings To Communication 3 blkOut = 0 while (blkOut) blkOut = 1 Interleaving Monday, May 28, 2012
  7. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    From Interleavings To Communication 3 blkOut = 0 while (blkOut) blkOut = 1 Interleaving Communication (via blkOut) Monday, May 28, 2012
  8. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Finding Bugs with Communication Graphs 4 blkOut = 0 while (blkOut) blkOut = 1 Monday, May 28, 2012
  9. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Finding Bugs with Communication Graphs 4 blkOut = 0 while (blkOut) blkOut = 1 Monday, May 28, 2012
  10. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Finding Bugs with Communication Graphs 5 blkOut = 0 while (blkOut) blkOut = 1 Monday, May 28, 2012
  11. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Finding Bugs with Communication Graphs 5 blkOut = 0 while (blkOut) blkOut = 1 Monday, May 28, 2012
  12. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Finding Bugs with Communication Graphs 5 blkOut = 0 while (blkOut) blkOut = 1 Monday, May 28, 2012
  13. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Debugging With Communication Graphs From 10,000’ 1.Collect communication graphs, and label them as Buggy or Correct 6 Monday, May 28, 2012
  14. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Debugging With Communication Graphs From 10,000’ 1.Collect communication graphs, and label them as Buggy or Correct 2. Identify edges in Buggy graphs, but not in Correct graphs 6 Monday, May 28, 2012
  15. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Debugging With Communication Graphs From 10,000’ 1.Collect communication graphs, and label them as Buggy or Correct blkOut = 0 while (blkOut) 2. Identify edges in Buggy graphs, but not in Correct graphs 3. Inspect code involved in Buggy- only edges 6 Monday, May 28, 2012
  16. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    System Design Requirements 7 Text Graphs Must Encode Enough Information to Identify Buggy Communication Graph Collection Must be Cheap Debugging Must Be Simple Debug Monday, May 28, 2012
  17. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Making Useful Communication Graphs 8 Monday, May 28, 2012
  18. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    A More Interesting Example 9 str = getStr(); len = getLen(); int l = len; string s = str; Monday, May 28, 2012
  19. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    A More Interesting Example 9 str = getStr(); len = getLen(); int l = len; string s = str; Multi-Variable Atomicity Violation can result in reads of inconsistent str and len Monday, May 28, 2012
  20. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Communication Alone Is Insufficient 10 str = getStr(); len = getLen(); Monday, May 28, 2012
  21. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Communication Alone Is Insufficient 10 str = getStr(); len = getLen(); ✗ ✓ Monday, May 28, 2012
  22. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Communication Alone Is Insufficient 10 str = getStr(); len = getLen(); There is no edge in the Buggy graph that isn’t in the Correct graph! ✗ ✓ Monday, May 28, 2012
  23. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    ✓ Adding Context to Graphs 11 ✗ Monday, May 28, 2012
  24. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    ✓ Adding Context to Graphs 11 These writes should not be interleaved... ✗ Monday, May 28, 2012
  25. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    ✓ Adding Context to Graphs 11 These writes should not be interleaved... ...so these instructions should be ordered before, or after both writes ✗ Monday, May 28, 2012
  26. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    ✓ Adding Context to Graphs 11 These writes should not be interleaved... ...so these instructions should be ordered before, or after both writes ✗ Monday, May 28, 2012
  27. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Communication graphs do not encode relative ordering of communications ✓ Adding Context to Graphs 11 These writes should not be interleaved... ...so these instructions should be ordered before, or after both writes ✗ Monday, May 28, 2012
  28. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Communication graphs do not encode relative ordering of communications ✓ Adding Context to Graphs 11 These writes should not be interleaved... ...so these instructions should be ordered before, or after both writes Communication Context is a short history of preceding communication events added to each node ✗ Monday, May 28, 2012
  29. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Communication graphs do not encode relative ordering of communications ✓ Adding Context to Graphs 11 These writes should not be interleaved... ...so these instructions should be ordered before, or after both writes Communication Context is a short history of preceding communication events added to each node Context encodes ordering amongst communication events, enabling more general bug detection ✗ Monday, May 28, 2012
  30. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Monday, May 28, 2012
  31. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Monday, May 28, 2012
  32. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Monday, May 28, 2012
  33. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); { Context Monday, May 28, 2012
  34. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Monday, May 28, 2012
  35. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); { N ode Monday, May 28, 2012
  36. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Monday, May 28, 2012
  37. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Rem Wr Monday, May 28, 2012
  38. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Rem Wr Rem Wr Loc Rd Monday, May 28, 2012
  39. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    int l = len; string s = str; Context-Aware Communication Graphs 12 str = getStr(); len = getLen(); Loc Wr Rem Rd Rem Rd Rem Wr Rem Wr Loc Rd Monday, May 28, 2012
  40. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    13 Loc Wr Rem Rd Rem Rd Rem Wr Rem Wr Loc Rd Loc Wr Loc Wr Rem Rd Rem Rd Rem Wr Rem Wr Loc Rd Loc Rd Rem Wr Rem Wr Rem Rd Rem Rd ✗ ✓ Context-Aware Communication Graphs ✓ Monday, May 28, 2012
  41. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    13 Loc Wr Rem Rd Rem Rd Rem Wr Rem Wr Loc Rd Loc Wr Loc Wr Rem Rd Rem Rd Rem Wr Rem Wr Loc Rd Loc Rd Rem Wr Rem Wr Rem Rd Rem Rd This edge is unique to the buggy context-aware graph ✗ ✓ Context-Aware Communication Graphs ✓ Monday, May 28, 2012
  42. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Making Graph Collection Efficient with Architectural Support 14 Monday, May 28, 2012
  43. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support 15 Processor Cache Monday, May 28, 2012
  44. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support 15 Processor Context Register Cache { 2-bit communication event code Monday, May 28, 2012
  45. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support 15 Processor Context Register Cache { 2-bit communication event code Old New Shift Monday, May 28, 2012
  46. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support 15 Processor Context Register Cache { 2-bit communication event code Old New Shift Monday, May 28, 2012
  47. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support 15 Processor Context Register Cache Context of last write Inst. Addr. of last writer Context of last write Inst. Addr. of last writer Cache-line meta-data { 2-bit communication event code Old New Shift Monday, May 28, 2012
  48. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support 15 Processor Context Register Cache Context of last write Inst. Addr. of last writer Cache-line meta-data { 2-bit communication event code Old New Shift Monday, May 28, 2012
  49. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 16 Communication Table Software Runtime Monday, May 28, 2012
  50. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N •As communication is observed, it is recorded in the Communication Table •Organized as a queue with entries holding source and destination PC and Context 16 Communication Table Software Runtime Monday, May 28, 2012
  51. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 16 Communication Table Software Runtime Monday, May 28, 2012
  52. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    •When the communication table fills, the system traps to a software runtime to preserve the contents of the communication table to memory or disk Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 16 Communication Table Software Runtime Monday, May 28, 2012
  53. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    •When the communication table fills, the system traps to a software runtime to preserve the contents of the communication table to memory or disk Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 16 Communication Table Software Runtime Monday, May 28, 2012
  54. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); 17 Processor 1 Processor 2 Monday, May 28, 2012
  55. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support •Cache coherence events map to context events, populating per-CPU context register •Write instructions record their address and context in cache-line meta-data $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); 17 Processor 1 Processor 2 Monday, May 28, 2012
  56. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); 17 Processor 1 Processor 2 Monday, May 28, 2012
  57. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context 17 Processor 1 Processor 2 Monday, May 28, 2012
  58. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context 17 Processor 1 Processor 2 Monday, May 28, 2012
  59. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); INV 0xA Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context 17 Processor 1 Processor 2 Monday, May 28, 2012
  60. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr 0xA Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context 17 Processor 1 Processor 2 Monday, May 28, 2012
  61. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr 0xA Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null 17 Processor 1 Processor 2 Monday, May 28, 2012
  62. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr 0xA Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null 17 Processor 1 Processor 2 Monday, May 28, 2012
  63. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr 0xA Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null 17 Processor 1 Processor 2 Monday, May 28, 2012
  64. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr INV 0xA 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null 17 Processor 1 Processor 2 Monday, May 28, 2012
  65. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null 17 Processor 1 Processor 2 Monday, May 28, 2012
  66. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  67. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  68. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  69. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rd Req Rem Wr Loc Wr 0xA 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  70. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Rem Rd Loc Rd Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  71. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Rem Rd Loc Rd Rd Rep Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  72. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Rem Rd Loc Rd 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  73. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Rem Rd Loc Rd 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 0xC 0xB Loc Wr Rem Wr Rem Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  74. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Architectural Support $ Processor 1 $ Processor 2 $ Processor N-1 $ Processor N 0xC: int l = len; 0xD: string s = str; 0xA: str = getStr(); 0xB: len = getLen(); Rem Wr Loc Wr Rem Wr Loc Wr 0xA 0xB Loc Wr Rem Rd Loc Rd 0xB Loc Wr Communication Table Producer Consumer Inst. Addr Context Inst. Addr Context Null Null 0xA Null Null Null 0xB Loc Wr 0xC 0xB Loc Wr Rem Wr Rem Wr 17 Processor 1 Processor 2 Monday, May 28, 2012
  75. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Making Debugging Easy With Bugaboo 18 Debug Monday, May 28, 2012
  76. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Labeled Graph Debugging 19 Starting with a bug report or buggy behavior... Monday, May 28, 2012
  77. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Labeled Graph Debugging 19 Starting with a bug report or buggy behavior... ...collect graphs from many runs, labeling as buggy or correct ✓ ✗ Monday, May 28, 2012
  78. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Labeled Graph Debugging 19 Starting with a bug report or buggy behavior... ...collect graphs from many runs, labeling as buggy or correct ✓ ✗ Find edges in any buggy graph, and in no correct graph Monday, May 28, 2012
  79. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Labeled Graph Debugging 19 Starting with a bug report or buggy behavior... ...collect graphs from many runs, labeling as buggy or correct ✓ ✗ Find edges in any buggy graph, and in no correct graph Rank the resulting edges, giving high rank to: •Rare communication events •Communication in a rare context Monday, May 28, 2012
  80. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Anomaly-Based Detection 20 The Bugs-As-Anomalies Hypothesis: Programs usually work correctly, hence bugs are anomalies Monday, May 28, 2012
  81. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Anomaly-Based Detection 20 The Bugs-As-Anomalies Hypothesis: Programs usually work correctly, hence bugs are anomalies By looking for anomalies, we are apt to find bugs Monday, May 28, 2012
  82. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Anomaly-Based Detection 20 The Bugs-As-Anomalies Hypothesis: Programs usually work correctly, hence bugs are anomalies By looking for anomalies, we are apt to find bugs Frequency Monday, May 28, 2012
  83. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Anomaly-Based Detection 20 The Bugs-As-Anomalies Hypothesis: Programs usually work correctly, hence bugs are anomalies By looking for anomalies, we are apt to find bugs Likely bugs are low-frequency communication events Frequency Monday, May 28, 2012
  84. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Anomaly-Based Detection 20 The Bugs-As-Anomalies Hypothesis: Programs usually work correctly, hence bugs are anomalies By looking for anomalies, we are apt to find bugs Likely bugs are low-frequency communication events Frequency Fully Automatic Detection - No labeling required! Monday, May 28, 2012
  85. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Experimental Setup and Results • SESC-based cache simulation • Pin-based simulation frontend • Detection Benchmarks: • Synthetic Bugs, Bug Kernels, MySQL, Apache, PBZip2, AGet • Performance Benchmarks: • Parsec, MySQL, Apache, PBZip2, AGet 21 Monday, May 28, 2012
  86. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Bug Detection Capability 22 0 2 4 6 8 10 BankAcct C ircularList Log & Sweep M ulti-O rder M oz-jsStr M oz-jsInterp M oz-m acN etIO M oz-TxtFram e M ySQ L-ID Init M ySQ L-BinLog Apache-LogSz PBZip2-O rder AG et-M ultVa Labeled Graph Debugging Anomaly-Based Detection 34.0 19.2 12.0 80.2 14.5 Avg. # Inspection Required To Find A Known Bug Full Applications Bug Kernels Synthetic Bugs Monday, May 28, 2012
  87. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Performance Overheads - Graph Collection 23 0 1 2 3 4 5 blackscholes dedup fluidanim ate sw aptions x264 PBZip2 M ySQ L % Memory Operations with Overhead Meta-Data Writes Comm. Tab. Writes Monday, May 28, 2012
  88. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Performance Overheads - Communication Table Traps 24 0 5 10 15 20 blackscholes dedup fluidanim ate sw aptions x264 PBZip2 M ySQ L Traps per 10M Memory Operations Monday, May 28, 2012
  89. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Conclusions Bugaboo: General concurrency bug detection Context-Aware communication graphs make general detection possible Architectural support makes graph collection efficient Our results show that Bugaboo efficiently guides developers to concurrency bugs 25 Debug Monday, May 28, 2012
  90. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Lots More in our Paper! • Post-deployment uses • A software-only implementation • Debugging case study • Detailed graph characterization • Sensitivity analysis of detection and collection 26 Monday, May 28, 2012
  91. Bugaboo: Finding Concurrency Bugs With Context-Aware Communication Graphs Brandon Lucia,

    Luis Ceze University of Washington Safe Multi-Processor Architecture Lab Monday, May 28, 2012
  92. Bugaboo: Detecting Concurrency Bugs With Context-Aware Communication Graphs - Lucia,Ceze

    Imprecision of Cache- based Tracking 31 Monday, May 28, 2012