Change in gapk[master]: tests: make both Valgrind and LeakSanitizer happy

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jul 3 15:27:47 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9793 )

Change subject: tests: make both Valgrind and LeakSanitizer happy
......................................................................

tests: make both Valgrind and LeakSanitizer happy

The talloc_enable_null_tracking() actually allocates a new talloc
context, which makes both Valgrind and LeakSanitizer angry. This
context should be freed by the talloc_disable_null_tracking().

Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be
---
M tests/ecu/ecu_fr_test.c
M tests/io/pq_file_test.c
M tests/io/pq_rtp_test.c
M tests/procqueue/pq_test.c
4 files changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/tests/ecu/ecu_fr_test.c b/tests/ecu/ecu_fr_test.c
index 372df25..609112f 100644
--- a/tests/ecu/ecu_fr_test.c
+++ b/tests/ecu/ecu_fr_test.c
@@ -143,5 +143,8 @@
 	/* Make sure we have no memleaks */
 	talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
 
+	/* Make both Valgrind and LeakSanitizer happy */
+	talloc_disable_null_tracking();
+
 	return 0;
 }
diff --git a/tests/io/pq_file_test.c b/tests/io/pq_file_test.c
index 6691db3..664acf7 100644
--- a/tests/io/pq_file_test.c
+++ b/tests/io/pq_file_test.c
@@ -145,5 +145,8 @@
 	/* Print talloc memory hierarchy */
 	talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
 
+	/* Make both Valgrind and LeakSanitizer happy */
+	talloc_disable_null_tracking();
+
 	return 0;
 }
diff --git a/tests/io/pq_rtp_test.c b/tests/io/pq_rtp_test.c
index f4070b7..2c1bd41 100644
--- a/tests/io/pq_rtp_test.c
+++ b/tests/io/pq_rtp_test.c
@@ -345,5 +345,8 @@
 	/* Memory leak detection test */
 	talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
 
+	/* Make both Valgrind and LeakSanitizer happy */
+	talloc_disable_null_tracking();
+
 	return 0;
 }
diff --git a/tests/procqueue/pq_test.c b/tests/procqueue/pq_test.c
index 198108d..84b3992 100644
--- a/tests/procqueue/pq_test.c
+++ b/tests/procqueue/pq_test.c
@@ -369,5 +369,8 @@
 	printf("Processing queue deallocation test:\n");
 	talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
 
+	/* Make both Valgrind and LeakSanitizer happy */
+	talloc_disable_null_tracking();
+
 	return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/9793
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be
Gerrit-Change-Number: 9793
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180703/51f5a3fe/attachment.htm>


More information about the gerrit-log mailing list