osmo-pcu/tests/alloc
Pau Espin d76e3a3427 Make sure GprsMs free() also frees its tbfs
This fixes TBF objects leaking and ending up alive when the MS object is
explicitly freed through talloc_free (and sporadically
crashing TbfTest once a timeout for them occur).

This mostly affects unit tests, where most of the explicit free()
happens.
In osmo-pcu, in general, the GprsMs object only gets _free() called when
its resource count reaches 0, aka no more TBFs are attached to it. Hence
in general GprsMs object is freed() only when no TBFs (to be leaked) are
present.
However, in the unit tests it's usual that we want to wipe the entire
context by eg. feeing the PCU, the BTS or MS object, which should also
free the related TBFs.

When running osmo-pcu this may only be an issue when the MS object is
freed explicitly, which could happen for instance when a BTS is torn down,
ie. PCUIF going down, moment at which all GprsMs of that BTS are freed.
But in there actually it iterates over PDCHs to free all TBFs, so it's
fine.
If we iterated over MS, this could have ended up in a crash, like
it happened in TbfTest sporadically, but it's not a bit problem if we
crash + restart at that time since anyway the BTS is gone ore just
getting up around that time.

Related: OS#6359
Change-Id: Ibbdec94acb8132be20508d3178d88da44bfaf91d
2024-03-25 21:09:25 +01:00
..
AllocTest.cpp pcu_l1_if_phy: fix API function names 2023-05-03 09:57:38 +02:00
AllocTest.err Make sure GprsMs free() also frees its tbfs 2024-03-25 21:09:25 +01:00
AllocTest.ok ms: Rewrite MS release lifecycle 2023-04-20 20:40:52 +02:00
MslotTest.cpp pcu_l1_if_phy: fix API function names 2023-05-03 09:57:38 +02:00
MslotTest.ok gprs_rlc_ts_alloc: ensure no rolling slots are allocated 2021-01-15 15:50:41 +00:00