Commit 40065671 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/fix-segfault-multi-ue' into integration_2024_w46 (!3108)

Prevent segfaults in gNB stack

Three fixes for segfaults, discovered while running with many UEs.
See commit messages for more details.
parents 12f29b82 7e3df5f1
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
<desc>iperf (DL/TCP)(30 sec)(multi-ue profile)</desc> <desc>iperf (DL/TCP)(30 sec)(multi-ue profile)</desc>
<iperf_args>-t 30 -R</iperf_args> <iperf_args>-t 30 -R</iperf_args>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id> <id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<iperf_tcp_rate_target>4</iperf_tcp_rate_target> <iperf_tcp_rate_target>3.9</iperf_tcp_rate_target>
<svr_id>oc-cn5g</svr_id> <svr_id>oc-cn5g</svr_id>
</testCase> </testCase>
......
...@@ -613,7 +613,7 @@ static void pf_dl(module_id_t module_id, ...@@ -613,7 +613,7 @@ static void pf_dl(module_id_t module_id,
gNB_MAC_INST *mac = RC.nrmac[module_id]; gNB_MAC_INST *mac = RC.nrmac[module_id];
NR_ServingCellConfigCommon_t *scc=mac->common_channels[0].ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc=mac->common_channels[0].ServingCellConfigCommon;
// UEs that could be scheduled // UEs that could be scheduled
UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0}; UEsched_t UE_sched[MAX_MOBILES_PER_GNB + 1] = {0};
int remainUEs = max_num_ue; int remainUEs = max_num_ue;
int curUE = 0; int curUE = 0;
int CC_id = 0; int CC_id = 0;
......
...@@ -2962,8 +2962,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo ...@@ -2962,8 +2962,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
static void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group) static void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group)
{ {
DevAssert(cell_group != NULL);
/* remove a reconfigurationWithSync, we don't need it anymore */ /* remove a reconfigurationWithSync, we don't need it anymore */
if (cell_group->spCellConfig->reconfigurationWithSync != NULL) { if (cell_group->spCellConfig && cell_group->spCellConfig->reconfigurationWithSync != NULL) {
ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cell_group->spCellConfig->reconfigurationWithSync); ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cell_group->spCellConfig->reconfigurationWithSync);
cell_group->spCellConfig->reconfigurationWithSync = NULL; cell_group->spCellConfig->reconfigurationWithSync = NULL;
} }
......
...@@ -1790,7 +1790,7 @@ static void pf_ul(module_id_t module_id, ...@@ -1790,7 +1790,7 @@ static void pf_ul(module_id_t module_id,
const int min_rb = nrmac->min_grant_prb; const int min_rb = nrmac->min_grant_prb;
// UEs that could be scheduled // UEs that could be scheduled
UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0}; UEsched_t UE_sched[MAX_MOBILES_PER_GNB + 1] = {0};
int remainUEs = max_num_ue; int remainUEs = max_num_ue;
int curUE = 0; int curUE = 0;
......
...@@ -915,7 +915,7 @@ static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RR ...@@ -915,7 +915,7 @@ static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RR
* reestablishment, instead of re-requesting the CellGroupConfig from the DU. * reestablishment, instead of re-requesting the CellGroupConfig from the DU.
* Hence, add below hack; the solution would be to request the * Hence, add below hack; the solution would be to request the
* CellGroupConfig from the DU when doing reestablishment. */ * CellGroupConfig from the DU when doing reestablishment. */
if (cellGroupConfig->spCellConfig->reconfigurationWithSync != NULL) { if (cellGroupConfig->spCellConfig && cellGroupConfig->spCellConfig->reconfigurationWithSync) {
ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cellGroupConfig->spCellConfig->reconfigurationWithSync); ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cellGroupConfig->spCellConfig->reconfigurationWithSync);
cellGroupConfig->spCellConfig->reconfigurationWithSync = NULL; cellGroupConfig->spCellConfig->reconfigurationWithSync = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment