diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-21 17:13:23 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-27 15:40:01 +0100 |
commit | a99b42709a09b1b822da0e431bf3308da7b7a295 (patch) | |
tree | 0be940576b0b991e515ee5ecbec0d0456cfcbec1 /tests/msc_vlr/msc_vlr_tests.h | |
parent | 785fadc0d9a27e9706a421b933213330291f3dab (diff) |
add msc_vlr_test_call to reproduce a sanitizer error
On MT call, there is a bug in CC conn use which leads to an early free and
use-after-free.
Add msc_vlr_test_call to show both MO and MT call legs separately and reproduce
the failure. It is visible in a sanitizer build (on debian 9).
A subsequent patch will fix the bug: If0659a878deb383ed0300217e2c41c8c79b2b6a5
Related: OS#2672
Change-Id: I6c3ca0c660388b1e2c82df17ec540c846201b0c7
Diffstat (limited to 'tests/msc_vlr/msc_vlr_tests.h')
-rw-r--r-- | tests/msc_vlr/msc_vlr_tests.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h index 1cd391481..ee26ac40d 100644 --- a/tests/msc_vlr/msc_vlr_tests.h +++ b/tests/msc_vlr/msc_vlr_tests.h @@ -29,6 +29,7 @@ #include <osmocom/msc/gsm_data.h> #include <osmocom/msc/osmo_msc.h> #include <osmocom/msc/vlr.h> +#include <osmocom/msc/mncc.h> extern bool _log_lines; #define _log(fmt, args...) do { \ @@ -84,6 +85,11 @@ extern bool iu_release_sent; extern bool bssap_clear_expected; extern bool bssap_clear_sent; +extern uint32_t cc_to_mncc_tx_expected_msg_type; +extern const char *cc_to_mncc_tx_expected_imsi; +extern bool cc_to_mncc_tx_confirmed; +extern uint32_t cc_to_mncc_tx_got_callref; + static inline void expect_iu_release() { iu_release_expected = true; @@ -169,6 +175,17 @@ void check_talloc(void *msgb_ctx, void *tall_bsc_ctx, int expected_blocks); gsup_tx_confirmed = false; \ } while (0) +#define cc_to_mncc_expect_tx(imsi, msg_type) do \ +{ \ + if (cc_to_mncc_tx_expected_msg_type) { \ + log("Previous expected MNCC tx was not confirmed!"); \ + OSMO_ASSERT(!cc_to_mncc_tx_expected_msg_type); \ + } \ + cc_to_mncc_tx_expected_imsi = imsi; \ + cc_to_mncc_tx_expected_msg_type = msg_type; \ + cc_to_mncc_tx_confirmed = false; \ +} while (0) + void fake_time_start(); /* as macro to get the test file's source line number */ |