gnuradio-core: trial "fix" for QA failure with debian gcc 4.4.4
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Tue, 6 Jul 2010 04:41:41 +0000 (21:41 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Tue, 6 Jul 2010 04:41:41 +0000 (21:41 -0700)
Add zeroed 'bumper' space before and after stack allocated input
buffer in QA code.

Eric Blossom:

"Bottom line, the only thing I can think of that might be going on is
that we're fetching a NaN off of the end of the input buffer,
multiplying it by zero (which works for everything except a NaN), then
propagating that through the rest of the calculation.  (In particular
alignment cases the code does deliberately fetch either before or
after the end of the buffer, and it always multiplies those values by
zero.  If they happen to be NaN's we hosed :-))  In the production
code we never see the problem since the circular buffer is zero
initialized."

Note: qa_gri_mmse_fir_interpolator::t1 now fails with the bumper code
in place.

gnuradio-core/src/lib/filter/qa_gr_fir_fcc.cc
gnuradio-core/src/lib/filter/qa_gr_fir_fff.cc
gnuradio-core/src/lib/filter/qa_gr_fir_scc.cc
gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator.cc

index bb56d17883251f6016c409e7d916f4c0b9f31a8e..25083bb2b03ad4ec5dedcd047b74b968d08841aa 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -108,7 +108,10 @@ test_random_io (fir_maker_t maker)
   const int    OUTPUT_LEN      = 17;
   const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
 
-  i_type       input[INPUT_LEN];
+  i_type        input_raw[INPUT_LEN + 4*16/sizeof(i_type)];
+  memset(input_raw, 0, sizeof(input_raw));
+  i_type       *input = &input_raw[2*16/sizeof(i_type)];
+
   o_type       expected_output[OUTPUT_LEN];
   o_type       actual_output[OUTPUT_LEN];
   tap_type     taps[MAX_TAPS];
index b921223ed96df2a6fc5b74822bf48ae95bfaed0b..60ba760973375af687d3de78fe41ba2c8169682d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -147,7 +147,10 @@ test_random_io (fir_maker_t maker)
   const int    OUTPUT_LEN      = 17;
   const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
 
-  i_type       input[INPUT_LEN];
+  i_type        input_raw[INPUT_LEN + 4*16/sizeof(i_type)];
+  memset(input_raw, 0, sizeof(input_raw));
+  i_type       *input = &input_raw[2*16/sizeof(i_type)];
+
   o_type       expected_output[OUTPUT_LEN];
   o_type       actual_output[OUTPUT_LEN];
   tap_type     taps[MAX_TAPS];
index 1aea34fbb3fc9d19573d4054d3cf092527a2e9ae..21e0da60eff23e5d2daa6bf5177721f9c33cd4e8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -106,7 +106,10 @@ test_random_io (fir_maker_t maker)
   const int    OUTPUT_LEN      = 17;
   const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
 
-  i_type       input[INPUT_LEN];
+  i_type        input_raw[INPUT_LEN + 4*16/sizeof(i_type)];
+  memset(input_raw, 0, sizeof(input_raw));
+  i_type       *input = &input_raw[2*16/sizeof(i_type)];
+
   o_type       expected_output[OUTPUT_LEN];
   o_type       actual_output[OUTPUT_LEN];
   tap_type     taps[MAX_TAPS];
index 63654a280ff5b340b000bbb7cc112609970f6a87..a4deafb914255f11ed5def96b6a4a21713bb3822 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -25,6 +25,7 @@
 #include <gri_mmse_fir_interpolator.h>
 #include <stdio.h>
 #include <cmath>
+#include <cstring>
 
 #define        NELEM(x) (sizeof (x) / sizeof (x[0]))
 
@@ -41,7 +42,10 @@ void
 qa_gri_mmse_fir_interpolator::t1 ()
 {
   static const unsigned        N = 100;
-  float input[N + 10];
+
+  float input_raw[N + 10 + 4*16/sizeof(float)];
+  memset(input_raw, 0, sizeof(input_raw));
+  float *input = &input_raw[2*16/sizeof(float)];
 
   for (unsigned i = 0; i < NELEM(input); i++)
     input[i] = test_fcn ((double) i);