SmallRace: Static Race Detection for Dynamic Languages - A Case on Smalltalk
Siwei Cui, Yifei Gao, Rainer Unterguggenberger, Wilfried Pichler, Sean Livingstone, Jeff Huang
Abstract
Smalltalk, one of the first object-oriented programming languages, has had a tremendous influence on the evolution of computer technology. Due to the simplicity and productivity provided by the language, Smalltalk is still in active use today by many companies with large legacy codebases and with new code written every day. A crucial problem in Smalltalk programming is the race condition. Like in any other parallel language, debugging race conditions is inherently challenging, but in Smalltalk, it is even more challenging due to its dynamic nature. Being a purely dynamically-typed language, Smalltalk allows assigning any object to any variable without type restrictions, and allows forking new threads to execute arbitrary anonymous code blocks passed as objects. In Smalltalk, race conditions can be introduced easily, but are difficult to prevent at run time. We present SmallRace, a novel static race detection framework designed for multithreaded dynamic languages, with a focus on Smalltalk. A key component of SmallRace is SmallIR, a subset of LLVM IR, in which all variables are declared with the same type-a generic pointer i8 * . This allows SmallRace to design an effective interprocedural thread-sensitive pointer analysis to infer the concrete types of dynamic variables. SmallRace automatically translates Smalltalk source code into SmallIR, supports most of the modern Smalltalk syntax in Visual Works, and generates actionable race reports with detailed debugging information. Importantly, SmallRace has been used to analyze a production codebase in a large company with over a million lines of code, and it has found tens of complex race conditions in the production code.
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.
Cited by top-tier papers1
Ask how each one uses itBuilds on2
- OMPRacer: a scalable and precise static race detector for OpenMP programsBradley Swain, Yanze Li, Peiming Liu, Ignacio Laguna et al.SC 2020 · 22 citations
- When threads meet events: efficient and precise static race detection with originsBozhen Liu, Peiming Liu, Yanze Li, Chia-Che Tsai et al.PLDI 2021 · 17 citations
Related papers
- Accurate Static Data Race Detection for CEmerson Sales, Omar Inverso, Emilio TuostoFM 2024 · 1 citation
- Themis: Detecting Distributed Concurrency Bugs through RPC-Driven Race-Directed Test Generation and FuzzingHongchen Cao, Jingzhu He, Ting Dai, Guoliang JinNSDI 2026 · 1 citation
- HiRace: Accurate and Fast Data Race Checking for GPU ProgramsJohn Jacobson, Martin Burtscher, Ganesh GopalakrishnanSC 2024 · 3 citations
- A study of real-world data races in GolangMilind Chabbi, Murali Krishna RamanathanPLDI 2022 · 34 citations
- RAProducer: efficiently diagnose and reproduce data race bugs for binaries via trace analysisMing Yuan, Yeseop Lee, Chao Zhang, Yun Li et al.ISSTA 2021 · 7 citations
