in #4619, fixeria wrote:
"
Assert failed conn->lchan ../../../../src/osmo-bsc/include/osmocom/bsc/gsm_data.h:1376
According to the backtrace, the crash originates from assignment_fsm_timer_cb(). This callback tries to update some counters:
int assignment_fsm_timer_cb(struct osmo_fsm_inst *fi)
{
struct gsm_subscriber_connection *conn = assignment_fi_conn(fi);
assignment_count_result(CTR_ASSIGNMENT_TIMEOUT); // New: b5ccf09fc4 2020-06-08 14:36:46
assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, "Timeout");
return 0;
}
so trying to follow (Ctrl+] in Vim) assignment_count_result() brings us to the macros hell:
#define assignment_count_result(counter) do { \
if (!conn->assignment.result_rate_ctr_done) { \
assignment_count(counter); /* <--- We go here */ \
conn->assignment.result_rate_ctr_done = true; \
} else \
LOG_ASSIGNMENT(conn, LOGL_DEBUG, \
"result rate counter already recorded, NOT counting as: %s %s\n", \
bsc_ctr_description[BSC_##counter].name, \
bsc_ctr_description[BSC_##counter].description); \
} while(0)
following the rabbit hole, we end up here:
/* Assume presence of local var 'conn' as struct gsm_subscriber_connection */
#define assignment_count(counter) do { \
struct gsm_bts *bts = conn_get_bts(conn); /* <--- Here is the party pooper! */ \
LOG_ASSIGNMENT(conn, LOGL_DEBUG, "incrementing rate counter: %s %s\n", \
bsc_ctr_description[BSC_##counter].name, \
bsc_ctr_description[BSC_##counter].description); \
rate_ctr_inc(&conn->network->bsc_ctrs->ctr[BSC_##counter]); \
rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_##counter]); \
} while(0)
so I think I found culprit:
commit b5ccf09fc4042c7fb1fdaaa6263961c40b32564e
Author: Daniel Willmann <dwillmann@sysmocom.de>
Date: Mon Jun 8 14:36:46 2020 +0200
Count assignment rates per BTS as well
This adds the assignment counters for the BTS as well and changes the
assignment_count() macro to increase both the counters for the BSC as
well as the BTS.
Related: SYS#4877
Change-Id: I0009e51d4caf68e762138d98e2e23d49acc3cc1a
"