Fray: An Efficient General-Purpose Concurrency Testing Platform for the JVM
Ao Li, Byeongjee Kang, Vasudev Vikram, Isabella Laybourn, Samvid Dharanikota, Shrey Tiwari, Rohan Padhye
Abstract
Concurrency bugs are hard to discover and reproduce, even in well-synchronized programs that are free of data races. Thankfully, prior work on controlled concurrency testing (CCT) has developed sophisticated algorithms—such as partial-order based and selectively uniform sampling—to effectively search over the space of thread interleavings. Unfortunately, in practice, these techniques cannot easily be applied to real-world Java programs due to the difficulties of controlling concurrency in the presence of the managed runtime and complex synchronization primitives. So, mature Java projects that make heavy use of concurrency still rely on naive repeated stress testing in a loop. In this paper, we take a first-principles approach for elucidating the requirements and design space to enable CCT on arbitrary real-world JVM applications. We identify practical challenges with classical design choices described in prior work—such as concurrency mocking, VM hacking, and OS-level scheduling—that affect bug-finding effectiveness and/or the scope of target applications that can be easily supported. Based on these insights, we present Fray, a new platform for performing push-button concurrency testing (beyond data races) of JVM programs. The key design principle behind Fray is to orchestrate thread interleavings without replacing existing concurrency primitives, using a concurrency control mechanism called shadow locking for faithfully expressing the set of all possible program behaviors. With full concurrency control, Fray can test applications using a number of search algorithms from a simple random walk to sophisticated techniques like PCT, POS, and SURW. In an empirical evaluation on 53 benchmark programs with known bugs (SCTBench and JaConTeBe), Fray with random walk finds 70% more bugs than JPF and 77% more bugs than rr ’s chaos mode. We also demonstrate Fray’s push-button applicability on 2,664 tests from Apache Kafka, Lucene, and Google Guava. In these mature projects, Fray successfully discovered 18 real-world concurrency bugs that can cause 371 of the existing tests to fail under specific interleavings. We believe that Fray serves as a bridge between classical academic research and industrial practice— empowering developers with advanced concurrency testing algorithms that demonstrably uncover more bugs, while simultaneously providing researchers a platform for large-scale evaluation of search techniques.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext a3943aaa-58ed-47cc-9b35-3f06f8d945c8Cited by top-tier papers1
Ask how each one uses itBuilds on8
- Razzer: Finding Kernel Race Bugs through FuzzingDae R. Jeong, Kyungtae Kim, Basavesh Shivakumar, Byoungyoung Lee et al.S&P 2019 · 202 citations
- Controlled Concurrency Testing via Periodical SchedulingCheng Wen, Mengda He, Bohao Wu, Zhiwu Xu et al.ICSE 2022 · 25 citations
- Greybox Fuzzing for Concurrency TestingDylan Wolff, Zheng Shi, Gregory J. Duck, Umang Mathur et al.ASPLOS 2024 · 19 citations
- Snowcat: Efficient Kernel Concurrency Testing using a Learned Coverage PredictorSishuai Gong, Dinglan Peng, Deniz Altinbüken, Pedro Fonseca et al.SOSP 2023 · 11 citations
- Jmvx: Fast Multi-threaded Multi-version Execution and Record-Replay for Managed LanguagesDavid Schwartz, Ankith Kowshik, Luís PinaOOPSLA 2024 · 5 citations
Related papers
- Concurrency Fuzzing of the Linux Kernel with eBPFJiacheng Xu, Dylan Wolff, Xing Yi Han, Jialin Li et al.USENIX Security 2026
- Selectively Uniform Concurrency TestingHuan Zhao, Dylan Wolff, Umang Mathur, Abhik RoychoudhuryASPLOS 2025 · 4 citations
- Context-Sensitive and Directional Concurrency Fuzzing for Data-Race DetectionZu-Ming Jiang, Jia-Ju Bai, Kangjie Lu, Shi-Min HuNDSS 2022
- Sound and efficient concurrency bug predictionYan Cai, Hao Yun, Jinqiu Wang, Lei Qiao et al.FSE 2021 · 29 citations
- SJFuzz: Seed and Mutator Scheduling for JVM FuzzingMingyuan Wu, Yicheng Ouyang, Minghai Lu, Junjie Chen et al.FSE 2023 · 14 citations
