Themis: Detecting Distributed Concurrency Bugs through RPC-Driven Race-Directed Test Generation and Fuzzing
Hongchen Cao (ShanghaiTech University), Jingzhu He (ShanghaiTech University), Ting Dai (InsightFinder AI), Guoliang Jin (North Carolina State University)
23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 2 · When Systems Run Themselves
Overview
Distributed concurrency bugs present some of the most persistent and damaging reliability challenges in modern cloud-scale infrastructure. These bugs occur when concurrent execution flows—frequently triggered or mediated by internal communication protocols like remote procedure calls (RPCs)—access shared system objects under specific, non-deterministic interleavings. Such faults routinely slip past traditional testing pipelines, manifesting in production as catastrophic failures, data corruption, or severe outages, such as the high-profile incidents seen in systems like Amazon's DynamoDB. This talk introduces Themis (referred to in the transcript as Simu or Symex), a novel automated testing and analysis framework designed to detect distributed concurrency bugs with high coverage and high precision without requiring predefined, manually written test harnesses.

Key moments
- 0:00 Introduction and definition of distributed concurrency bugs
- 1:20 Real-world example of a distributed concurrency bug
- 2:10 Proposed framework combining static race detection and targeted testing
- 5:10 Module 1: Static RPC-driven race detection and variable analysis
- 10:10 LLM-based test generation and repair workflow
- 11:30 Three-stage parameter fuzzing and interleaving exploration
- 14:15 Evaluation results and newly discovered bugs in cloud systems
Themis: Detecting Distributed Concurrency Bugs through RPC-Driven Race-Directed Test Generation and Fuzzing
Speakers: Hongchen Cao (ShanghaiTech University); Jingzhu He (ShanghaiTech University); Ting Dai (InsightFinder AI); Guoliang Jin (North Carolina State University)
Conference: USENIX NSDI
YouTube: https://www.youtube.com/watch?v=6yZf0kC_Ujw
Overview
Distributed concurrency bugs present some of the most persistent and damaging reliability challenges in modern cloud-scale infrastructure. These bugs occur when concurrent execution flows—frequently triggered or mediated by internal communication protocols like remote procedure calls (RPCs)—access shared system objects under specific, non-deterministic interleavings. Such faults routinely slip past traditional testing pipelines, manifesting in production as catastrophic failures, data corruption, or severe outages, such as the high-profile incidents seen in systems like Amazon's DynamoDB. This talk introduces Themis (referred to in the transcript as Simu or Symex), a novel automated testing and analysis framework designed to detect distributed concurrency bugs with high coverage and high precision without requiring predefined, manually written test harnesses.
The significance of Themis lies in its departure from existing dynamic testing tools, which suffer from limited code coverage due to their heavy reliance on pre-existing workloads and developer-supplied test suites. By combining a test-harness-agnostic static race detection engine with large language model (LLM)-driven test generation and staged parameter fuzzing, Themis bridges the gap between the broad reach of static code analysis and the concrete validation power of dynamic testing. The framework successfully targets open distributed systems where external clients can invoke arbitrary public interfaces, systematically exposing synchronization flaws, race conditions, and atomicity violations that threaten large-scale cloud services.
Background
▶ Watch: Introduction and definition of distributed concurrency bugs (0:00)
The core difficulty in finding distributed concurrency bugs stems from the architectural reality of modern cloud systems: they are open systems exposed to asynchronous external clients, and they rely heavily on internal RPC mechanisms to coordinate distributed state. A distributed concurrency bug typically involves two or more concurrent execution flows—at least one of which is initiated by internal communication—accessing the same shared object or memory location. Under hazardous execution interleavings, these accesses produce invalid states, data races, or atomicity violations.
Prior methodologies for detecting these bugs fall primarily into two camps: dynamic approaches and static approaches. Dynamic testing and runtime race detectors depend heavily on workloads executed during testing. If a test suite fails to exercise a specific interleaving or code path, the bug remains entirely hidden, leading to fundamentally limited coverage. Conversely, traditional static race detection techniques typically require a known entry point or an explicit test harness to initiate top-down analysis, enumerating execution flow pairs to find potential races.
In open distributed systems, however, assuming a complete test harness upfront is unrealistic because public interfaces can be invoked in arbitrary sequences by external actors. Without a test harness, top-down static analysis breaks down. Furthermore, even when a static analyzer successfully flags a potential race, validating whether that race can actually manifest into a failure requires complex parameter generation and precise control over execution interleavings—a search space so vast that manual test construction becomes intractable for developers. Themis was engineered to solve this exact dilemma by decoupling static discovery from dynamic test synthesis and interleaving exploration.
Key Findings
▶ Watch: Proposed framework combining static race detection and targeted testing (2:10)
Evaluated across eight popular, real-world cloud systems, Themis demonstrates exceptional bug-finding efficacy, uncovering a substantial volume of previously unknown concurrency defects in complex distributed architectures.
- High Bug Discovery Rate: Across the evaluated cloud systems, Themis detected 204 unique violations, encompassing 198 new violations that correspond to 58 distinct bugs. Of these 58 bugs, 52 are entirely new.
- Developer Confirmation: At the time of reporting, developers had already confirmed all of the newly discovered bugs, underscoring the high precision of the framework and the lack of false positives in its final validation stages.
- Implicit vs. Explicit Symptoms: The vast majority of detected violations (170 out of 204) exhibited implicit symptoms—specifically runtime exceptions such as null pointer exceptions and out-of-bounds exceptions—which are notoriously difficult to catch via standard unit testing.
- Server-Instance Vulnerability Concentration: The analysis revealed that most bugs involve race conditions on server instance variables. This highlights a prevalent pitfall among distributed systems developers: underestimating or overlooking the fact that multiple clients concurrently invoke functions on the exact same long-lived server instance.
- End-to-End Pipeline Success: Out of 239 unique violations flagged by the static analysis module, Themis successfully generated functional test cases for 228 of them, ultimately exposing 204 true violations through its staged fuzzing and interleaving engine.
Technical Deep Dive
▶ Watch: Module 1: Static RPC-driven race detection and variable analysis (5:10)
The architecture of Themis relies on a tripartite pipeline: Static RPC-Driven Race Detection, LLM-Based Holistic Test Generation, and Staged Parameter Fuzzing and Interleaving Exploration. This design implements an LLM plus guidance plus checking paradigm designed to mitigate LLM hallucinations while automating the synthesis of complex distributed test scenarios.
1. Static RPC-Driven Race Detection Without Test Harnesses
To analyze open systems without a predefined test harness, Themis bypasses top-down enumeration from entry points. Instead, it localizes RPC-reachable variables and their access sites:
- Protocol Matching & Filtering: Themis identifies RPC client and server function pairs by matching their communication protocols and filtering out pairs using mismatched configuration addresses.
- Bidirectional Reachability Analysis: On the server side, the analyzer traverses downward from RPC handlers to locate memory access sites (such as instance fields,
stdiofields, and I/O objects). On the client side, it traverses upward to identify how parameters and return values are produced or consumed. - Points-to Analysis & Aliasing: For parameters and receiver objects, Themis employs points-to analysis to resolve referenced variables within their declaration scopes, while analyzing file paths for I/O objects to detect aliasing.
- Violation Rules: The analyzer applies five specialized rules. Rules 1, 2, and 3 apply to both RPC server and client sides (detecting conflicting accesses and atomicity violations such as read-write-read interleavings), while Rules 4 and 5 target client-specific synchronization patterns. Cases protected by standard synchronized blocks are pruned, leaving custom synchronization for dynamic testing.
- Symptom Filtering: To eliminate benign races, Themis checks whether incorrect states propagate to explicit failure statements or trigger implicit error patterns (null pointer exceptions and out-of-bounds exceptions).
2. LLM-Based Holistic Test Generation
Once static analysis isolates a potential race and its corresponding public interfaces, Themis leverages an LLM to construct a basic test harness. This module constructs the correct sequence of calls needed to establish prerequisite system states and synthesizes complex initialization parameters.
Because LLMs are prone to hallucinations, Themis uses a strict verification loop:
- If a generated test fails at runtime, the framework iteratively repairs it using runtime error messages and code context.
- If iterative repair exhausts its retry budget, Themis falls back to incorporating existing test suites to harvest valid call sequences.
3. Staged Parameter Fuzzing and Interleaving Exploration
Exposing a concurrency bug requires satisfying three strict conditions: reaching the racy statements, triggering the buggy interleaving, and manifesting the failure symptom. Themis handles this via three distinct stages:
- Stage 1 (Target-Directed Fuzzing): Sets explicit fuzzing targets at RPC call sites, RPC server functions, racy functions, and the specific racy access statements, adjusting LLM-generated parameters until all targets are successfully reached.
- Stage 2 (Interleaving Exploration): Utilizes a signal and wait mechanism to test alternative execution orderings. For atomicity violations, it evaluates whether one access occurs before, after, or between competing accesses, confirming a bug only when the symptom surfaces exclusively under the buggy interleaving.
- Stage 3 (Symptom-Triggering Fuzzing & Instrumentation): Adds symptom statements as secondary fuzzing targets, reusing seeds and parameters from Stage 1. For implicit errors where reaching the symptom state requires specific object nullness (e.g., ensuring a variable returned by a
removeoperation is actually null), Themis instruments explicit checks that transform error-triggering conditions into explicit control flow branches.
Experimental Setup & Results
▶ Watch: Three-stage parameter fuzzing and interleaving exploration (11:30)
The evaluation of Themis was conducted across eight prominent, open-source cloud systems to measure its capability in uncovering real-world distributed concurrency bugs.
- Datasets & Evaluation Targets: The evaluation utilized eight production-grade cloud infrastructure and distributed systems, alongside a curated benchmark set of known historical bugs to test regression-detection capabilities.
- Metrics: Primary metrics included the total number of statically detected violations, successfully generated test cases, confirmed true violations, and newly discovered bugs.
- Headline Numbers:
- Static analysis identified 239 unique violations.
- The LLM test generator successfully produced executable harnesses for 228 of those violations.
- Dynamic fuzzing and interleaving exploration ultimately exposed 204 true violations.
- These violations exposed 58 total bugs, of which 52 were previously unknown to developers and subsequently confirmed.
- Among confirmed violations, 170 exhibited implicit runtime exceptions (such as null pointer exceptions), highlighting the framework's capability to uncover subtle logic corruption rather than just overt crashes.
(Note: No separate ablation study metrics or specific hardware accelerator specifications were detailed in the transcript beyond the evaluation on eight cloud systems.)
Practical Implications
▶ Watch: Evaluation results and newly discovered bugs in cloud systems (14:15)
For infrastructure teams, model builders, and distributed systems deployers, Themis offers a paradigm shift in how concurrency bugs are identified prior to production release. By demonstrating that static analysis can be successfully decoupled from manual test harness writing through the use of LLM guidance and directed fuzzing, the framework eliminates one of the most labor-intensive bottlenecks in cloud systems testing.
For systems developers, the findings emphasize the danger of treating long-lived server instances as thread-safe or single-client entities. Because modern cloud architectures expose public interfaces to arbitrary external asynchronous clients, developers must aggressively guard server-instance state variables against uncoordinated concurrent RPC invocations.
However, practitioners should note certain limitations inherent to this approach. While Themis automates test generation effectively, the framework's success relies on the underlying LLM's ability to grasp basic semantic contexts during test repair, and highly complex custom synchronization patterns still require manual inspection when static rules fail to resolve them.
Key Takeaways
- Test-Harness-Agnostic Discovery: Themis performs static race detection on open distributed systems without requiring a pre-existing test harness by assuming public interfaces can run concurrently.
- LLM Plus Guidance Paradigm: Combines static analysis guidance with LLM test generation and rigorous dynamic fuzzing to prevent hallucinations and automate complex test synthesis.
- Staged Validation Pipeline: Utilizes a three-stage execution model targeting parameter reachability, signal-and-wait interleaving exploration, and symptom-triggering instrumentation.
- High Real-World Impact: Discovered 58 bugs across eight popular cloud systems, yielding 52 newly confirmed defects, the vast majority of which manifested as hidden implicit runtime exceptions.
- Server-Instance Vulnerability: Confirms that uncoordinated multi-client access to shared server-instance fields is a primary breeding ground for severe distributed concurrency bugs.
About the Speaker(s)
The presentation was delivered by Jingzhu He on behalf of a collaborative research team from ShanghaiTech University, InsightFinder AI, and North Carolina State University. The research paper represents joint work between student researcher Hongchen Cao, presenter Jingzhu He, and collaborators Ting Dai and Guoliang Jin, focusing on advanced systems reliability, automated testing, and concurrency bug detection in distributed cloud environments.
Reviews
→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)
All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)