Change in osmo-msc[master]: msc_vlr_tests: make independent of libosmocore talloc

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/.

neels gerrit-no-reply at lists.osmocom.org
Sun Feb 7 23:00:58 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/22785 )


Change subject: msc_vlr_tests: make independent of libosmocore talloc
......................................................................

msc_vlr_tests: make independent of libosmocore talloc

The msc_vlr_tests verify whether any of the tests run contain msgb or
talloc memory leaks. So far they did so by fixating a specific number of
talloc blocks, which may break by library implementations changing.

Instead, verify that the test leaks no allocations by comparing talloc
blocks before and after each test.

When a leak is detected, print the full talloc report to stderr, which
makes the expected output mismatch the actual output and fails the test.

Related: OS#4311
Change-Id: I8537fa76d460c951302932a1bad4299f7fe398c9
---
M tests/msc_vlr/msc_vlr_test_authen_reuse.err
M tests/msc_vlr/msc_vlr_test_call.err
M tests/msc_vlr/msc_vlr_test_gsm_authen.err
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
M tests/msc_vlr/msc_vlr_test_hlr_reject.err
M tests/msc_vlr/msc_vlr_test_hlr_timeout.err
M tests/msc_vlr/msc_vlr_test_ms_timeout.err
M tests/msc_vlr/msc_vlr_test_no_authen.err
M tests/msc_vlr/msc_vlr_test_reject_concurrency.err
M tests/msc_vlr/msc_vlr_test_rest.err
M tests/msc_vlr/msc_vlr_test_ss.err
M tests/msc_vlr/msc_vlr_test_umts_authen.err
M tests/msc_vlr/msc_vlr_tests.c
13 files changed, 18 insertions(+), 346 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/85/22785/1

diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
index 7e6f261..43237cf 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_auth_use_twice_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -509,9 +506,6 @@
   llist_count(&msub_list) == 0
 ===== test_auth_use_twice_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_auth_use_twice_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1041,9 +1035,6 @@
   llist_count(&msub_list) == 0
 ===== test_auth_use_twice_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_auth_use_infinitely_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1657,9 +1648,6 @@
   llist_count(&msub_list) == 0
 ===== test_auth_use_infinitely_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_auth_use_infinitely_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2301,9 +2289,6 @@
   llist_count(&msub_list) == 0
 ===== test_auth_use_infinitely_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_auth_reuse_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2693,9 +2678,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_auth_reuse_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_auth_reuse_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -3101,9 +3083,3 @@
   llist_count(&msub_list) == 0
 ===== test_no_auth_reuse_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err
index 21ccd2c..1bcc489 100644
--- a/tests/msc_vlr/msc_vlr_test_call.err
+++ b/tests/msc_vlr/msc_vlr_test_call.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_call_mo
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -473,9 +470,6 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 4)
 ===== test_call_mo: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_call_mt
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -944,9 +938,6 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 5)
 ===== test_call_mt: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_call_mt2
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -1369,9 +1360,6 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 5)
 ===== test_call_mt2: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_call_mo_to_unknown
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -1797,9 +1785,6 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 4)
 ===== test_call_mo_to_unknown: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_call_mo_to_unknown_timeout
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -2221,9 +2206,3 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 4)
 ===== test_call_mo_to_unknown_timeout: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err
index 3677a36..f27d826 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err
+++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_authen
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -589,9 +586,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_authen: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_authen_tmsi
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1420,9 +1414,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_authen_tmsi: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_authen_imei
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1734,9 +1725,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_authen_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_authen_imei_nack
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2001,9 +1989,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_authen_imei_nack: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_authen_imei_err
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2269,9 +2254,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_authen_imei_err: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_authen_tmsi_imei
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2624,9 +2606,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_authen_tmsi_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_milenage_authen
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -3188,9 +3167,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_milenage_authen: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_wrong_sres_length
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -3333,9 +3309,3 @@
   llist_count(&msub_list) == 0
 ===== test_wrong_sres_length: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
index 2410ff6..e55c14c 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
+++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ciph
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -657,9 +654,6 @@
   llist_count(&msub_list) == 0
 ===== test_ciph: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ciph_tmsi
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1363,9 +1357,6 @@
   llist_count(&msub_list) == 0
 ===== test_ciph_tmsi: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ciph_imei
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1684,9 +1675,6 @@
   llist_count(&msub_list) == 0
 ===== test_ciph_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ciph_imeisv
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1970,9 +1958,6 @@
   llist_count(&msub_list) == 0
 ===== test_ciph_imeisv: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ciph_tmsi_imei
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2332,9 +2317,6 @@
   llist_count(&msub_list) == 0
 ===== test_ciph_tmsi_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_gsm_ciph_in_umts_env
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2935,9 +2917,6 @@
   llist_count(&msub_list) == 0
 ===== test_gsm_ciph_in_umts_env: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_a5_3_supported
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -3585,9 +3564,6 @@
   llist_count(&msub_list) == 0
 ===== test_a5_3_supported: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_cm_service_needs_classmark_update
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -4213,9 +4189,3 @@
   llist_count(&msub_list) == 0
 ===== test_cm_service_needs_classmark_update: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err
index d4ed53a..40b26d2 100644
--- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err
+++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_rej_auth_info_unknown_imsi
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -100,9 +97,6 @@
   llist_count(&msub_list) == 0
 ===== test_hlr_rej_auth_info_unknown_imsi: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_rej_auth_info_net_fail
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -201,9 +195,6 @@
   llist_count(&msub_list) == 0
 ===== test_hlr_rej_auth_info_net_fail: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_rej_auth_info_net_fail_reuse_tuples
 
 
@@ -531,9 +522,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_hlr_rej_auth_info_net_fail_reuse_tuples: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples
 
 
@@ -799,9 +787,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples
 
 
@@ -1068,9 +1053,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_acc_but_no_auth_tuples
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1168,9 +1150,6 @@
   llist_count(&msub_list) == 0
 ===== test_hlr_acc_but_no_auth_tuples: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_rej_lu
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1273,9 +1252,6 @@
   llist_count(&msub_list) == 0
 ===== test_hlr_rej_lu: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_no_insert_data
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1391,9 +1367,3 @@
 DVLR freeing VLR subscr IMSI-901700000004620 (max total use count was 5)
 ===== test_hlr_no_insert_data: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err
index 51aa913..0821a71 100644
--- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err
+++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_timeout_lu_auth_info
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -109,9 +106,6 @@
   lu_result_sent == 2
 ===== test_hlr_timeout_lu_auth_info: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_hlr_timeout_lu_upd_loc_result
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP LU request to HLR
@@ -238,9 +232,3 @@
   lu_result_sent == 2
 ===== test_hlr_timeout_lu_upd_loc_result: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err
index a64672a..0663f9d 100644
--- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err
+++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ms_timeout_lu_auth_resp
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -128,9 +125,6 @@
   lu_result_sent == 2
 ===== test_ms_timeout_lu_auth_resp: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ms_timeout_cm_auth_resp
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -403,9 +397,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_ms_timeout_cm_auth_resp: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ms_timeout_paging
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP LU request to HLR
@@ -713,9 +704,6 @@
   llist_count(&msub_list) == 0
 ===== test_ms_timeout_paging: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_classmark_update_timeout
 - Total time passed: 0.000000 s
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -866,9 +854,3 @@
   lu_result_sent == 2
 ===== test_classmark_update_timeout: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err
index a353949..755f463 100644
--- a/tests/msc_vlr/msc_vlr_test_no_authen.err
+++ b/tests/msc_vlr/msc_vlr_test_no_authen.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -456,9 +453,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_tmsi
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1147,9 +1141,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_tmsi: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_imei
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1400,9 +1391,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_tmsi_imei
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1688,9 +1676,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_tmsi_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_imeisv
 - Location Update request causes an IMEISV ID request back to the MS
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1911,9 +1896,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_imeisv: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_imeisv_imei
 - Location Update request causes an IMEISV ID request back to the MS
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2145,9 +2127,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_imeisv_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_imeisv_tmsi
 - Location Update request causes an IMEISV ID request back to the MS
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2615,9 +2594,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_imeisv_tmsi: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_imeisv_tmsi_imei
 - Location Update request causes an IMEISV ID request back to the MS
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2886,9 +2862,6 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_imeisv_tmsi_imei: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_no_authen_subscr_expire
 - Total time passed: 0.000000 s
 - Total time passed: 61.000000 s
@@ -3023,9 +2996,3 @@
   llist_count(&msub_list) == 0
 ===== test_no_authen_subscr_expire: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err
index 9faec63..b211fbf 100644
--- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err
+++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_2nd_conn
 - Location Update Request on one connection
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -191,9 +188,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_reject_2nd_conn: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_lu_during_lu
 - Location Update Request
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -334,9 +328,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_reject_lu_during_lu: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_cm_during_lu
 - Location Update Request
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -482,9 +473,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_reject_cm_during_lu: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_paging_resp_during_lu
 - Location Update Request
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -624,9 +612,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_reject_paging_resp_during_lu: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_lu_during_cm
 
 
@@ -864,9 +849,6 @@
   llist_count(&msub_list) == 0
 ===== test_reject_lu_during_cm: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_cm_during_cm
 
 
@@ -1109,9 +1091,6 @@
   llist_count(&msub_list) == 0
 ===== test_reject_cm_during_cm: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_paging_resp_during_cm
 
 
@@ -1338,9 +1317,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_reject_paging_resp_during_cm: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_lu_during_paging_resp
 
 
@@ -1642,9 +1618,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 6)
 ===== test_reject_lu_during_paging_resp: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_accept_cm_during_paging_resp
 
 
@@ -1970,9 +1943,6 @@
   llist_count(&msub_list) == 0
 ===== test_accept_cm_during_paging_resp: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_reject_paging_resp_during_paging_resp
 
 
@@ -2271,9 +2241,3 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 6)
 ===== test_reject_paging_resp_during_paging_resp: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err
index 5e44f31..f27108c 100644
--- a/tests/msc_vlr/msc_vlr_test_rest.err
+++ b/tests/msc_vlr/msc_vlr_test_rest.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_cm_service_without_lu
 - CM Service Request without a prior Location Updating
   MSC <--GERAN-A-- MS: GSM48_MT_MM_CM_SERV_REQ
@@ -64,9 +61,6 @@
   llist_count(&msub_list) == 0
 ===== test_cm_service_without_lu: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_two_lu
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -407,9 +401,6 @@
   llist_count(&msub_list) == 0
 ===== test_two_lu: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_lu_unknown_tmsi
 - Location Update request with unknown TMSI sends ID Request for IMSI
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -589,9 +580,3 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x23422342 (max total use count was 5)
 ===== test_lu_unknown_tmsi: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_ss.err b/tests/msc_vlr/msc_vlr_test_ss.err
index 3b324d3..e83cb01 100644
--- a/tests/msc_vlr/msc_vlr_test_ss.err
+++ b/tests/msc_vlr/msc_vlr_test_ss.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ss_ussd_mo_geran
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -240,9 +237,6 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_ss_ussd_mo_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_ss_ussd_no_geran
 - Location Update request causes a GSUP LU request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -506,9 +500,3 @@
 DVLR freeing VLR subscr IMSI-901700000004620:MSISDN-46071 (max total use count was 5)
 ===== test_ss_ussd_no_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err
index 42ed422..be858b5 100644
--- a/tests/msc_vlr/msc_vlr_test_umts_authen.err
+++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err
@@ -1,7 +1,4 @@
 DLMGCP MGCP client: using endpoint domain '@mgw'
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -607,9 +604,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1215,9 +1209,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_auth_ciph_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -1847,9 +1838,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_auth_ciph_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_resync_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2081,9 +2069,6 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 4)
 ===== test_umts_authen_resync_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_resync_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2315,9 +2300,6 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 4)
 ===== test_umts_authen_resync_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_auth_ciph_resync_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2559,9 +2541,6 @@
 DVLR freeing VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (max total use count was 4)
 ===== test_umts_auth_ciph_resync_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_too_short_res_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2677,9 +2656,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_too_short_res_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_too_short_res_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2795,9 +2771,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_too_short_res_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_too_long_res_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -2913,9 +2886,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_too_long_res_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_too_long_res_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -3031,9 +3001,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_too_long_res_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_only_sres_geran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--GERAN-A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -3149,9 +3116,6 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_only_sres_geran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
 ===== test_umts_authen_only_sres_utran
 - Location Update request causes a GSUP Send Auth Info request to HLR
   MSC <--UTRAN-Iu-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@@ -3267,9 +3231,3 @@
   llist_count(&msub_list) == 0
 ===== test_umts_authen_only_sres_utran: SUCCESS
 
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
-full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 21
-
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 07a3927..87d1abd 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -45,6 +45,7 @@
 #include "msc_vlr_tests.h"
 
 void *msc_vlr_tests_ctx = NULL;
+void *msgb_ctx = NULL;
 
 bool _log_lines = false;
 
@@ -1043,42 +1044,6 @@
 	fake_time_passes(0, 0);
 }
 
-static void check_talloc(void *msgb_ctx, void *msc_vlr_tests_ctx)
-{
-	/* Verifying that the msgb context is empty */
-	talloc_report_full(msgb_ctx, stderr);
-	/* Expecting these to stick around in msc_vlr_tests_ctx:
-	 * full talloc report on 'msgb' (total      0 bytes in   1 blocks)
-	 * talloc_total_blocks(tall_bsc_ctx) == 21
-	 * full talloc report on 'msc_vlr_tests_ctx' (total   6571 bytes in  21 blocks)
-	 *     struct osmo_gsup_client        contains    264 bytes in   1 blocks (ref 0) 0x5605f2ea2e90
-	 *     struct gsm_network             contains   4806 bytes in  13 blocks (ref 0) 0x5605f2ea1b60
-	 *         struct mgcp_client             contains    688 bytes in   1 blocks (ref 0) 0x5605f2ea3200
-	 *         struct sccp_ran_inst           contains    152 bytes in   1 blocks (ref 0) 0x5605f2ea3100
-	 *         struct sccp_ran_inst           contains    152 bytes in   1 blocks (ref 0) 0x5605f2ea3000
-	 *         struct gsup_client_mux         contains    152 bytes in   2 blocks (ref 0) 0x5605f2ea2d20
-	 *             struct ipaccess_unit           contains     64 bytes in   1 blocks (ref 0) 0x5605f2ea2de0
-	 *         struct vlr_instance            contains    264 bytes in   2 blocks (ref 0) 0x5605f2ea2b40
-	 *             struct osmo_nri_ranges         contains     16 bytes in   1 blocks (ref 0) 0x5605f2ea2ca0
-	 *         no_gsup_server                 contains     15 bytes in   1 blocks (ref 0) 0x5605f2ea2ac0
-	 *         stat_item.c:96                 contains    144 bytes in   2 blocks (ref 0) 0x5605f2ea2950
-	 *             stat_item.c:118                contains     96 bytes in   1 blocks (ref 0) 0x5605f2ea29f0
-	 *         rate_ctr.c:234                 contains   2352 bytes in   1 blocks (ref 0) 0x5605f2ea1fb0
-	 *         sms.db                         contains      7 bytes in   1 blocks (ref 0) 0x5605f2ea1f40
-	 *     logging                        contains   1501 bytes in   5 blocks (ref 0) 0x5605f2ea1360
-	 *         struct log_target              contains    244 bytes in   2 blocks (ref 0) 0x5605f2ea1990
-	 *             struct log_category            contains     76 bytes in   1 blocks (ref 0) 0x5605f2ea1aa0
-	 *         struct log_info                contains   1256 bytes in   2 blocks (ref 0) 0x5605f2ea13d0
-	 *             struct log_info_cat            contains   1216 bytes in   1 blocks (ref 0) 0x5605f2ea1460
-	 *     msgb                           contains      0 bytes in   1 blocks (ref 0) 0x5605f2ea12f0
-	 */
-	fprintf(stderr, "talloc_total_blocks(tall_bsc_ctx) == %zu\n",
-		talloc_total_blocks(msc_vlr_tests_ctx));
-	if (talloc_total_blocks(msc_vlr_tests_ctx) != 21)
-		talloc_report_full(msc_vlr_tests_ctx, stderr);
-	fprintf(stderr, "\n");
-}
-
 static struct {
 	bool verbose;
 	int run_test_nr;
@@ -1130,28 +1095,39 @@
 	}
 }
 
-void *msgb_ctx = NULL;
-
 static void run_tests(int nr)
 {
 	int test_nr;
 
-	check_talloc(msgb_ctx, msc_vlr_tests_ctx);
-
 	nr--; /* arg's first test is 1, in here it's 0 */
 	for (test_nr = 0; msc_vlr_tests[test_nr]; test_nr++) {
+		size_t talloc_blocks_before_test;
+
 		if (nr >= 0 && test_nr != nr)
 			continue;
 
 		if (cmdline_opts.verbose)
 			fprintf(stderr, "(test nr %d)\n", test_nr + 1);
 
+		talloc_blocks_before_test = talloc_total_blocks(msc_vlr_tests_ctx);
+
 		msc_vlr_tests[test_nr]();
 
+		if (talloc_total_blocks(msc_vlr_tests_ctx) != talloc_blocks_before_test) {
+			fprintf(stderr, "ERROR: talloc leak: %zu blocks\n",
+				talloc_total_blocks(msc_vlr_tests_ctx) - talloc_blocks_before_test);
+			talloc_report_full(msc_vlr_tests_ctx, stderr);
+			fprintf(stderr, "\n");
+		}
+
+		if (talloc_total_blocks(msgb_ctx) > 1) {
+			fprintf(stderr, "ERROR: msgb leak:\n");
+			talloc_report_full(msgb_ctx, stderr);
+			fprintf(stderr, "\n");
+		}
+
 		if (cmdline_opts.verbose)
 			fprintf(stderr, "(test nr %d)\n", test_nr + 1);
-
-		check_talloc(msgb_ctx, msc_vlr_tests_ctx);
 	}
 }
 
@@ -1256,6 +1232,5 @@
 
 	printf("Done\n");
 
-	check_talloc(msgb_ctx, msc_vlr_tests_ctx);
 	return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/22785
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I8537fa76d460c951302932a1bad4299f7fe398c9
Gerrit-Change-Number: 22785
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210207/fdf0df27/attachment.htm>


More information about the gerrit-log mailing list