from array domains to abstract interpretation under store
play

From Array Domains to Abstract Interpretation Under - PowerPoint PPT Presentation

From Array Domains to Abstract Interpretation Under Store-Buffer-Based Memory Models Thibault Suzanne, Antoine Min Static Analysis: 23rd International Symposium, SAS 2016 September, 2016, Edinburgh, UK Pirmin Schmid Seminar Software


  1. From Array Domains to Abstract Interpretation Under Store-Buffer-Based Memory Models Thibault Suzanne, Antoine Miné Static Analysis: 23rd International Symposium, SAS 2016 September, 2016, Edinburgh, UK Pirmin Schmid Seminar Software Engineering December 7, 2016 1

  2. De quoi s’agit-il? • New abstract interpretation of concurrent programs • Setting: Weak memory consistency • Model: store-buffer (FIFO) of infinite size • including theoretical model, proof and working implementation (OCaml) 2

  3. Memory models in Hardware and Languages • Strong consistency core 0 core 1 core 2 core 3 cache(s) cache(s) cache(s) cache(s) shared cache(s) RAM 4

  4. Memory models in Hardware and Languages • Weak consistency core 0 core 1 core 2 core 3 cache(s) cache(s) cache(s) cache(s) shared cache(s) RAM 5

  5. Memory models in Hardware and Languages • Weak consistency. TSO: total store ordering (x86) core 0 core 1 Array buffer FIFO pipeline shared memory 6

  6. Memory models in Hardware and Languages • Weak consistency. TSO: total store ordering (x86) What can it see? core 0 core 1 initial, shared X=0; Y=0 1: X = 1 2: Y = 2 3: shared memory (X=0; Y=0) 7

  7. Memory models in Hardware and Languages • Weak consistency. TSO: total store ordering (x86) core 0 core 1 initial, shared X=0; Y=0 1: X = 1 1b: ? flush 2: Y = 2 2b: ? flush 3: shared memory 8

  8. Memory models in Hardware and Languages • Weak consistency. TSO: total store ordering (x86) core 0 core 1 initial, shared X=0; Y=0 1: X = 1 X = 1 1b: ? flush 2: Y = 2 2b: ? flush 3: shared memory 9

  9. Memory models in Hardware and Languages • Weak consistency. TSO: total store ordering (x86) What can it see? core 0 core 1 initial, shared X=0; Y=0 1: X = 1 Y = 2 1b: ? flush 2: Y = 2 X = 1 2b: ? flush 3: shared memory 10

  10. Memory models in Hardware and Languages • Weak consistency. PSO: partial store ordering (ARM) What can it see? core 0 core 1 initial, shared X=0; Y=0 1: X = 1 X: Y: 1b: ? flush 2: Y = 2 2b: ? flush 3: shared memory 11

  11. Memory models in Hardware and Languages • Weak consistency. PSO: partial store ordering (ARM) core 0 core 1 initial, shared X=0; Y=0 1: X = 1 X: Y: 1b: ? flush 2: Y = 2 1 2b: ? flush 3: shared memory 12

  12. Memory models in Hardware and Languages • Weak consistency. PSO: partial store ordering (ARM) What can it see? core 0 core 1 initial, shared X=0; Y=0 1: X = 1 X: Y: 1b: ? flush 2: Y = 2 1 2 2b: ? flush 3: shared memory 13

  13. Memory models in Hardware and Languages • Weak consistency. PSO: partial store ordering (ARM) What can it see? core 0 core 1 initial, shared X=0; Y=0 1: X = 1 X: Y: 1b: ? flush 2: Y = 2 1 2 2b: ? flush 3: fence 4: shared memory 14

  14. Verification: Model checkers • Promela / spin • Scyther: crypto protocols • Limitation: only finite state space • State space explosion 15

  15. Verification: Abstract interpretation. SC 16

  16. Verification: Abstract interpretation. Dan et al. 17

  17. Verification: Abstract interpretation. This study 18

  18. Comparison buffer size n ∞ m Model Checker ----- state size ∞ Dan et al. This study 19

  19. PSO model: concrete domain thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 20

  20. PSO model: concrete domain thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 21

  21. PSO model: concrete domain thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 22

  22. PSO model: concrete domain thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 23

  23. PSO model: concrete semantics thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 24

  24. PSO model: concrete semantics thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 25

  25. PSO model: concrete semantics thread 1 thread 2 x 11 y 11 x 12 =e z 12 x 21 y 21 x 22 z 22 x 31 y 31 x 32 z 32 x 41 x 51 shared: x mem , y mem , z mem 26

  26. PSO model: concrete semantics thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 x 32 z 32 x 41 x 51 shared: x mem , y mem , z mem 27

  27. PSO model: concrete semantics thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 x 32 z 32 x 41 x 51 shared: x mem , y mem , z mem 28

  28. PSO model: concrete semantics thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 x 22 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 29

  29. Abstraction: handling ∞ • Key insight: summarize and partition. 𝛽 "#$ : thread 1 thread 2 x 11 y 11 x 12 z 12 x 21 y 21 z 22 x 31 y 31 z 32 x 41 x 51 shared: x mem , y mem , z mem 32

  30. Abstraction: handling ∞ • Key insight: summarize and partition. 𝛽 "#$ : thread 1 thread 2 x 11 y 11 x 12 z 12 x bot1 y bot1 z bot2 shared: x mem , y mem , z mem 33

  31. Abstraction: handling ∞ • Key insight: summarize and partition. 𝛽 "#$ : thread 1 thread 2 x 11 y 11 x 12 z 12 ∞ solved x bot1 y bot1 z bot2 cost: loosing precision shared: x mem , y mem , z mem 34

  32. Abstraction: partial buffer state information thread 1 thread 2 x 11 y 11 x 12 z 12 x bot1 y bot1 z bot2 shared: x mem , y mem , z mem 35

  33. Abstraction: partial buffer state information thread 1 thread 2 x 11 y 11 x 12 z 12 x bot1 y bot1 z bot2 2 steps: 1) summarize 2) resolve partition shared: x mem , y mem , z mem 36

  34. Abstract transformers 37

  35. Abstract transformers on partitions {.} 38

  36. Abstract transformers on partitions {.} 39

  37. Abstract transformers [[.]] using the {.} 40

  38. Abstraction: partial buffer state information thread 1 thread 2 x 11 y 11 x 12 z 12 x bot1 y bot1 z bot2 2 steps: 1) summarize 2) resolve partition shared: x mem , y mem , z mem 41

  39. My own code example 42

  40. Result PSO 43

  41. My own code example with fences 44

  42. Result with fences 45

  43. Code example from paper 46

  44. Benchmark 47

  45. Benchmark 48

  46. Benchmark 49

  47. Benchmark 50

  48. Benchmark 51

  49. Discussion • Good things • Limitations • Suggested improvements 52

  50. Acknowledgment • Thibault Suzanne for the VM with the working analyzer • Andrei Dan for interesting discussion 53

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