From 62dd59d868c3f481ad93a7f5ee86e1cd9d653cb1 Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Tue, 25 Jun 2019 17:28:09 +0200 Subject: [PATCH] attempt to solve a couple of segmentation faults --- executables/nr-gnb.c | 17 ++++++----------- executables/nr-ru.c | 2 +- openair1/PHY/INIT/nr_init.c | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index d589ec02d6..745cc03565 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -701,8 +701,7 @@ void init_gNB_proc(int inst) { PHY_VARS_gNB *gNB; gNB_L1_proc_t *proc; gNB_L1_rxtx_proc_t *L1_proc,*L1_proc_tx; - LOG_I(PHY,"%s(inst:%d) RC.nb_nr_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_nr_CC[inst]); - +// LOG_I(PHY,"%s(inst:%d) RC.nb_nr_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_nr_CC[inst]); gNB = RC.gNB[inst]; #ifndef OCP_FRAMEWORK LOG_I(PHY,"Initializing gNB processes instance:%d CC_id %d \n",inst,CC_id); @@ -753,7 +752,6 @@ void init_gNB_proc(int inst) { AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach); - /* setup PHY proc TX sync mechanism */ pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL); pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL); @@ -852,19 +850,18 @@ void init_eNB_afterRU(void) { LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst); for (inst=0; instnum_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id); - + LOG_I(PHY,"Mapping RX ports from %d RUs to gNB %d\n",gNB->num_RU,gNB->Mod_id); //LOG_I(PHY,"Overwriting gNB->prach_vars.rxsigF[0]:%p\n", gNB->prach_vars.rxsigF[0]); gNB->prach_vars.rxsigF[0] = (int16_t **)malloc16(64*sizeof(int16_t *)); LOG_I(PHY,"gNB->num_RU:%d\n", gNB->num_RU); - + for (ru_id=0,aa=0; ru_idnum_RU; ru_id++) { AssertFatal(gNB->RU_list[ru_id]->common.rxdataF!=NULL, "RU %d : common.rxdataF is NULL\n", @@ -879,16 +876,14 @@ void init_eNB_afterRU(void) { gNB->common_vars.rxdataF[aa] = gNB->RU_list[ru_id]->common.rxdataF[i]; } } - + /* TODO: review this code, there is something wrong. * In monolithic mode, we come here with nb_antennas_rx == 0 * (not tested in other modes). */ //init_precoding_weights(RC.gNB[inst]); + init_gNB_proc(inst); } - - init_gNB_proc(inst); - for (ru_id=0; ru_idfh_north_asynch_in) { + if (ru->fh_north_asynch_in) { if (nr_slot_select(&ru->gNB_list[0]->gNB_config,subframe)!=SF_UL) ru->fh_north_asynch_in(ru,&frame,&subframe); } else AssertFatal(1==0,"Unknown function in ru_thread_asynch_rxtx\n"); diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 570abcc97b..2d0661728e 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -185,7 +185,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, */ // PRACH prach_vars->prachF = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) ); - + prach_vars->rxsigF = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) ); prach_vars->prach_ifft = (int32_t *)malloc16_clear(1024*2*sizeof(int32_t)); /*