Helgrind: a thread error detector
--track-lockorders=no|yes [default:
yes]
When enabled (the default), Helgrind performs lock order consistency checking. For some buggy programs, the large
number of lock order errors reported can become annoying, particularly if you’re only interested in race errors. You
may therefore find it helpful to disable lock order checking.
--history-level=none|approx|full [default:
full]
--history-level=full
(the default) causes Helgrind collects enough information about "old" accesses that it
can produce two stack traces in a race report -- both the stack trace for the current access, and the trace for the older,
conflicting access. To limit memory usage, "old" accesses stack traces are limited to a maximum of 8 entries, even if
--num-callers
value is bigger.
Collecting such information is expensive in both speed and memory, particularly for programs that do many inter-
thread synchronisation events (locks, unlocks, etc). Without such information, it is more difficult to track down the
root causes of races. Nonetheless, you may not need it in situations where you just want to check for the presence or
absence of races, for example, when doing regression testing of a previously race-free program.
--history-level=none
is the opposite extreme.
It causes Helgrind not to collect any information about
previous accesses. This can be dramatically faster than
--history-level=full
.
--history-level=approx
provides a compromise between these two extremes.
It causes Helgrind to
show a full trace for the later access, and approximate information regarding the earlier access.
This approx-
imate information consists of two stacks, and the earlier access is guaranteed to have occurred somewhere be-
tween program points denoted by the two stacks. This is not as useful as showing the exact stack for the pre-
vious access (as
--history-level=full
does), but it is better than nothing, and it is almost as fast as
--history-level=none
.
--conflict-cache-size=N [default:
1000000]
This flag only has any effect at
--history-level=full
.
Information about "old" conflicting accesses is stored in a cache of limited size, with LRU-style management. This
is necessary because it isn’t practical to store a stack trace for every single memory access made by the program.
Historical information on not recently accessed locations is periodically discarded, to free up space in the cache.
This option controls the size of the cache, in terms of the number of different memory addresses for which conflicting
access information is stored.
If you find that Helgrind is showing race errors with only one stack instead of the
expected two stacks, try increasing this value.
The minimum value is 10,000 and the maximum is 30,000,000 (thirty times the default value). Increasing the value
by 1 increases Helgrind’s memory requirement by very roughly 100 bytes, so the maximum value will easily eat up
three extra gigabytes or so of memory.
119