Ticket #247 (defect)

Opened 5 months ago

Last modified 5 months ago

Infinite output port number for hierblock2 causes exception

Status: new

Reported by: dominik Assigned to: jcorgan
Priority: normal Milestone: to-be-decided
Component: gnuradio-core Version: 3.1svn
Keywords: hierblock2 iosignature maxstreams Cc:

The following code throws a standard exception:

gr.hier_block2.__init__(self, "static_tx_control",
  gr.io_signature (1,-1,gr.sizeof_float),...)) 

This is a bug in gr hier block2 detail at lines 37 and 38.

37 	  d_inputs(owner->input_signature()->max_streams()),
38 	  d_outputs(owner->output_signature()->max_streams())

A specification of maximum stream number equal -1 ( == IO_INFINITE ) leads to std::vector allocation with size=-1, therefore the std::vector implementation throws std::bad_alloc.

The most simple solution would be a value range check to at least give a more readable error message, though I consider this to be a design error in conjunction with the problem specified in ticket #161.

Also see #176, #237

Attachments

gr_hier_block2_detail_r9703.diff (2.4 kB) - added by guest on 10/03/08 05:57:12.
suggested patch

Change History

06/14/08 09:12:23: Modified by eb

  • owner changed from eb to jcorgan.

10/03/08 05:57:12: Modified by guest

  • attachment gr_hier_block2_detail_r9703.diff added.

suggested patch