255
is out of order with respect to
memory store
of size 1 at address 0x7FD7BEBC068F (offset 0x3C068F in /mnt/pmem/file)
in /data/listing_12-38!main at listing_12-38.cpp:98 - 0x1DAF
in /lib64/libc.so.6!__libc_start_main at :
- 0x223D3
in /data/listing_12-38!_start at : - 0x1624
The Persistence Inspector report identifies an out-of-order store issue. The tool
says that incrementing the counter in line 91 (main at listing_12-38.cpp:91) is
out of order with respect to writing the valid flag inside a record in line 98 (main at
listing_12-38.cpp:98).
To perform out-of-order analysis with pmemcheck, we must introduce a new tool
called pmreorder. The pmreorder tool is included in PMDK from version 1.5 onward.
This stand- alone Python tool performs a consistency check of persistent programs
using a store reordering mechanism. The pmemcheck tool cannot do this type of analysis,
although it is still used to generate a detailed log of all the stores and flushes issued by an
application that pmreorder can parse. For example, consider Listing 12-41.
Listing 12-41. Running pmemcheck to generate a detailed log of all the stores
and flushes issued by Listing 12-38
$ valgrind --tool=pmemcheck -q --log-stores=yes --log-storesstacktraces=yes
--log-stores-stacktraces-depth=2 --print-summary=yes
--log-file=store_log.log ./listing_12-38
The meaning of each parameter is as follows:
• -q silences unnecessary pmemcheck logs that pmreorder cannot parse.
• --log-stores=yes tells pmemcheck to log all stores.
• --log-stores-stacktraces=yes dumps stacktrace with each logged
store. This helps locate issues in your source code.
• --log-stores-stacktraces-depth=2 is the depth of logged
stacktraces. Adjust according to the level of information you need.
Chapter 12 Debugging persistent MeMory appliCations
Précédent

- 279/457

Suivant