Distributed Dynamic Partial Order Reduction based Verification of Threaded Software
Distributed Verification of Multi-threaded C++ Programs
description
Transcript of Distributed Verification of Multi-threaded C++ Programs
![Page 1: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/1.jpg)
Distributed Verification Distributed Verification of Multi-threaded C++ of Multi-threaded C++
ProgramsPrograms
Distributed Verification Distributed Verification of Multi-threaded C++ of Multi-threaded C++
ProgramsPrograms
Stefan Edelkamp
joint work with Damian Sulewskiand Shahid Jabbar
![Page 2: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/2.jpg)
Motivation: IO-HSF-SPIN
Arrives at the final
state
Arrives again at
same final state
Same states in
both parts
Current state
Already seen final
state
Large jumps due
to 2nd heuristic
2.9 TB20 days1 node
----8 days
3 nodes
![Page 3: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/3.jpg)
Overview
• Software Checking in StEAM
Externalization
Virtual Addresses
Parallelization
![Page 4: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/4.jpg)
Overview
•Software Checking in StEAM
Externalization
Virtual Addresses
Parallelization
![Page 5: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/5.jpg)
Software Checking
• Advantages+ Building a model unnecessary
+ Learning specification language unnecessary + Checking can be done more often
Disadvantages
- Code has to be executed
- Huge number of states
- Huge states
![Page 6: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/6.jpg)
StEAM
• Can check concurrent C++ programs Uses a virtual machine for execution supports BFS, DFS, Best-First, A*, IDA* finds
Deadlocks Assertion Violations Segmentation Faults
![Page 7: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/7.jpg)
Objectcode
StEAM - Checking a C++ Program
igccCompiler
Model checker
Virtual Machine
char globalChar;
int globalBlocksize = 7;
int main(){allocateBlock(blocksize);
}
void allocateBlock(int size){
void *memBlock;
memBlock = (void *) malloc(size);}
![Page 8: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/8.jpg)
StEAM - Interpreting the Object Code
char globalChar;
int globalBlocksize = 7;
int main(){allocateBlock(blocksize);
}
void allocateBlock(int size){
void *memBlock;
memBlock = (void *) malloc(size);}
Register
BSS Section
Data Section
Text Section
Stack
Memory Pool
ICVM Virtual Machine
Objectcode
![Page 9: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/9.jpg)
StEAM – Generating States
Register
BSS Section
Data Section
Text Section
Stack
Memory Pool
ICVM Virtual Machine StEAM
Register
BSS Section
Data Section
Text Section
Stack
Memory Pool
Initial StateRegister
BSS Section
Stack
Memory Pool
State 1Register
BSS Section
Data Section
Stack
State 2
![Page 10: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/10.jpg)
Overview
•Software Checking in StEAM
Externalization
Virtual addresses
Parallelization
![Page 11: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/11.jpg)
Externalization - Motivation
Internal
External
time
problem size
![Page 12: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/12.jpg)
Externalization – Mini States
• pointer to a state in RAM or on Disk
pointer to the predecessor mini state
constant size
DiskRAM
[EJMRS 06]
![Page 13: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/13.jpg)
Externalization – Expanding a State
Mini States Secondary MemoryCache
Internal Memory
![Page 14: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/14.jpg)
Externalization – Flushing the Cache
Mini States Secondary MemoryCache
Internal Memory
![Page 15: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/15.jpg)
Externalization – Collapse Compression
Register
BSS Section
Data Section
Text Section
Stack
Memory Pool
State Caches Files on Disk
![Page 16: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/16.jpg)
Overview
•Software Checking in StEAM
Externalization
Virtual Addresses
Parallelization
![Page 17: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/17.jpg)
Virtual Addresses • programs request memory memory assignment done by system
moving program between nodes impossible two possible strategies
converting the addresses before executing
using virtual addresses
![Page 18: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/18.jpg)
Virtual Addresses – Memory Management
Stack
Stack pointer
Text BSS Data
Program counter
Memory pool
0
RAM
real address: x
virtual address: y
yx, size
AVL-Tree
Stack pointer
![Page 19: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/19.jpg)
Virtual Addresses - Overhead
real
virtual
nodes
time
![Page 20: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/20.jpg)
Overview
•Software Checking in StEAM
Externalization
Virtual Addresses
Parallelization
![Page 21: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/21.jpg)
Parallelization – Motivation
Distributed (Shared) Memory MPI channels/shared RAM communication
Sending full states too expensive (if not used for expansion) Exploit externalization DualChannel (Speedup vs. Load Balance)Appropriate State Space Partitioning
![Page 22: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/22.jpg)
Parallelization – Dual Channel
Communication
![Page 23: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/23.jpg)
Parallelization – Hash Partitioning
Partitioning by hashing full stateProblem: Successors often not in same
partition high communication overhead
Partitioning by hashing partial state,e.g. memory pool
Problem: Too many states map to one hash value Load balancing
![Page 24: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/24.jpg)
Parallelization – Incremental Tree
Hashing
h(3,1) = 3*3+1*9 mod 17= 1
h(1,2) = 1*3+2*9 mod 17 = 4
h(2,2,1,2) = 9 = 6+h(2,1,2)*3^1 =6+1*3 mod 17
h(2) = 2*3^1 mod 17= 6
h(s) = (Σi si 3^i) mod 17
h(1,2,3,1,2,2,1,2) = 4+1*3^2 + 9*3^(2+2) mod 17 = 11
[EM05]
![Page 25: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/25.jpg)
Parallelization – Search Partitioning
DFS[Holzman & Bosnacki 2006]
Best-First, A*
horizontal slices vertical slices
![Page 26: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/26.jpg)
Parallelization - Hardware
• Cluster Vision System (PBS)• Linux Suse 10.0• MPI via infiniband• Files via GBit Ethernet• 224 nodes (464 procs), < 15 used • AMD Opteron DP 50 (2.4 GHz)
![Page 27: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/27.jpg)
Experiments: 15-Puzzle Partial Hash
time
nodes
speedup
![Page 28: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/28.jpg)
Experiments – Depth-First Slicing 200
Philosopherstime
processors
Top Result: 600 Phils / 6 nodes
97 KB /stateEx Collapse
Compression & Distribution
16GB 1.5 GB per node
![Page 29: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/29.jpg)
Experiments - Bath-Tub Effect (50 phils-
avg.)Time
Size of Depth Layer
validates Holzmann &
Bosnacki
![Page 30: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/30.jpg)
Experiment - Shared Memory Bakery
(pthread)• 4 Opteron MP 852 (2.6 GHZ)
nodes
speedup
time
![Page 31: Distributed Verification of Multi-threaded C++ Programs](https://reader035.fdocuments.in/reader035/viewer/2022070410/5681466b550346895db390d5/html5/thumbnails/31.jpg)
Conclusion
Preceeding Work: Full Externalization of States, inIO-HSF-SPIN Constant-Size RAM, e.g. 1.8 GB RAM, 20 days 1 proc, 8 days 4 procs, 2.9TB disk [EJ06], Distribution via (g+h)-Value
Problem: Huge & Highly Dynamic States Solution: Mini States as Constant Size Finger
Prints of States in RAM for Dual-Channel Communication to combine External and Parallel Search with Memory-Pool, Best-First Slicing Partitioning