[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 04/09: runtime: addresses issue 768.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 04/09: runtime: addresses issue 768. |
Date: |
Wed, 27 Jan 2016 18:20:23 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 9606e1f92541f4495973bc78d4cba0f053949042
Author: Tom Rondeau <address@hidden>
Date: Wed Jan 27 11:21:25 2016 -0500
runtime: addresses issue 768.
Because of the data types in use here, d_ninput_items_required can
overflow and become negative, which then causes bad addressing of the
input buffer in a block's work function. Even if we were using
unsigned types, we might still have situations of overflow; it
wouldn't crash in this case but cause wrong addressing, anyways.
We might be able to catch and handle this situation better. This fix
tests for the condition and shuts down the flowgraph with an error
message. Basically, parameters that cause this effect are well out of
bounds of what we want to handle, anyways.
---
gnuradio-runtime/lib/block_executor.cc | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/gnuradio-runtime/lib/block_executor.cc
b/gnuradio-runtime/lib/block_executor.cc
index ded1324..ef2e494 100644
--- a/gnuradio-runtime/lib/block_executor.cc
+++ b/gnuradio-runtime/lib/block_executor.cc
@@ -370,12 +370,25 @@ namespace gr {
// ask the block how much input they need to produce noutput_items
m->forecast (noutput_items, d_ninput_items_required);
- // See if we've got sufficient input available
+ // See if we've got sufficient input available and make sure we
+ // didn't overflow on the input.
int i;
- for(i = 0; i < d->ninputs (); i++)
+ for(i = 0; i < d->ninputs (); i++) {
if(d_ninput_items_required[i] > d_ninput_items[i]) // not enough
break;
+ if(d_ninput_items_required[i] < 0) {
+ std::cerr << "\nsched: <block " << m->name()
+ << " (" << m->unique_id() << ")>"
+ << " thinks its ninput_items required is "
+ << d_ninput_items_required[i]
+ << " and cannot be negative.\n"
+ << "Some parameterization is wrong. "
+ << "Too large a decimation value?\n\n";
+ goto were_done;
+ }
+ }
+
if(i < d->ninputs()) { // not enough input on input[i]
// if we can, try reducing the size of our output request
if(noutput_items > m->output_multiple()) {
- [Commit-gnuradio] [gnuradio] branch maint updated (492bce0 -> 393624c), git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 09/09: Merge remote-tracking branch 'tom/issue768' into maint, git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 07/09: Merge remote-tracking branch 'tom/issue882' into maint, git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 01/09: filter: issue #882: making sure to clean up memory in PFB decimator., git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 04/09: runtime: addresses issue 768.,
git <=
- [Commit-gnuradio] [gnuradio] 02/09: cmake: issue #879. Fixed quotation problem., git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 08/09: Merge remote-tracking branch 'tom/issue876' into maint, git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 06/09: runtime: issue 883: fixes calculation of alignment in items., git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 03/09: digital: addresses issue #876., git, 2016/01/27
- [Commit-gnuradio] [gnuradio] 05/09: Merge remote-tracking branch 'tom/issue879' into maint, git, 2016/01/27