1 INTRODUCTION
With the support of multi-threaded technology,
operating systems and multi-core processor
technology, multi-threaded technology is no longer a
distant topic. However, in multithreaded
programming, concurrency introduces the possibility
of many errors that are not present in sequential
programming. In addition, due to the uncertainty of
thread scheduling, multithreaded programs may
behave differently when transferring from one
thread to another, which can lead to data race failure
(Erickson J, Musuvathi M, Burckhardt S 2010). The
fault is difficult to find and locate the program
through a few run out. Therefore, how to effectively
detect data race in multithreaded programs and give
fault information to programmers according to the
actual situation of the tested program is a very
worthy research question.
The main contributions of this paper are as follows:
(1) This paper describes three efficient data race
detection tools Helgrind, ThreadSanitizer and Maple,
according to their respective principles, working
methods and the specific implementation of a simple
exposition.
(2) In this paper, the three main data race testing tool
Helgrind, ThreadSanitizer and Maple do a
comparison, master their respective strengths and
weaknesses in order to project development in the
future, the delivery of reliable software to speed up
time to market.
2 DESIGN PRINCIPLES OF THREE DATA
RACE DETECTION TOOLS
In multithreaded program development, due to
the interleaving between the threads of uncertainty,
making the implementation process may be some
unpredictable behavior leading to program error.
One of the critical areas do not synchronize the work
of the resulting data race is the most troublesome
problem. Data race does not necessarily lead to
procedural errors. But the survey shows that 5% -
24% of data race will have a bad impact on the
program. They often occur in some low probability
of the occurrence of the interleaving sequence. In
reality, often need to spend a lot of time to locate,
the error caused as "corner error". If there are some
tools to help us do this thing like, this article
describes the next three Helgrind, ThreadSanitizer
Comparison of three efficient data race detection tools
S.X. Zhu & Y.N. Wu
Harbin University of Science and Technology, Harbin, China
ABSTRACT: Concurrent multi-core architectures make hard concurrency become a reality. In order to
benefit from the hardware concurrency, concurrent programming is becoming more and more popular.
However, due to the inherent concurrency and uncertainty, concurrent programs are prone to encounter
concurrency defects, and they are difficult to detect, debug and restore. Synchronization and data race are the
main factors leading to uncertainty. In the deterministic replay of multi-core parallel programs, the
implementation of synchronization is relatively easy, while detecting potential data race in the program has
certain difficulties in implementation. At the time of data race, at least two threads access the same memory
location, there is no enforced order constraint between visits, and at least one of the accesses is write. Current
race detectors can easily miss the right data race or generate a large number of false alarms. Therefore, to find
a highly efficient data race detection for the present and future are of great significance. This paper focuses on
the automatic data race detection technology, and elaborates on the principle, working mode and concrete
realization of Helgrind, ThreadSanitizer and Maple, which are open source tools in the industry. At the same
time, the similarities and differences between them are analyzed, compared and summarized.
KEYWORD: Data race detection; Concurrent defects; Helgrind; ThreadSanitizer; Maple