Preventing Atomicity Violations with Contracts
Diogo G. Sousa, Ricardo J. Dias, Carla Ferreira, Jo\~ao M., Louren\c{c}o

TL;DR
This paper introduces a contract-based approach to prevent atomicity violations in concurrent programs, especially when using third-party modules, by specifying correlated method executions and verifying correctness through static analysis.
Contribution
It proposes a novel contract system for concurrency that specifies correlated methods to ensure atomicity and a static analysis methodology to verify these contracts in real-world software.
Findings
Identified atomicity violation in Tomcat 6.0
Developed a static analysis tool for contract verification
Successfully applied to real-world software packages
Abstract
Software developers are expected to protect concurrent accesses to shared regions of memory with some mutual exclusion primitive that ensures atomicity properties to a sequence of program statements. This approach prevents data races but may fail to provide all necessary correctness properties.The composition of correlated atomic operations without further synchronization may cause atomicity violations. Atomic violations may be avoided by grouping the correlated atomic regions in a single larger atomic scope. Concurrent programs are particularly prone to atomicity violations when they use services provided by third party packages or modules, since the programmer may fail to identify which services are correlated. In this paper we propose to use contracts for concurrency, where the developer of a module writes a set of contract terms that specify which methods are correlated and must be…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDistributed systems and fault tolerance · Security and Verification in Computing · Logic, programming, and type systems
