From 0a01bd4e1bdf5f761f5cee8bd95d82284ae0095f Mon Sep 17 00:00:00 2001 From: faluco Date: Fri, 31 Jul 2020 12:27:40 +0200 Subject: [PATCH] - Fix a race condition where the prach struct was being free while the prach worker was still running. This could cause heap corruption making the enb_phy_test to fail sometimes. --- srsenb/src/phy/prach_worker.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srsenb/src/phy/prach_worker.cc b/srsenb/src/phy/prach_worker.cc index 3591b10e4..fb20eca96 100644 --- a/srsenb/src/phy/prach_worker.cc +++ b/srsenb/src/phy/prach_worker.cc @@ -72,12 +72,12 @@ int prach_worker::init(const srslte_cell_t& cell_, void prach_worker::stop() { - srslte_prach_free(&prach); - running = false; sf_buffer* s = nullptr; pending_buffers.push(s); wait_thread_finish(); + + srslte_prach_free(&prach); } void prach_worker::set_max_prach_offset_us(float delay_us)