Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gr-blocks: bad function for determining total number of tags passed through tag_debug block #1636

Open
jacobagilbert opened this issue Feb 24, 2018 · 3 comments

Comments

@jacobagilbert
Copy link
Contributor

Function: https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/lib/tag_debug_impl.cc#L67

At some point tags go out of scope and get cleaned up. Quick python FG to demonstrate:

from gnuradio import gr, blocks
import pmt
tb = gr.top_block()
tag = gr.tag_utils.python_to_tag((0, pmt.intern("tag"), pmt.PMT_NIL, pmt.PMT_NIL))
src = blocks.vector_source_c(range(1000), True, 1, [tag,])
head = blocks.head(gr.sizeof_gr_complex*1,100000)
tag_dbg = blocks.tag_debug(gr.sizeof_gr_complex*1, '', "");
tag_dbg.set_display(False)
tb.connect(src, head, tag_dbg)
tb.run ()
print "should have gotten 100 tags, got " + repr(tag_dbg.num_tags())

This also does not expose information for other inputs.

@jacobagilbert jacobagilbert changed the title gr-blocks: bad function for determining total number of tags passed through tag_debug() block gr-blocks: bad function for determining total number of tags passed through tag_debug block Feb 24, 2018
@marcusmueller
Copy link
Member

oh, shoot, yeah, that's true, and it's bad on a software-architectural level (lack of ownership clarity).

Pinging @fwunsch here, too: Would that happen to the messages stored in a message_debug, too?

@mrjacobagilbert, do you agree: with the current model, we should probably be doing deep copies of the tags themselves in tag_debug?

@jacobagilbert
Copy link
Contributor Author

@marcusmueller going through old issues...

yes, i agree deep copies should address this at some potential performance cost, but this is a debug block so IMO faithful execution of stated objectives is more important.

@marcusmueller
Copy link
Member

Should probably be fine with current architecture an pybind11, but someone needs to check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants