aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-05-06 14:56:42 +0200
committerneels <nhofmeyr@sysmocom.de>2022-05-06 15:47:14 +0000
commita09d78faa97b087e8a17cf29484caf4ffbc27b9e (patch)
tree042a24f71bb24ac91305094a855cfa2e43ef05b0 /src
parent5a2347d4bcf7acdef3819c380f66be30c8bf6fa1 (diff)
fix fallout from: 'stats: new trackers for lchan life duration'
In lchan_fsm_cleanup(), ensure that the time_cc timer is actually inactive before deallocating. Do so via lchan_reset(), to also make sure the timer is stopped in all other situations where the lchan is deactivated. This fixes an infinite-loop deadlock as described in OS#5554: - run BSC_Tests.TC_chan_act_ack_est_ind_noreply - restart the BTS process after the test is done - osmo-bsc enters infinite loop in osmo_timer_del() The reason is that lchan_fsm_cleanup() fails to stop a running active_cc timer upon lchan deallocation. TC_chan_act_ack_est_ind_noreply incidentally terminates OML while the timer is still active. Related: OS#5554 Change-Id: I901bb86a78d7d021c8efe751fd9d93e5956ac0e0
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/lchan_fsm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index d693189f1..6854465be 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -528,6 +528,14 @@ static void lchan_reset(struct gsm_lchan *lchan)
lchan->mgw_endpoint_ci_bts = NULL;
}
+ /* Ensure that the osmo_timer in lchan->active_cc is stopped. This is particularly important for lchan FSM
+ * deallocation, so that the timer is no longer active when the lchan FSM instance gets discarded
+ * (lchan_fsm_cleanup() calls this function), see OS#5554.
+ *
+ * Besides that, it is also good to make sure the timer is stopped when the lchan resets, to avoid any false
+ * counts being accumulated, however obscure an error situation may be. */
+ osmo_time_cc_cleanup(&lchan->active_cc);
+
/* NUL all volatile state */
*lchan = (struct gsm_lchan){
.ts = lchan->ts,