From d3f4904ec0130579530d1620f4c9b91c3b506080 Mon Sep 17 00:00:00 2001 From: gisforgirard Date: Wed, 8 Feb 2023 23:01:02 -0500 Subject: [PATCH 1/3] fix for elusive crashing issue see https://www.ruby-forum.com/t/s-d-bufsize-failed/59342 --- lib/op25_repeater/lib/p25_frame_assembler_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/op25_repeater/lib/p25_frame_assembler_impl.cc b/lib/op25_repeater/lib/p25_frame_assembler_impl.cc index 93bf4854e..ec5086c8c 100644 --- a/lib/op25_repeater/lib/p25_frame_assembler_impl.cc +++ b/lib/op25_repeater/lib/p25_frame_assembler_impl.cc @@ -232,7 +232,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, } consume_each(ninput_items[0]); // Tell runtime system how many output items we actually produced. - return amt_produce; + return noutput_items; } void p25_frame_assembler_impl::clear_silence_frame_count() { @@ -254,4 +254,4 @@ p25_frame_assembler_impl::general_work (int noutput_items, } } } /* namespace op25_repeater */ -} /* namespace gr */ \ No newline at end of file +} /* namespace gr */ From 050c9964069e57e6f063b8ed95a16dc68a5d4b49 Mon Sep 17 00:00:00 2001 From: gisforgirard Date: Thu, 9 Feb 2023 16:22:31 -0500 Subject: [PATCH 2/3] fix elusive crash issue can't believe i didn't notice it before --- lib/op25_repeater/lib/p25_frame_assembler_impl.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/op25_repeater/lib/p25_frame_assembler_impl.cc b/lib/op25_repeater/lib/p25_frame_assembler_impl.cc index ec5086c8c..efd8040c7 100644 --- a/lib/op25_repeater/lib/p25_frame_assembler_impl.cc +++ b/lib/op25_repeater/lib/p25_frame_assembler_impl.cc @@ -151,7 +151,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, long p2_ptt_grp_id = -1; p1fdma.rx_sym(in, ninput_items[0]); if(d_do_phase2_tdma) { - for (int i = 0; i < ninput_items[0]; i++) { + for (size_t i = 0; i < ninput_items[0]; i++) { if(p2tdma.rx_sym(in[i])) { int rc = p2tdma.handle_frame(); if (p2tdma.get_call_terminated()) { @@ -182,7 +182,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, //BOOST_LOG_TRIVIAL(trace) << "P25 Frame Assembler - output_queue: " << output_queue.size() << " noutput_items: " << noutput_items << " ninput_items: " << ninput_items[0]; - if (amt_produce > 0) { + if (amt_produce > 0 && terminate_call !== true) { long src_id = p1fdma.get_curr_src_id(); long grp_id = p1fdma.get_curr_grp_id(); // If a SRC wasn't received on the voice channel since the last check, it will be -1 @@ -199,7 +199,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, add_item_tag(0, nitems_written(0), pmt::intern("grp_id"), pmt::from_long(grp_id), d_tag_src); } - for (int i = 0; i < amt_produce; i++) { + for (size_t i = 0; i < amt_produce; i++) { out[i] = output_queue[i]; } output_queue.erase(output_queue.begin(), output_queue.begin() + amt_produce); @@ -232,7 +232,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, } consume_each(ninput_items[0]); // Tell runtime system how many output items we actually produced. - return noutput_items; + return amt_produce; } void p25_frame_assembler_impl::clear_silence_frame_count() { From 8db0e4bdae8d6537ca20f834dd5550c6fc381547 Mon Sep 17 00:00:00 2001 From: gisforgirard Date: Fri, 10 Feb 2023 02:26:31 -0500 Subject: [PATCH 3/3] fix for elusive crash issue trying to not change anything extra --- lib/op25_repeater/lib/p25_frame_assembler_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/op25_repeater/lib/p25_frame_assembler_impl.cc b/lib/op25_repeater/lib/p25_frame_assembler_impl.cc index efd8040c7..8801c7b37 100644 --- a/lib/op25_repeater/lib/p25_frame_assembler_impl.cc +++ b/lib/op25_repeater/lib/p25_frame_assembler_impl.cc @@ -151,7 +151,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, long p2_ptt_grp_id = -1; p1fdma.rx_sym(in, ninput_items[0]); if(d_do_phase2_tdma) { - for (size_t i = 0; i < ninput_items[0]; i++) { + for (int i = 0; i < ninput_items[0]; i++) { if(p2tdma.rx_sym(in[i])) { int rc = p2tdma.handle_frame(); if (p2tdma.get_call_terminated()) { @@ -199,7 +199,7 @@ p25_frame_assembler_impl::general_work (int noutput_items, add_item_tag(0, nitems_written(0), pmt::intern("grp_id"), pmt::from_long(grp_id), d_tag_src); } - for (size_t i = 0; i < amt_produce; i++) { + for (int i = 0; i < amt_produce; i++) { out[i] = output_queue[i]; } output_queue.erase(output_queue.begin(), output_queue.begin() + amt_produce);