Title: Proving thread termination
1 Proving thread termination Byron Cook
(Microsoft Research) Andreas Podelski
(Freiburg) Andrey Rybalchenko (MPI/EPFL)
PLDI07 presentation, June 13th 2007
2 Proving thread termination Byron Cook
(Microsoft Research) Andreas Podelski
(Freiburg) Andrey Rybalchenko (MPI/EPFL)
PLDI07 presentation, June 13th 2007
3Introduction
- Todays program termination tools do not natively
support multithreaded programs - Most of the code that were interested in
verifying is multithreaded - Today Terminator meets concurrency
4Introduction
5Introduction
Byron Cook bycook_at_microsoft.com
Microsoft Research, Cambridge Joint work with
Andreas Podelski and Andrey Rybalchenko
6Introduction
- Todays program termination tools do not natively
support multithreaded programs - Most of the code that were interested in
verifying is multithreaded - Today Terminator meets concurrency
7Introduction
- Todays program termination tools do not natively
support multithreaded programs - Most of the code that were interested in
verifying is multithreaded - Today Terminator meets concurrency
8Introduction
- Todays program termination tools do not natively
support multithreaded programs - Most of the code that were interested in
verifying is multithreaded - Today Terminator meets concurrency
9Introduction
10Introduction
11Terminator for multithreaded programs
- Whats in the paper?
- Terminator for coarse-grained multithreaded
programs - Thread-modular algorithm finds an environment
model binary relation expressed as CNF formula - Implements iterative weakening strengthening
based on spurious counterexamples - Strengthening add conjuncts
- Weakening add disjuncts
- Nifty trick
- Iterative search considers counterexamples to
termination in isolation of the other threads
12Terminator for multithreaded programs
- Thread-termination Thread T is thread
terminating in P if in each P-computation T makes
only finite many steps. - Important to note
- Were not ruling out deadlock
- Deadlock is a safety property that other tools
should rule out - Thus not proving that functions called in T
eventually return control back to their caller - For now were ignoring fairness
- In practice code should not depend on fairness
for termination - Example
13Example
14Example
15Example
16Example
17Example
18Example
19Example
20Example
21Example
22Example
23Example
24Example
25Example
26Example
27Example
28Example
29Example
30Example
31Example
32Example
33Example
34Example
35Example
36Example
37Example
38Example
39Experimental results
- Details of the procedure and experiments are in
the paper - Experiments were performed on Windows device
drivers - Weve found a couple of interesting bugs when the
procedure failed to find a proof
40Introduction
41Introduction
42Introduction
43- In conclusion
- Terminator failed to support multithreaded
programs - Most of the code that were interested in
verifying is multithreaded - Todays focus Terminator for thread-termination
- Key observation proofs of termination in
isolation of the environment can be used to
determine what a thread expects from its
environment.
44- Observations
- Few rounds of refinement required in practice.
- Programmers typically use defensive techniques
regarding termination, thus the arguments and
environment assumptions are mostly local - Thread-modular techniques work here because were
only specifying variance (i.e. x x) and not
invariance (i.e. xgt0)