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

From Tomas Vondra
Subject strange valgrind failures (again)
Date
Msg-id 0612efa6-a3c2-085c-38c2-71ad315b69a4@2ndquadrant.com
Whole thread Raw
Responses Re: strange valgrind failures (again)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

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:

==20974== Conditional jump or move depends on uninitialised value(s)
==20974==    at 0xA02088: calc_bucket (dynahash.c:870)
==20974==    by 0xA021BA: hash_search_with_hash_value (dynahash.c:963)
==20974==    by 0xA020EE: hash_search (dynahash.c:909)
==20974==    by 0x88DAB3: smgrclosenode (smgr.c:358)
==20974==    by 0x9D6C01: LocalExecuteInvalidationMessage (inval.c:607)
==20974==    by 0x86C44F: ReceiveSharedInvalidMessages (sinval.c:121)
==20974==    by 0x9D6D83: AcceptInvalidationMessages (inval.c:681)
==20974==    by 0x539B6B: AtStart_Cache (xact.c:980)
==20974==    by 0x53AA6C: StartTransaction (xact.c:1915)
==20974==    by 0x53B6F0: StartTransactionCommand (xact.c:2685)
==20974==    by 0x892EFB: start_xact_command (postgres.c:2475)
==20974==    by 0x89083E: exec_simple_query (postgres.c:923)
==20974==    by 0x894E7B: PostgresMain (postgres.c:4143)
==20974==    by 0x7F553D: BackendRun (postmaster.c:4412)
==20974==    by 0x7F4CA1: BackendStartup (postmaster.c:4084)
==20974==    by 0x7F12A0: ServerLoop (postmaster.c:1757)
==20974==    by 0x7F08CF: PostmasterMain (postmaster.c:1365)
==20974==    by 0x728E33: main (main.c:228)
==20974==  Uninitialised value was created by a stack allocation
==20974==    at 0x9D65D4: AddCatcacheInvalidationMessage (inval.c:339)
==20974==

==20974== Use of uninitialised value of size 8
==20974==    at 0xA021FD: hash_search_with_hash_value (dynahash.c:968)
==20974==    by 0xA020EE: hash_search (dynahash.c:909)
==20974==    by 0x88DAB3: smgrclosenode (smgr.c:358)
==20974==    by 0x9D6C01: LocalExecuteInvalidationMessage (inval.c:607)
==20974==    by 0x86C44F: ReceiveSharedInvalidMessages (sinval.c:121)
==20974==    by 0x9D6D83: AcceptInvalidationMessages (inval.c:681)
==20974==    by 0x539B6B: AtStart_Cache (xact.c:980)
==20974==    by 0x53AA6C: StartTransaction (xact.c:1915)
==20974==    by 0x53B6F0: StartTransactionCommand (xact.c:2685)
==20974==    by 0x892EFB: start_xact_command (postgres.c:2475)
==20974==    by 0x89083E: exec_simple_query (postgres.c:923)
==20974==    by 0x894E7B: PostgresMain (postgres.c:4143)
==20974==    by 0x7F553D: BackendRun (postmaster.c:4412)
==20974==    by 0x7F4CA1: BackendStartup (postmaster.c:4084)
==20974==    by 0x7F12A0: ServerLoop (postmaster.c:1757)
==20974==    by 0x7F08CF: PostmasterMain (postmaster.c:1365)
==20974==    by 0x728E33: main (main.c:228)
==20974==  Uninitialised value was created by a stack allocation
==20974==    at 0x9D65D4: AddCatcacheInvalidationMessage (inval.c:339)
==20974==

There are more reports in the attached log, but what they all share is
dynahash and invalidations. Which might be an arguments against a
possible valgrind bug, because that would (probably?) affect various
other places.

It's reproducible quite far back (a couple thousand commits, at least),
so it does not seem like caused by a recent commit either.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: Libpq support to connect to standby server as priority
Next
From: Andres Freund
Date:
Subject: Re: strange valgrind failures (again)