From 1db3f8ffcc27235004719a13a249a1ec5732d62b Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 9 Jan 2018 17:30:12 +0100 Subject: [PATCH 1/2] Fixed SSE interleaver SEGFAULT potential --- lib/src/phy/utils/bit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/phy/utils/bit.c b/lib/src/phy/utils/bit.c index 809d4c392..f4e97fad6 100644 --- a/lib/src/phy/utils/bit.c +++ b/lib/src/phy/utils/bit.c @@ -98,14 +98,14 @@ void srslte_bit_interleaver_run(srslte_bit_interleaver_t *q, uint8_t *input, uin w_offset_p=8-w_offset; } - uint32_t i = st * 8; + int i = st * 8; byte_idx += i - w_offset_p; bit_mask += i - w_offset_p; output_ptr += st; #ifdef LV_HAVE_SSE - for(; i < q->nof_bits - 15; i += 16) { + for(; i < (int) q->nof_bits - 15; i += 16) { __m128i in128; in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x7); in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x6); @@ -137,7 +137,7 @@ void srslte_bit_interleaver_run(srslte_bit_interleaver_t *q, uint8_t *input, uin #endif /* LV_HAVE_SSE */ - for(; i < q->nof_bits; i += 8) { + for(; i < (int) q->nof_bits - 7; i += 8) { uint8_t out0 = (input[*(byte_idx++)] & *(bit_mask++))?mask[0]:(uint8_t)0; uint8_t out1 = (input[*(byte_idx++)] & *(bit_mask++))?mask[1]:(uint8_t)0; uint8_t out2 = (input[*(byte_idx++)] & *(bit_mask++))?mask[2]:(uint8_t)0; From 97448c0a1fec5a2f62744543752310aa996e599f Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 10 Jan 2018 12:35:26 +0100 Subject: [PATCH 2/2] fix uninitlized variable in logger and remove delegating ctor --- lib/include/srslte/common/log.h | 2 ++ lib/src/common/log_filter.cc | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/include/srslte/common/log.h b/lib/include/srslte/common/log.h index 71f47d197..93f7657cb 100644 --- a/lib/include/srslte/common/log.h +++ b/lib/include/srslte/common/log.h @@ -70,6 +70,7 @@ public: level = LOG_LEVEL_NONE; hex_limit = 0; show_layer_en = true; + level_text_short = true; } log(std::string service_name_) { @@ -78,6 +79,7 @@ public: level = LOG_LEVEL_NONE; hex_limit = 0; show_layer_en = true; + level_text_short = true; } // This function shall be called at the start of every tti for printing tti diff --git a/lib/src/common/log_filter.cc b/lib/src/common/log_filter.cc index f2fd2d61d..6720c21ad 100644 --- a/lib/src/common/log_filter.cc +++ b/lib/src/common/log_filter.cc @@ -43,14 +43,18 @@ log_filter::log_filter() } log_filter::log_filter(std::string layer) - :log_filter() { + do_tti = false; + time_src = NULL; + time_format = TIME; init(layer, &def_logger_stdout, tti); } log_filter::log_filter(std::string layer, logger *logger_, bool tti) - :log_filter() { + do_tti = false; + time_src = NULL; + time_format = TIME; init(layer, logger_, tti); }