]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix entity renumbering in util/parse_tsan.py
authorMichał Kępień <michal@isc.org>
Thu, 15 Jun 2023 14:17:14 +0000 (16:17 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 15 Jun 2023 14:17:14 +0000 (16:17 +0200)
commit7f0790c82f4e54ceecba28d2969aa0d979d434d3
tree06c084356f319d4f7a3bf25d62c73f00ea08847e
parentf22046d61b66033867c86e13ff195a451427ebf8
Fix entity renumbering in util/parse_tsan.py

util/parse_tsan.py builds tables of mutexes, threads, and pointers it
finds in the TSAN report provided to it as a command-line argument and
then replaces all mentions of each of these entities so that they are
numbered sequentially in the processed report.  For example, this line:

    Cycle in lock order graph: M0 (...) => M5 (...) => M9 (...) => M0

is expected to become:

    Cycle in lock order graph: M1 (...) => M2 (...) => M3 (...) => M1

Problems arise when the gaps between mutex/thread identifiers present on
a single line are smaller than the total number of mutexes/threads found
by the script so far.  For example, the following line:

    Cycle in lock order graph: M0 (...) => M1 (...) => M2 (...) => M0

first gets turned into:

    Cycle in lock order graph: M1 (...) => M1 (...) => M2 (...) => M1

and then into:

    Cycle in lock order graph: M2 (...) => M2 (...) => M2 (...) => M2

In other words, lines like this become garbled due to information loss.

The problem stems from the fact that the numbering scheme the script
uses for identifying mutexes and threads is exactly the same as the one
used by TSAN itself.  Update util/parse_tsan.py so that it uses
zero-padded numbers instead, making the "overlapping" demonstrated above
impossible.
util/parse_tsan.py