Re: strange valgrind failures (again) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: strange valgrind failures (again)
Date
Msg-id 20190115021130.fn5glrakkijmirjk@alap3.anarazel.de
Whole thread Raw
In response to strange valgrind failures (again)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: strange valgrind failures (again)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2019-01-15 03:07:10 +0100, Tomas Vondra wrote:
> I've started observing funny valgrind failures on Fedora 28, possibly
> after upgrading from 3.14.0-1 to 3.14.0-7 a couple of days ago. This
> time it does not seem like platform-specific issues, though - the
> failures all look like this:

Any chance you're compiling without USE_VALGRIND defined? IIRC these are
precisely what the VALGRIND_MAKE_MEM_DEFINED calls in inval.c are
intended to fight:
    /*
     * Define padding bytes in SharedInvalidationMessage structs to be
     * defined. Otherwise the sinvaladt.c ringbuffer, which is accessed by
     * multiple processes, will cause spurious valgrind warnings about
     * undefined memory being used. That's because valgrind remembers the
     * undefined bytes from the last local process's store, not realizing that
     * another process has written since, filling the previously uninitialized
     * bytes
     */
    VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));


Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: strange valgrind failures (again)
Next
From: Masahiko Sawada
Date:
Subject: Re: New vacuum option to do only freezing