From 76e02bfc847f8c22a62d5217a9f8058c115fd2c9 Mon Sep 17 00:00:00 2001
From: Christopher Jones <cdj@fnal.gov>
Date: Wed, 15 Jan 2014 23:30:41 +0100
Subject: [PATCH] Added suppression entries for determining if TObject on heap

To determine if TObject is on the heap we read the value of a member
data before it has been set by the constructor. If it was heap
allocated the TObject::operator new will have filled special values
into the memory area. However, for stack allocated it is
unset. This makes valgrind report an error. Given we intend this
behavior, we suppress the message.
---
 etc/valgrind-root.supp | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/etc/valgrind-root.supp b/etc/valgrind-root.supp
index 45496bcbac9..08f295d62d1 100644
--- a/etc/valgrind-root.supp
+++ b/etc/valgrind-root.supp
@@ -482,6 +482,29 @@
    fun:_ZL20G__cpp_setup_global0v
 }
 
+######## ROOT TObject on heap
+
+{
+   TObject::TObject() uses uninitialized value
+   Memcheck:Cond
+   fun:_ZN7TObjectC1Ev
+   ...
+}
+
+{
+   TObject::TObject(const TObject&) uses uninitialized value
+   Memcheck:Cond
+   fun:_ZN7TObjectC1ERKS_
+   ...
+}
+
+{
+   gcc optimizer confuses valgrind on TObject::~TObject()
+   Memcheck:Cond
+   fun:_ZN7TObjectD1Ev
+   ...
+}
+
 ######### Misc
 
 {
-- 
GitLab