From 94c29674868965085352529ab8a4285d4e62deb5 Mon Sep 17 00:00:00 2001 From: Fabian Eckermann Date: Fri, 17 Dec 2021 15:01:50 +0100 Subject: [PATCH 1/4] Return correct iterator value. --- lib/include/srsran/asn1/asn1_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/include/srsran/asn1/asn1_utils.h b/lib/include/srsran/asn1/asn1_utils.h index 5065097ee..2485cda6e 100644 --- a/lib/include/srsran/asn1/asn1_utils.h +++ b/lib/include/srsran/asn1/asn1_utils.h @@ -254,7 +254,7 @@ public: std::copy(it + 1, end(), it); size_--; - return it + 1; + return it; } bool operator==(const dyn_array& other) const { From cdbe6a6e1d5d8d689319378b3380bcbc664b88dd Mon Sep 17 00:00:00 2001 From: Fabian Eckermann Date: Fri, 17 Dec 2021 15:03:12 +0100 Subject: [PATCH 2/4] Make sure to not access out-of-bounds iterator when erasing vector elements. --- srsenb/src/stack/rrc/ue_meas_cfg.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srsenb/src/stack/rrc/ue_meas_cfg.cc b/srsenb/src/stack/rrc/ue_meas_cfg.cc index dc4b54d0f..3b637b874 100644 --- a/srsenb/src/stack/rrc/ue_meas_cfg.cc +++ b/srsenb/src/stack/rrc/ue_meas_cfg.cc @@ -425,8 +425,7 @@ bool apply_meascfg_updates(meas_cfg_s& meascfg, for (auto it = current_meascfg.meas_id_to_add_mod_list.begin(); it != current_meascfg.meas_id_to_add_mod_list.end();) { if (it->meas_obj_id == found_src_obj->meas_obj_id) { - auto rit = it++; - current_meascfg.meas_id_to_add_mod_list.erase(rit); + it = current_meascfg.meas_id_to_add_mod_list.erase(it); } else { ++it; } From 767d5390f9b34c35e2d5d96f3efddb25914481fb Mon Sep 17 00:00:00 2001 From: Robert Falkenberg Date: Thu, 16 Dec 2021 11:03:53 +0100 Subject: [PATCH 3/4] benchmark_radio: don't join plot_thread if not requested --- lib/src/radio/test/benchmark_radio.cc | 31 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/lib/src/radio/test/benchmark_radio.cc b/lib/src/radio/test/benchmark_radio.cc index 5a354a5a8..901d2e905 100644 --- a/lib/src/radio/test/benchmark_radio.cc +++ b/lib/src/radio/test/benchmark_radio.cc @@ -56,6 +56,7 @@ static pthread_t radio_thread; #include "srsgui/srsgui.h" #include static pthread_t plot_thread; +static bool plot_thread_launched = false; static sem_t plot_sem; static uint32_t plot_sf_idx = 0; static plot_real_t fft_plot[SRSRAN_MAX_RADIOS] = {}; @@ -247,6 +248,7 @@ static int init_plots(uint32_t frame_size) perror("pthread_create"); exit(-1); } + plot_thread_launched = true; return SRSRAN_SUCCESS; } @@ -315,7 +317,10 @@ static void* radio_thread_run(void* arg) #ifdef ENABLE_GUI if (fft_plot_enable) { - init_plots(frame_size); + if (init_plots(frame_size) != SRSRAN_SUCCESS) { + ERROR("Error: Could not init plots"); + goto clean_exit; + } sleep(1); } #endif /* ENABLE_GUI */ @@ -574,18 +579,22 @@ clean_exit: srsran_dft_plan_free(&idft_plan); #ifdef ENABLE_GUI - pthread_join(plot_thread, NULL); - srsran_dft_plan_free(&dft_spectrum); - for (uint32_t r = 0; r < nof_radios; r++) { - for (uint32_t p = 0; p < nof_ports; p++) { - uint32_t plot_idx = r * nof_ports + p; - if (fft_plot_buffer[plot_idx]) { - free(fft_plot_buffer[plot_idx]); + if (fft_plot_enable) { + if (plot_thread_launched == true) { + pthread_join(plot_thread, NULL); + } + srsran_dft_plan_free(&dft_spectrum); + for (uint32_t r = 0; r < nof_radios; r++) { + for (uint32_t p = 0; p < nof_ports; p++) { + uint32_t plot_idx = r * nof_ports + p; + if (fft_plot_buffer[plot_idx]) { + free(fft_plot_buffer[plot_idx]); + } } } - } - if (fft_plot_temp) { - free(fft_plot_temp); + if (fft_plot_temp) { + free(fft_plot_temp); + } } #endif /* ENABLE_GUI */ From 5403468f145d12180b392a06033f1040066ab923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20F=C3=BCrste?= Date: Fri, 17 Dec 2021 14:58:13 +0100 Subject: [PATCH 4/4] Fix cmake for SoapySDR --- cmake/modules/FindSoapySDR.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/modules/FindSoapySDR.cmake b/cmake/modules/FindSoapySDR.cmake index b691b5af0..cf3512dda 100644 --- a/cmake/modules/FindSoapySDR.cmake +++ b/cmake/modules/FindSoapySDR.cmake @@ -13,7 +13,6 @@ if(NOT SOAPYSDR_FOUND) find_path(SOAPYSDR_INCLUDE_DIRS NAMES Device.h HINTS $ENV{SOAPY_DIR}/include - $ENV{SOAPY_DIR}/include/SoapySDR PATHS ${SOAPYSDR_PKG_INCLUDE_DIRS} /usr/include/SoapySDR /usr/local/include/SoapySDR