Understanding Concurrency Bugs in Real-World Programs with Kotlin Coroutines
Kotlin language has recently become prominent for developing both Android and server-side applications. These programs are typically designed to be fast and responsive, with asynchrony and concurrency at their core. To enable developers to write asynchronous and concurrent code safely and concisely, Kotlin provides built-in coroutines support. However, developers unfamiliar with the coroutines concept may write programs with subtle concurrency bugs and face unexpected program behaviors. Besides the traditional concurrency bug patterns, such as data races and deadlocks, these bugs may exhibit patterns related to the coroutine semantics. Understanding these coroutine-specific bug patterns in real-world Kotlin applications is essential in avoiding common mistakes and writing correct programs.
In this paper, we present the first study of real-world concurrency bugs related to Kotlin coroutines. We examined 55 concurrency bug cases selected from 7 popular open-source repositories that use Kotlin coroutines, including IntelliJ IDEA, Firefox, and Ktor, and analyzed their bug characteristics and root causes. We identified common bug patterns related to asynchrony and Kotlin’s coroutine semantics, presenting them with their root causes, misconceptions that led to the bugs, and strategies for their automated detection. Overall, this study provides insight into programming with Kotlin coroutines concurrency and its pitfalls, aiming to shed light on common bug patterns and foster further research and development of concurrency analysis tools for Kotlin programs.
Wed 18 SepDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
15:30 - 16:45 | Software SystemsTechnical Papers at EI 2 Pichelmayer Chair(s): Mira Mezini TU Darmstadt; hessian.AI; National Research Center for Applied Cybersecurity ATHENE | ||
15:30 18mTalk | Understanding Concurrency Bugs in Real-World Programs with Kotlin Coroutines Technical Papers Bob Brockbernd Delft University of Technology, Nikita Koval JetBrains, Arie van Deursen Delft University of Technology, Burcu Kulahcioglu Ozkan Delft University of Technology | ||
15:48 18mTalk | Runtime Instrumentation for Reactive Components Technical Papers Luca Aceto Reykjavik University, Duncan Paul Attard University of Glasgow, Adrian Francalanza University of Malta, Anna Ingolfsdottir Reykjavik University | ||
16:07 18mTalk | HOBBIT: Hashed Object Based InTegrity Technical Papers Matthias Bernad μCSRL, CODE Research Institute, University of the Bundeswehr Munich, Stefan Brunthaler μCSRL, CODE Research Institute, University of the Bundeswehr Munich | ||
16:26 18mTalk | Pipit on the Post: proving pre- and post-conditions of reactive systems Technical Papers Amos Robinson Australian National University, Australia, Alex Potanin Australian National University |