|
Detecting race conditions in Java programs using dynamic analysis
M. Ermakov, S. Vartanov Department of Computational Mathematics and Cybernethics, Moscow State University
Abstract:
Multithreading support is one of Java programming language built-in features. Synchronization defects are a serious issue despite the extensive thread processing API provided by standard classes. One of the most common synchronization defects is a race condition. It arises when two different threads read and modify shared data and data access order is not fixed. This paper focuses on an approach to automatically detect race conditions using dynamic analysis. The main advantage of dynamic analysis is the lack of false positives if program under analysis fits a number of requirements. Our approach for dynamic analysis uses static bytecode instrumentation to extract execution trace at run-time which allows to track usage for thread synchronization methods and functions. Generated trace is a concrete execution model which is processed to identify happen-before relations and lock sets for possible data race detection. We use Coffee Machine tool for static instrumentation. Static instrumentation approach is applicable even to virtual machines which do not provide support for dynamic instrumentation. We use ThreadSanitizer Offline to process generated trace and detect race conditions. While debug information in bytecode is unnecessary it provides more precise error messages. Described tool chain has been tested on a set of open source projects.
Keywords:
dynamic analysis, race condition, synchronization defects.
Citation:
M. Ermakov, S. Vartanov, “Detecting race conditions in Java programs using dynamic analysis”, Proceedings of ISP RAS, 27:2 (2015), 39–52
Linking options:
https://www.mathnet.ru/eng/tisp121 https://www.mathnet.ru/eng/tisp/v27/i2/p39
|
Statistics & downloads: |
Abstract page: | 181 | Full-text PDF : | 213 | References: | 41 |
|