Red Hat Training

A Red Hat training course is available for Red Hat Developer Toolset

B.7. Changes in Valgrind

Red Hat Developer Toolset 4.1 is distributed with Valgrind 3.11.0, which provides a number of bug fixes and enhancements over the version included in Red Hat Enterprise Linux and the previous version of Red Hat Developer Toolset.

B.7.1. Changes Since Red Hat Developer Toolset 4.0

The following bugs fixes and enhancements have been added since the release of Valgrind in Red Hat Developer Toolset 4.0:
  • The register allocator of the JIT (just-in-time) compiler is now significantly faster, making the JIT as a whole faster. so JIT-intensive activities, for example, program start, are faster by approximately 5%.
  • Support for the Intel AVX2 extensions is now more complete (on 64-bit targets only). On AVX2-capable hosts, the simulated CPUID now indicates AVX2 support.
  • The default value for the --smc-check option has been changed from stack to all-non-file on targets that provide automatic D-I cache coherence (AMD64 and IBM S/390). The result is to provide, by default, transparent support for JIT-generated and self-modifying code on all targets.
  • Valgrind now tries to automatically intercept user-defined alternate malloc and new allocator functions as if the program used the normal system (glibc) allocator. This makes it possible to use memory-tracing tools, such as Memcheck, on such programs out of the box. To only intercept malloc and new-related functions in system libraries, use the --soname-synonyms=somalloc=nouserintercepts option (where nouserintercepts can be any non-existing library name).
  • The following enhancements have been added to the Memcheck component of Valgrind:
    • The default value for the --leak-check-heuristics option has been changed from none to all. This helps to reduce the number of possibly lost blocks, in particular for C++ applications.
    • The default value for the --keep-stacktraces has been changed from malloc-then-free to malloc-and-free. This has a small cost in memory (one word per malloc-ed block), but it allows Memcheck to show the three stacktraces of a dangling reference: where the block was allocated, where it was freed, and where it is acccessed after being freed.
    • The default value for --partial-loads-ok option has been changed from no to yes, so as to avoid false positive errors resulting from some kinds of vectorised loops.
    • A new monitor command, xb addr len, shows the validity bits of len bytes at addr. The xb monitor command is easier to use than get_vbits when you need to associate byte data value with their corresponding validity bits.
    • The block_list monitor command has been enhanced:
      • It can now print a range of loss records.
      • It now accepts an optional argument, limited max_blocks to control the number of blocks printed.
      • If a block has been found using a heuristic, then block_list now shows the heuristic after the block size.
      • The loss records or blocks to be printed can be limited to the blocks found via specified heuristics.
    • A new command line option, --expensive-definedness-checks=yes|no, has been added. This is useful for avoiding occasional invalid uninitialized-value errors in optimised code. Runtime degradation can be an issue because it can amount up to 25%. The slowdown is application-specific. The default setting is no.