resource aware program analysis via online abstraction
play

Resource-aware Program Analysis via Online Abstraction Coarsening - PowerPoint PPT Presentation

Resource-aware Program Analysis via Online Abstraction Coarsening Kihong Heo Hakjoo Oh Hongseok Yang ICSE 2019 1 Motivation Deep semantic analysis for large software 30M 25M 20M Size (LOC) 15M 10M 5M 0M 1.0 2.0 2.6.16


  1. Resource-aware Program Analysis via Online Abstraction Coarsening Kihong Heo Hakjoo Oh Hongseok Yang ICSE 2019 � 1

  2. Motivation • Deep semantic analysis for large software 30M 25M 20M Size (LOC) 15M 10M 5M 0M 1.0 2.0 2.6.16 
 2.6.34 
 3.10 
 4.1 
 4.19 
 X (1st LTS) (5th LTS) (10th LTS) (15th LTS) (19th LTS) Linux Kernel Version *https://www.linuxcounter.net � 2

  3. Motivation • Deep semantic analysis for large software 30M 25M 20M Size (LOC) 15M 10M 5M 0M 1.0 2.0 2.6.16 
 2.6.34 
 3.10 
 4.1 
 4.19 
 X (1st LTS) (5th LTS) (10th LTS) (15th LTS) (19th LTS) Linux Kernel Version *https://www.linuxcounter.net � 2

  4. Motivation • Deep semantic analysis for large software ! 30M 25M 20M Size (LOC) 15M 10M 5M 0M 1.0 2.0 2.6.16 
 2.6.34 
 3.10 
 4.1 
 4.19 
 X (1st LTS) (5th LTS) (10th LTS) (15th LTS) (19th LTS) Linux Kernel Version *https://www.linuxcounter.net � 2

  5. Goal � 3

  6. Goal • Achieving maximum precision within a given resource budget • e.g., within 128GB of memory � 3

  7. Goal • Achieving maximum precision within a given resource budget • e.g., within 128GB of memory X-sensitivity (knob) � 4

  8. Goal • Achieving maximum precision within a given resource budget • e.g., within 128GB of memory Low Precision Low Utilization X-sensitivity (knob) � 4

  9. Goal • Achieving maximum precision within a given resource budget • e.g., within 128GB of memory Out of Resource X-sensitivity (knob) � 4

  10. Goal • Achieving maximum precision within a given resource budget • e.g., within 128GB of memory Max. Precision Max. Utilization X-sensitivity (knob) � 4

  11. Challenges • Hard to predict the behavior of analyzer in advance • e.g., partially flow-sensitive interval analysis � 5

  12. Challenges • Hard to predict the behavior of analyzer in advance • e.g., partially flow-sensitive interval analysis Sensitivity: 0% emacs-26.0.91 (503KLOC) Memory: 18GB � 5

  13. Challenges • Hard to predict the behavior of analyzer in advance • e.g., partially flow-sensitive interval analysis Sensitivity: 0% Sensitivity: 5% < emacs-26.0.91 emacs-26.0.91 (503KLOC) (503KLOC) Memory: 18GB � 5

  14. Challenges • Hard to predict the behavior of analyzer in advance • e.g., partially flow-sensitive interval analysis Sensitivity: 0% Sensitivity: 5% < emacs-26.0.91 emacs-26.0.91 (503KLOC) (503KLOC) << Memory: Memory: 18GB > 128GB � 5

  15. Challenges • Hard to predict the behavior of analyzer in advance • e.g., partially flow-sensitive interval analysis Sensitivity: 0% Sensitivity: 0% Sensitivity: 5% < < vim60 emacs-26.0.91 emacs-26.0.91 (227KLOC) (503KLOC) (503KLOC) << Memory: Memory: 18GB > 128GB � 5

  16. Challenges • Hard to predict the behavior of analyzer in advance • e.g., partially flow-sensitive interval analysis Sensitivity: 0% Sensitivity: 0% Sensitivity: 5% < < vim60 emacs-26.0.91 emacs-26.0.91 (227KLOC) (503KLOC) (503KLOC) > << Memory: Memory: Memory: 18GB > 128GB 51GB � 5

  17. Our Approach • Online abstraction coarsening by a learned controller Budget Resource Precision Usage Analysis Progress � 6

  18. Our Approach • Online abstraction coarsening by a learned controller Budget Resource Precision Usage Low-sensitivity Analysis Progress � 6

  19. Our Approach • Online abstraction coarsening by a learned controller High-sensitivity Budget Resource Precision Usage Low-sensitivity Analysis Progress � 6

  20. Our Approach • Online abstraction coarsening by a learned controller High-sensitivity Our approach Budget Resource Precision Usage Low-sensitivity Analysis Progress � 6

  21. Our Approach • Online abstraction coarsening by a learned controller High-sensitivity Our approach Budget O ffl ine Approach Online Approach (10% flow-sensitivity) Resource Precision Usage Low-sensitivity Analysis Progress � 7

  22. Our Approach • Online abstraction coarsening by a learned controller High-sensitivity Our approach Budget O ffl ine Approach Online Approach (10% flow-sensitivity) Resource • 3/8 run out of memory (128GB) Precision Usage • 27% of bu ff er overrun alarms � • 30% of null dereference alarms � Low-sensitivity Analysis Progress � 7

  23. Our Approach • Online abstraction coarsening by a learned controller High-sensitivity Our approach Budget O ffl ine Approach Online Approach (10% flow-sensitivity) Resource • 0/8 run out of memory (64 / 128GB) • 3/8 run out of memory (128GB) Precision Usage • 28—32% of bu ff er overrun alarms � • 27% of bu ff er overrun alarms � • 30% of null dereference alarms � • 33—41% of null dereference alarms � Low-sensitivity Analysis Progress � 7

  24. Outline • Motivation • Learning Framework • Experimental Results • Conclusion � 8

  25. Example • Partially flow-sensitive interval analysis (budget: 10 intervals) 1: x = 0; y = 0; z = 1; v = input(); w = input(); 2: x = z; 3: z = z + 1; 4: y = x; 5: assert(y > 0); // Query 1 (hold) 6: assert(z > 0); // Query 2 (hold) 7: assert(v == w); // Query 3 (may fail) � 9

  26. Example • Partially flow-sensitive interval analysis (budget: 10 intervals) 1: x = 0; y = 0; z = 1; v = input(); w = input(); 2: x = z; 3: z = z + 1; 4: y = x; 5: assert(y > 0); // Query 1 (hold) 6: assert(z > 0); // Query 2 (hold) 7: assert(v == w); // Query 3 (may fail) Line Flow-Sensitive Abstract State 1 {x = [0,0], y = [0,0], z = [1,1], v = ⊤ , w = ⊤ } 2 {x = [1,1], y = [0,0], z = [1,1], v = ⊤ , w = ⊤ } 3 Intervals 12 Intervals 3 {x = [1,1], y = [0,0], z = [2,2], v = ⊤ , w = ⊤ } 4 {x = [1,1], y = [1,1], z = [2,2], v = ⊤ , w = ⊤ } � 10

  27. Example • Partially flow-sensitive interval analysis (budget: 10 intervals) 1: x = 0; y = 0; z = 1; v = input(); w = input(); 2: x = z; 3: z = z + 1; 4: y = x; 5: assert(y > 0); // Query 1 (hold) 6: assert(z > 0); // Query 2 (hold) 7: assert(v == w); // Query 3 (may fail) Line Flow-Sensitive Abstract State 1 {x = [0,0], y = [0,0], z = [1,1], v = ⊤ , w = ⊤ } 2 {x = [1,1], y = [0,0], z = [1,1], v = ⊤ , w = ⊤ } 3 {x = [1,1], y = [0,0], z = [2,2], v = ⊤ , w = ⊤ } 6 Intervals 4 {x = [1,1], y = [1,1], z = [2,2], v = ⊤ , w = ⊤ } � 11

  28. Example • Partially flow-sensitive interval analysis (budget: 10 intervals) 1: x = 0; y = 0; z = 1; v = input(); w = input(); 2: x = z; 3: z = z + 1; 4: y = x; 5: assert(y > 0); // Query 1 (hold) 6: assert(z > 0); // Query 2 (hold) 7: assert(v == w); // Query 3 (may fail) Line Flow-Sensitive Abstract State 1 {x = [0,0], y = [0,0], z = [1,1], v = ⊤ , w = ⊤ } 2 {x = [1,1], y = [0,0], z = [1,1], v = ⊤ , w = ⊤ } 3 {x = [1,1], y = [0,0], z = [2,2], v = ⊤ , w = ⊤ } { x = [1,1], y = [1,1], z = [2,2] , v = ⊤ , w = ⊤ } 4 12 Intervals � 12

  29. Example • Partially flow-sensitive interval analysis (budget: 10 intervals) 1: x = 0; y = 0; z = 1; v = input(); w = input(); 2: x = z; 3: z = z + 1; 4: y = x; 5: assert(y > 0); // Query 1 (hold) 6: assert(z > 0); // Query 2 (hold) 7: assert(v == w); // Query 3 (may fail) Line Flow-Insensitive Abstract State { x = [0,+ ∞ ], y = [0,+ ∞ ], z = [1,+ ∞ ] , v = ⊤ , w = ⊤ } * 3 Intervals � 13

  30. Online Abstraction Coarsening � 14

  31. Online Abstraction Coarsening Analyzer Input Result � 14

  32. Online Abstraction Coarsening Analyzer M 0 Transfer Input Result Function � 14

  33. Online Abstraction Coarsening Analyzer M 0 M i Transfer Input Result Fixpoint? Function � 14

  34. Online Abstraction Coarsening Analyzer M 0 M i Y Transfer Input Result Fixpoint? Function � 14

  35. Online Abstraction Coarsening Analyzer M 0 M i Y Transfer Input Result Fixpoint? Function N M i Controller Model � 14

  36. Online Abstraction Coarsening Analyzer M 0 M i Y Transfer Input Result Fixpoint? Function N M i+1 M i Controller Model � 14

  37. Model � 15

  38. Model • Model M : Variable → [0, 1] • Importance of each variable in terms of flow-sensitivity • Pre-trained by an o ff -the-shelf method* *Learning a Strategy for Adapting a Program Analysis via Bayesian Optimisation, OOPSLA’15 � 15

  39. Model • Model M : Variable → [0, 1] • Importance of each variable in terms of flow-sensitivity • Pre-trained by an o ff -the-shelf method* 1: x = 0; y = 0; z = 1; v = input(); w = input(); 2: x = z; 3: z = z + 1; 4: y = x; 5: assert(y > 0); // Query 1 (hold) 6: assert(z > 0); // Query 2 (hold) 7: assert(v == w); // Query 3 (may fail) *Learning a Strategy for Adapting a Program Analysis via Bayesian Optimisation, OOPSLA’15 � 15

  40. Model • Model M : Variable → [0, 1] • Importance of each variable in terms of flow-sensitivity • Pre-trained by an o ff -the-shelf method* 1: x = 0; y = 0; z = 1; v = input(); w = input(); 2: x = z; 3: z = z + 1; 4: y = x; 5: assert(y > 0); // Query 1 (hold) 6: assert(z > 0); // Query 2 (hold) 7: assert(v == w); // Query 3 (may fail) > M(w) *Learning a Strategy for Adapting a Program Analysis via Bayesian Optimisation, OOPSLA’15 � 15

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