Kissig, Christian and Richards, Jay and Batty, Mark (2026) Episodic Loops: Finitary Event Structures and Operational Semantics for C11 Programs with Retries. [Preprint] (doi:10.48550/arXiv.2609.34646) (The full text of this publication is not currently available from this repository. You may be able to access a copy if URLs are provided) (KAR id:116968)
| The full text of this publication is not currently available from this repository. You may be able to access a copy if URLs are provided. | |
| Official URL: https://doi.org/10.48550/arXiv.2609.34646 |
|
Abstract
Lock-free synchronisation algorithms are often implemented with fallible operations, such as compare-and-swap (CAS), wrapped in unbounded retry loops. Verifying such algorithms requires considering arbitrarily many failing iterations, yielding large state spaces, compounded by the interleavings of concurrent threads. Prior work discarded failing iterations, arguing that they leave no trace in the post-loop state.
Compilers and hardware reorder instructions, and load-store reorderings may cross the boundaries of failing iterations, introducing subtle concurrency bugs. We demonstrate one such bug, making use-after-free possible in a previously verified variant of Read-Copy-Update - a synchronisation primitive widely adopted in the Linux Kernel - and we provide and verify a fix.
We find that practical retries in lock-free algorithms adhere to a common pattern. We introduce episodic loops, a semantic characterisation of unbounded retry loops which is syntactically recognisable in many practical cases, and synchronisation points, operations that bound both instruction reordering and state space within episodic loops. We show that SMRD - a symbolic event structure semantics for C11 programs which allows for load-store reordering - admits a finite representation in programs where unbounded loops are episodic. We further introduce a finitary operational semantics that allows safety properties to be verified in finitely many steps. For the use-after-free bug we demonstrate, verification takes a single pass over the program, linear in the program size.
We provide a reference implementation of SMRD reproducing the bug and verifying the fix, and mechanise the operational semantics together with the minimal bug and its fix in Isabelle/HOL.
| Item Type: | Preprint |
|---|---|
| DOI/Identification number: | 10.48550/arXiv.2609.34646 |
| Refereed: | No |
| Other identifier: | https://arxiv.org/abs/2609.34646 |
| Name of pre-print platform: | arXiv |
| Uncontrolled keywords: | relaxed memory concurrency, C11, lock-free synchronisation, finitary verification |
| Subjects: | Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming, |
| Institutional Unit: | Schools > School of Computing |
| Former Institutional Unit: |
There are no former institutional units.
|
| Funders: | University of Kent (https://ror.org/00xkeyj56) |
| Depositing User: | Christian Kissig |
| Date Deposited: | 15 Oct 2026 12:42 UTC |
| Last Modified: | 15 Oct 2026 12:44 UTC |
| Resource URI: | https://kar.kent.ac.uk/id/eprint/116968 (The current URI for this page, for reference purposes) |
- Export to:
- RefWorks
- EPrints3 XML
- BibTeX
- CSV
- Depositors only (login required):

Altmetric
Altmetric