Pointer Life Cycle Types for Lock-Free Data Structures with Memory Reclamation

10/25/2019
by   Roland Meyer, et al.
0

We consider the verification of lock-free data structures that manually manage their memory with the help of a safe memory reclamation (SMR) algorithm. Our first contribution is a type system that checks whether a program properly manages its memory. If the type check succeeds, it is safe to ignore the SMR algorithm and consider the program under garbage collection. Intuitively, our types track the protection of pointers as guaranteed by the SMR algorithm. There are two design decisions. The type system does not track any shape information, which makes it extremely lightweight. Instead, we rely on invariant annotations that postulate a protection by the SMR. To this end, we introduce angels, ghost variables with an angelic semantics. Moreover, the SMR algorithm is not hard-coded but a parameter of the type system definition. To achieve this, we rely on a recent specification language for SMR algorithms. Our second contribution is to automate the type inference and the invariant check. For the type inference, we show a quadratic-time algorithm. For the invariant check, we give a source-to-source translation that links our programs to off-the-shelf verification tools. It compiles away the angelic semantics. This allows us to infer appropriate annotations automatically in a guess-and-check manner. To demonstrate the effectiveness of our type-based verification approach, we check linearizability for various list and set implementations from the literature with both hazard pointers and epoch-based memory reclamation. For many of the examples, this is the first time they are verified automatically. For the ones where there is a competitor, we obtain a speed-up of up to two orders of magnitude.

READ FULL TEXT

page 1

page 38

research
11/28/2018

Safe Deferred Memory Reclamation with Types

Memory management in lock-free data structures remains a major challenge...
research
11/25/2017

A Language for Probabilistically Oblivious Computation

An oblivious computation is one that is free of direct and indirect info...
research
02/13/2018

A wide-spectrum language for verification of programs on weak memory models

Modern processors deploy a variety of weak memory models, which for effi...
research
03/02/2021

SLD-resolution without occur-check, an example

We prove that the occur-check is not needed for a certain definite claus...
research
06/21/2023

Automatic Inference of Resource Leak Specifications

A resource leak occurs when a program fails to free some finite resource...
research
06/14/2022

Aeneas: Rust Verification by Functional Translation

We present Aeneas, a new verification toolchain for Rust programs based ...
research
10/24/2018

Type-directed Bounding of Collections in Reactive Programs

Our aim is to statically verify that in a given reactive program, the le...

Please sign up or login with your details

Forgot password? Click here to reset