]> granicus.if.org Git - postgresql/commitdiff
Add valgrind suppression for pg_atomic_init_u64.
authorAndres Freund <andres@anarazel.de>
Fri, 14 Nov 2014 15:58:00 +0000 (16:58 +0100)
committerAndres Freund <andres@anarazel.de>
Fri, 14 Nov 2014 15:59:33 +0000 (16:59 +0100)
pg_atomic_init_u64 (indirectly) uses compare/exchange to guarantee
atomic writes on platforms where compare/exchange is available, but
64bit writes aren't atomic (yes, those exist). That leads to a
harmless read of the initial value of variable.

src/tools/valgrind.supp

index 4721c0a6fb6dbbc85a281088c75840c79c812838..0df95eabf12c879bdd07d772b8097c54572fcaff 100644 (file)
 
        fun:IsBinaryCoercible
 }
+
+# Atomic writes to 64bit atomic vars uses compare/exchange to
+# guarantee atomic writes of 64bit variables. pg_atomic_write is used
+# during initialization of the atomic variable, hat leads to an
+# initial read of the old, undefined, memory value. But that's just to
+# make sure the swap works correctly.
+{
+       uninitialized_atomic_init_u64
+       Memcheck:Cond
+       fun:pg_atomic_exchange_u64_impl
+       fun:pg_atomic_write_u64_impl
+       fun:pg_atomic_init_u64_impl
+}