diff options
author | Rick Farina <zerochaos@gentoo.org> | 2024-01-24 22:39:40 -0500 |
---|---|---|
committer | Rick Farina <zerochaos@gentoo.org> | 2024-01-24 22:40:33 -0500 |
commit | 668954e8975de950a0b7efaab0572eadbf1902ae (patch) | |
tree | ab9834a59625e186d99808f40d33be183edebc36 /net-wireless | |
parent | media-libs/mesa: Version bump to 23.3.4 (diff) | |
download | gentoo-668954e8975de950a0b7efaab0572eadbf1902ae.tar.gz gentoo-668954e8975de950a0b7efaab0572eadbf1902ae.tar.bz2 gentoo-668954e8975de950a0b7efaab0572eadbf1902ae.zip |
net-wireless/gnuradio: add filter bugfix
Found by re-enabling tests, which I'm now sharing with everyone
Signed-off-by: Rick Farina <zerochaos@gentoo.org>
Diffstat (limited to 'net-wireless')
-rw-r--r-- | net-wireless/gnuradio/files/PR7093.patch | 76 | ||||
-rw-r--r-- | net-wireless/gnuradio/gnuradio-3.10.9.2-r1.ebuild (renamed from net-wireless/gnuradio/gnuradio-3.10.9.2.ebuild) | 8 | ||||
-rw-r--r-- | net-wireless/gnuradio/gnuradio-9999.ebuild | 6 |
3 files changed, 82 insertions, 8 deletions
diff --git a/net-wireless/gnuradio/files/PR7093.patch b/net-wireless/gnuradio/files/PR7093.patch new file mode 100644 index 000000000000..98581054d49d --- /dev/null +++ b/net-wireless/gnuradio/files/PR7093.patch @@ -0,0 +1,76 @@ +From 677d22b5226a3edb274c252cc3aa727a16de3c68 Mon Sep 17 00:00:00 2001 +From: Clayton Smith <argilo@gmail.com> +Date: Tue, 23 Jan 2024 18:28:46 -0500 +Subject: [PATCH] filter: Fix undefined behaviour in fir_filter_with_buffer + +Signed-off-by: Clayton Smith <argilo@gmail.com> +--- + gr-filter/lib/fir_filter_with_buffer.cc | 9 ++++++--- + gr-filter/lib/qa_fir_filter_with_buffer.cc | 6 +++--- + 2 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/gr-filter/lib/fir_filter_with_buffer.cc b/gr-filter/lib/fir_filter_with_buffer.cc +index 4fc571ec57d..f6cb3b20854 100644 +--- a/gr-filter/lib/fir_filter_with_buffer.cc ++++ b/gr-filter/lib/fir_filter_with_buffer.cc +@@ -52,7 +52,8 @@ void fir_filter_with_buffer_fff::set_taps(const std::vector<float>& taps) + for (int i = 0; i < d_naligned; i++) { + d_aligned_taps[i].clear(); + d_aligned_taps[i].resize(d_ntaps + d_naligned - 1); +- std::copy(std::begin(d_taps), std::end(d_taps), &d_aligned_taps[i][i]); ++ std::copy( ++ std::begin(d_taps), std::end(d_taps), std::begin(d_aligned_taps[i]) + i); + } + + d_idx = 0; +@@ -157,7 +158,8 @@ void fir_filter_with_buffer_ccc::set_taps(const std::vector<gr_complex>& taps) + for (int i = 0; i < d_naligned; i++) { + d_aligned_taps[i].clear(); + d_aligned_taps[i].resize(d_ntaps + d_naligned - 1); +- std::copy(std::begin(d_taps), std::end(d_taps), &d_aligned_taps[i][i]); ++ std::copy( ++ std::begin(d_taps), std::end(d_taps), std::begin(d_aligned_taps[i]) + i); + } + + d_idx = 0; +@@ -261,7 +263,8 @@ void fir_filter_with_buffer_ccf::set_taps(const std::vector<float>& taps) + for (int i = 0; i < d_naligned; i++) { + d_aligned_taps[i].clear(); + d_aligned_taps[i].resize(d_ntaps + d_naligned - 1); +- std::copy(std::begin(d_taps), std::end(d_taps), &d_aligned_taps[i][i]); ++ std::copy( ++ std::begin(d_taps), std::end(d_taps), std::begin(d_aligned_taps[i]) + i); + } + + d_idx = 0; +diff --git a/gr-filter/lib/qa_fir_filter_with_buffer.cc b/gr-filter/lib/qa_fir_filter_with_buffer.cc +index 32f5c6780fc..72cdd9fa1c0 100644 +--- a/gr-filter/lib/qa_fir_filter_with_buffer.cc ++++ b/gr-filter/lib/qa_fir_filter_with_buffer.cc +@@ -107,7 +107,7 @@ void test_decimate(unsigned int decimate) + } + + // build filter +- vector<tap_type> f1_taps(&taps[0], &taps[n]); ++ vector<tap_type> f1_taps(taps.begin(), taps.begin() + n); + kernel::fir_filter_with_buffer_fff f1(f1_taps); + + // zero the output, then do the filtering +@@ -198,7 +198,7 @@ void test_decimate(unsigned int decimate) + } + + // build filter +- vector<tap_type> f1_taps(&taps[0], &taps[n]); ++ vector<tap_type> f1_taps(taps.begin(), taps.begin() + n); + kernel::fir_filter_with_buffer_ccc f1(f1_taps); + + // zero the output, then do the filtering +@@ -287,7 +287,7 @@ void test_decimate(unsigned int decimate) + } + + // build filter +- vector<tap_type> f1_taps(&taps[0], &taps[n]); ++ vector<tap_type> f1_taps(taps.begin(), taps.begin() + n); + kernel::fir_filter_with_buffer_ccf f1(f1_taps); + + // zero the output, then do the filtering diff --git a/net-wireless/gnuradio/gnuradio-3.10.9.2.ebuild b/net-wireless/gnuradio/gnuradio-3.10.9.2-r1.ebuild index 68eff59630d3..bbbc55d8c42e 100644 --- a/net-wireless/gnuradio/gnuradio-3.10.9.2.ebuild +++ b/net-wireless/gnuradio/gnuradio-3.10.9.2-r1.ebuild @@ -23,9 +23,7 @@ fi IUSE="+audio +alsa +analog +digital channels ctrlport doc dtv examples fec +filter grc iio jack modtool network oss performance-counters portaudio +qt5 sdl soapy test trellis uhd vocoder +utils wavelet zeromq" -#RESTRICT="!test? ( test )" -# https://github.com/gnuradio/gnuradio/issues/7085 -RESTRICT="test" +RESTRICT="!test? ( test )" REQUIRED_USE="${PYTHON_REQUIRED_USE} audio? ( || ( alsa oss jack portaudio ) ) @@ -131,6 +129,8 @@ DEPEND="${RDEPEND} zeromq? ( net-libs/cppzmq ) " +PATCHES=( "${FILESDIR}/PR7093.patch" ) + src_prepare() { xdg_environment_reset #534582 @@ -225,7 +225,7 @@ src_install() { src_test() { # skip test which needs internet - virtx cmake_src_test -E metainfo_test + virtx cmake_src_test -E metainfo_test --output-on-failure } pkg_postinst() { diff --git a/net-wireless/gnuradio/gnuradio-9999.ebuild b/net-wireless/gnuradio/gnuradio-9999.ebuild index 68eff59630d3..6270b80fb9f0 100644 --- a/net-wireless/gnuradio/gnuradio-9999.ebuild +++ b/net-wireless/gnuradio/gnuradio-9999.ebuild @@ -23,9 +23,7 @@ fi IUSE="+audio +alsa +analog +digital channels ctrlport doc dtv examples fec +filter grc iio jack modtool network oss performance-counters portaudio +qt5 sdl soapy test trellis uhd vocoder +utils wavelet zeromq" -#RESTRICT="!test? ( test )" -# https://github.com/gnuradio/gnuradio/issues/7085 -RESTRICT="test" +RESTRICT="!test? ( test )" REQUIRED_USE="${PYTHON_REQUIRED_USE} audio? ( || ( alsa oss jack portaudio ) ) @@ -225,7 +223,7 @@ src_install() { src_test() { # skip test which needs internet - virtx cmake_src_test -E metainfo_test + virtx cmake_src_test -E metainfo_test --output-on-failure } pkg_postinst() { |