libosmocore/tests
Neels Hofmeyr cd325efae5 gprs_bssgp: bssgp_fc_in(): fix mem leak on queue overflow
All successful and all error code paths of bssgp_fc_in() free the msgb, except
the code path calling fc_enqueue() when the msg is dropped (due to queue being
full, or failure to allocate).

Callers could theoretically catch the -ENOSPC return value and discard the
msgb. However, in other code paths, a callback's return value is returned,
which is expected to free the msgb, so such callback would have to never return
-ENOSPC when it freed the msgb. Much simpler semantics would be to free the
msgb in every code path, no matter which kind of error occurred.

Who is currently calling bssgp_fc_in and how do they handle the return value?
- bssgp_fc_test.c ignores the return value (and hits a mem leak aka sanitizer
  build failure if the queue is full).
- fc_timer_cb() ignores the return value.
- bssgp_tx_dl_ud() returns the bssgp_fc_in() rc.
  - which is returned by a cascade of functions leading up to being returned,
    for example, by gprs_llgmm_reset(), which is usually called with ignored
    return code.
At this point it is already fairly clear that bssgp_fc_in() should always free
the msgb, since the callers don't seem to distinguish even between error or
success, let alone between -ENOSPC or other errors.

bssgp_fc_test: assert that no msgbs remain unfreed after the tests.
Adjust expected results.

Helps fix sanitizer build on debian 9.

Change-Id: I00c62a104baeaad6a85883c380259c469aebf0df
2017-11-20 17:22:42 +01:00
..
a5 fix compiler warnings for a5 tests 2015-04-07 20:08:38 +02:00
abis abis_test: sanitize: fix msgb memleak 2017-11-18 10:30:58 +00:00
auth milenage_test: cosmetic: verify AUTS in comments 2017-03-15 13:46:58 +00:00
bits Add tests for bitvec_write_field() 2017-10-24 08:21:59 +00:00
bitvec Add function to get uninterrupted bit run 2017-01-06 10:37:42 +00:00
codec Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
coding libosmocoding: migrate transcoding routines from OsmoBTS 2017-03-07 01:06:38 +07:00
comp128 tests: test actual support status for auth. algo 2016-06-29 16:33:40 +00:00
conv tests/conv: add GSM 05.03 specific test 2017-04-30 02:59:42 +07:00
ctrl CTRL: add unit tests for CTRL command parsing 2017-09-27 14:04:23 +00:00
endian introduce byteswap.h with osmo_{htonl,ntohl,htons,ntohs} 2017-05-15 13:42:00 +02:00
fr fr_test: Speculative build fix for FreeBSD 2013-01-15 21:18:02 +01:00
fsm fsm_test.c: fix unreachable check 2017-05-15 12:51:15 +00:00
gb gprs_bssgp: bssgp_fc_in(): fix mem leak on queue overflow 2017-11-20 17:22:42 +01:00
gea Add GEA3 & GEA4 ciphers 2016-07-11 19:15:24 +00:00
gprs Make osmo_apn_to_str() more robust 2017-10-20 18:19:58 +00:00
gsm0408 gsm0408_test: sanitize: cleanup msgb 2017-11-18 10:30:58 +00:00
gsm0808 gsm0808_test: sanitize: fix msgb memleak 2017-11-18 10:30:58 +00:00
gsm23003 Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
gsup gsup: Add encoding/decoding for the pdp charging characteristics 2017-07-07 21:54:38 +02:00
kasumi kasumi_test.c: fix incomplete check 2017-05-14 20:27:22 +03:00
lapd lapd_test: sanitize: fix msgb memleaks 2017-11-18 10:30:58 +00:00
logging fix logging: log_set_category_filter() for internal DL* logging cats 2016-12-12 16:56:54 +01:00
loggingrb logginrb: Fix compiler warning about fprintf 2015-04-11 19:33:10 +02:00
msgb add function msgb_printf() to print formatted text into msg buf 2017-10-22 20:09:26 +00:00
msgfile build: resolve compiler warning about implicit delcaration 2014-10-04 11:49:23 +02:00
oap Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
osmo-auc-gen umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen 2017-08-29 12:46:46 +00:00
prbs Add pseudo-random bit sequence generator to libosmcoore 2017-07-10 23:42:02 +02:00
sercomm sercomm_test.c: return correctly in main 2017-06-22 18:14:17 +00:00
sim sim: Fix compiler warning and by this fixing the test result 2016-03-21 11:29:16 +01:00
sms sms_test.c: Remove test of deprecated wrapper function 2017-06-18 10:40:18 +02:00
smscb test: Fix compiler warnings on 64bit systems 2015-11-09 16:46:03 +00:00
socket osmo_sock_get_name(): clearly indicate local and remote 2017-07-03 17:29:05 +00:00
stats Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
strrb Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
timer timer: add osmo_timer_setup() 2017-05-09 12:10:51 +02:00
tlv tlv_test.c: Fix compilation warnings 2017-06-18 10:40:18 +02:00
ussd ussd: Decode interrogateSS that doesn't have test 2016-07-12 17:45:34 +02:00
utils Add unit tests for bcd2char and char2bcd conversion 2017-10-27 17:24:19 +02:00
vty Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
write_queue wqueue: Reject messges if queue is considered full 2016-12-09 11:37:37 +01:00
Makefile.am Print /proc/cpuinfo before executing testsuite 2017-11-16 16:57:33 +00:00
atlocal.in build: make check: disable sim_test when built with --disable-pcsc 2016-11-16 16:40:44 +00:00
testsuite.at Add tests for bitvec_write_field() 2017-10-24 08:21:59 +00:00