Re: Recursive ReceiveSharedInvalidMessages not safe - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Recursive ReceiveSharedInvalidMessages not safe
Date
Msg-id 20140508163953.GB5556@awork2.anarazel.de
Whole thread Raw
In response to Re: Recursive ReceiveSharedInvalidMessages not safe  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2014-05-05 15:41:22 -0400, Tom Lane wrote:
> > After far, far too much confused head scratching, code reading, random
> > elog()s et al I found out that this is just because of a deficiency in
> > valgrind's undefinedness tracking. [...]
> > Unfortunately this cannot precisely be caught by valgrind's
> > suppressions. Thus I'd like to add memset(SharedInvalidationMessage msg,
> > 0) in AddCatcacheInvalidationMessage() et al. to suppress these
> > warnings. Imo we can just add them unconditionally, but if somebody else
> > prefers we can add #ifdef USE_VALGRIND around them.
>
> I'd be okay with USE_VALGRIND.  I'm not particularly hot on adding a
> memset for everybody just to make valgrind less confused.  Especially
> since that's really going to hide any problems, not fix them.

The attached patch does VALGRIND_MAKE_MEM_DEFINED() on the relevant
structs. That's already defined to empty if USE_VALGRIND isn't defined.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: andres@2ndquadrant.com
Date:
Subject: [PATCH] Fix harmless access to uninitialized memory in ri_triggers.c.
Next
From: Andres Freund
Date:
Subject: Re: Recursive ReceiveSharedInvalidMessages not safe