Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Ssbse12b.ppt
1. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Optimizing Threads Schedule Alignments
to Expose the Interference Bug Pattern
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Neelesh Bhattacharya
Olfat El-Mahi, Etienne Duclos, Giovanni Beltrame, Giuliano Antoniol,
Sébastien Le Digabel and Yann-Gaël Guéhéneuc
Department of Computer and Software Engineering
Department of Mathematics and Industrial Engineering
École Polytechnique de Montréal, Québec, Canada
SSBSE - September 30, 2012
Conclusion
Future Work
Pattern Trace Identification, Detection, and Enhancement in Java
SOftware Cost-effective Change and Evolution Research Lab
2. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Outline
Introduction
Interference Bug Pattern
Problem Statement
ReSP - The Virtual Platform Used
Research Questions
Approach
Algorithms Used
Approach
Algorithms Used
Programs Under Test (PUTs)
Programs Under
Test (PUTs)
Results
Results
Conclusion
Conclusion
Future Work
2 / 23
Future Work
3. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Introduction (1/2)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
3 / 23
Developers are seeking the use of concurrency
extensively
Extremely difficult to detect and remove data-race
and interference bugs
Might not detect a bug for system’s non-deterministic
components
4. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Introduction (2/2)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
4 / 23
Interference bug pattern is the most frequently
occurring and one of the hardest to expose
CHESS [1] requires lot of testing effort to find
interference bugs in concurrent systems
Need to reduce the effort for finding interference bugs
5. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Interference Bug Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
5 / 23
Multiple concurrent threads access a shared variable
At least one access is a write
The threads use no explicit mechanism to prevent
simultaneous access
Generalized form of classical data race interference
bug pattern
6. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Problem Statement
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
6 / 23
Expose interference bug pattern for Programs Under Test
(PUTs), using a set of optimization algorithms: Random,
Stochastic Hill Climbing and Simulated Annealing
7. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
7 / 23
ReSP - The Virtual Platform Used
8. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
ReSP - The Virtual Platform Used
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
7 / 23
No effect of the OS
No delay in the hardware
No cache effects
9. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
ReSP - The Virtual Platform Used
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
No effect of the OS
No delay in the hardware
No cache effects
Thus our focus is only on the bug inherent in the code
7 / 23
10. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Research Questions
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
8 / 23
How to maximize interference probability between
threads?
How the search space dimension impacts the search
algorithm performance?
11. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Approach (1/4)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
9 / 23
No delay injected
12. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Approach (2/4)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
10 / 23
Single delay injected
13. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
11 / 23
Approach (3/4)
14. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
12 / 23
Approach (4/4)
15. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Algorithms Used
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
13 / 23
Stochastic Hill Climbing (SHC)
Simulated Annealing (SA)
Random (RND)
16. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
14 / 23
Programs Under Test (PUTs)
17. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Programs Under Test (PUTs)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
14 / 23
Synthetic Programs
Matrix Multiplication (MM)
Count Shared Data (CSD)
Average of Numbers (AvN)
18. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Programs Under Test (PUTs)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
Synthetic Programs
Matrix Multiplication (MM)
Count Shared Data (CSD)
Average of Numbers (AvN)
ReSP - The Virtual
Platform Used
Research
Questions
Real World Programs
Approach
CFFT
Algorithms Used
CFFT6
Programs Under
Test (PUTs)
FFMPEG
Results
Conclusion
Future Work
14 / 23
19. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Results (1/5)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
15 / 23
RND, SHC, and SA for search space upto 10Ms delay
(RQ1)
20. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Results (2/5)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
16 / 23
RND, SHC, and SA for search space upto 1Ms delay
(RQ2)
21. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Results (3/5)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
17 / 23
RND, SHC, and SA for search space upto 10s delay
(RQ2)
22. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Results (4/5)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
18 / 23
RND, SHC, and SA for search space upto 1s delay (RQ2)
23. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Results (5/5)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
19 / 23
Execution Times for Real-World Applications in ms
SA
HC
RND
CFFT
1 ×106
3118
3578
113521
1×107
5224
4976
107586
CFFT6
1×106
27443
27328
342523
1×107
2041
21943
339951
FFMPEG
1×106
1562
1378
59599
1×107
4672
5100
133345
24. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Conclusion (1/2)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
20 / 23
Proposed an approach to expose interference bugs
in multi-threaded software systems
Novel fitness function to allow exposing thread
interference
Reported results of our fitness function and the three
search algorithms on six multi-threaded programs
25. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Conclusion (2/2)
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
For small search spaces, even a simple random
strategy may suffice
ReSP - The Virtual
Platform Used
In large search spaces, SA outperforms SHC
marginally
Research
Questions
Random performs the worst among all approaches
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
21 / 23
26. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Future Work
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
22 / 23
Verify the efficiency of our proposed approach on
real-time, more complex programs
Use more complex data structures such as pipes,
shared memories or sockets
Verify our approach on real hardware platform
Compare our results with Genetic Algorithm and
Tabu Search
27. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
23 / 23
Summary
We propose an optimization approach to maximize
interference probability between threads
We framed and answered two research questions:
How to maximize interference probability in threads?
How search space dimension impacts search
algorithms?
Simulated Annealing is marginally the best approach
to maximize interference bug
Varying the search space affects the algorithm
performances
28. Optimizing
Threads Schedule
Alignments to
Expose the
Interference Bug
Pattern
Neelesh
Bhattacharya
Introduction
Interference Bug
Pattern
Problem
Statement
ReSP - The Virtual
Platform Used
Research
Questions
Approach
Algorithms Used
Programs Under
Test (PUTs)
Results
Conclusion
Future Work
23 / 23
Summary
We propose an optimization approach to maximize
interference probability between threads
We framed and answered two research questions:
How to maximize interference probability in threads?
How search space dimension impacts search
algorithms?
Simulated Annealing is marginally the best approach
to maximize interference bug
Varying the search space affects the algorithm
performances