From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid need for valgrind suppressions for pg_atomic_init_u64 on s
Date: Tue, 09 Jun 2020 03:24:56 +0000
Message-ID: <E1jiUsi-0004C5-8P@gemulon.postgresql.org> (raw)
Avoid need for valgrind suppressions for pg_atomic_init_u64 on some platforms.
Previously we used pg_atomic_write_64_impl inside
pg_atomic_init_u64. That works correctly, but on platforms without
64bit single copy atomicity it could trigger spurious valgrind errors
about uninitialized memory, because we use compare_and_swap for atomic
writes on such platforms.
I previously suppressed one instance of this problem (6c878edc1df),
but as Tom reports that wasn't enough. As the atomic variable cannot
yet be concurrently accessible during initialization, it seems better
to have pg_atomic_init_64_impl set the value directly.
Change pg_atomic_init_u32_impl for symmetry.
Reported-By: Tom Lane
Author: Andres Freund
Discussion: https://postgr.es/m/1714601.1591503815@sss.pgh.pa.us
Backpatch: 9.5-
Branch
------
REL_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/20fd90febc2c2429a0340d476cccc6922f581305
Modified Files
--------------
src/include/port/atomics/generic.h | 4 ++--
src/tools/valgrind.supp | 14 --------------
2 files changed, 2 insertions(+), 16 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: pgsql: Avoid need for valgrind suppressions for pg_atomic_init_u64 on s
In-Reply-To: <E1jiUsi-0004C5-8P@gemulon.postgresql.org>
References: <E1jiUsi-0004C5-8P@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox