Cooperate with the Valgrind instrumentation framework.
authorNoah Misch <noah@leadboat.com>
Thu, 27 Jun 2013 00:00:08 +0000 (20:00 -0400)
committerNoah Misch <noah@leadboat.com>
Thu, 27 Jun 2013 00:22:25 +0000 (20:22 -0400)
commit19085116eeecfde0a3fc1611eaffccc35bcec204
tree415f6a5e558f735c107cda09a81709898ee1f028
parenta855148a29b786b179308b3bd5c59fe5b67110d8
Cooperate with the Valgrind instrumentation framework.

Valgrind "client requests" in aset.c and mcxt.c teach Valgrind and its
Memcheck tool about the PostgreSQL allocator.  This makes Valgrind
roughly as sensitive to memory errors involving palloc chunks as it is
to memory errors involving malloc chunks.  Further client requests in
PageAddItem() and printtup() verify that all bits being added to a
buffer page or furnished to an output function are predictably-defined.
Those tests catch failures of C-language functions to fully initialize
the bits of a Datum, which in turn stymie optimizations that rely on
_equalConst().  Define the USE_VALGRIND symbol in pg_config_manual.h to
enable these additions.  An included "suppression file" silences nominal
errors we don't plan to fix.

Reviewed in earlier versions by Peter Geoghegan and Korry Douglas.
src/backend/access/common/printtup.c
src/backend/storage/page/bufpage.c
src/backend/tcop/postgres.c
src/backend/utils/mmgr/aset.c
src/backend/utils/mmgr/mcxt.c
src/include/pg_config_manual.h
src/include/utils/memdebug.h [new file with mode: 0644]
src/tools/valgrind.supp [new file with mode: 0644]