summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2014-11-14 15:58:00 +0000
committerAndres Freund2014-11-14 15:59:33 +0000
commit6c878edc1df9d4d9ad7ed4a7e1c34c0bf0f622b9 (patch)
tree70d421e7f57493833f4f4f9fa9a6471443a48a13
parenta15d387c22b794b0d2d037ce9f7b379ea8f153c0 (diff)
Add valgrind suppression for pg_atomic_init_u64.
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.
-rw-r--r--src/tools/valgrind.supp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/valgrind.supp b/src/tools/valgrind.supp
index 4721c0a6fb..0df95eabf1 100644
--- a/src/tools/valgrind.supp
+++ b/src/tools/valgrind.supp
@@ -104,3 +104,16 @@
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
+}