# Restarting a flow graph after termination by a head block?

**URL:** <https://www.ruby-forum.com/t/restarting-a-flow-graph-after-termination-by-a-head-block/238781>\
**Category:** GNU Radio\
**Created:** [January 29, 2014, 12:00am UTC](https://www.ruby-forum.com/t/restarting-a-flow-graph-after-termination-by-a-head-block/238781 "2014-01-29T00:00:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [January 29, 2014, 12:00am UTC](https://www.ruby-forum.com/t/restarting-a-flow-graph-after-termination-by-a-head-block/238781/1 "2014-01-29T00:00:13Z")

</div>

How can you restart a flow graph after a head block kills it?

For example, I want to do something like the following:

tb.start()  
tb.wait() # head block will terminate  
… do some reconfiguration …  
tb.start()

However, I get a seg fault if I ever try to call tb.start() after the  
head  
block returns.  
I take it a flow graph isn’t reusable after a head block terminates?

If I remove the head block:  
tb.start()  
tb.stop()  
tb.wait()  
tb.start()

Works just fine. Could someone explain what is going on or point me to  
the  
documentation (having a hard to finding anything useful in the  
documentation).

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [January 29, 2014, 12:24am UTC](https://www.ruby-forum.com/t/restarting-a-flow-graph-after-termination-by-a-head-block/238781/2 "2014-01-29T00:24:04Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi Ken,

since segfaults are never desirable, we should look into the issue.

Generally, I’d say that flowgraphs are not really meant for restarting  
if not special precautions were made. Many blocks are stateful,  
meaning that it does matter if you’re the first sample to be processed  
or the xth one; this is especially the case for the head block.  
A flowgraph really just represents the connections between the blocks

- 
  - the blocks are created prior to connecting and continue to exist  
after the flowgraph stopped. So, unless starting a block anew resets  
its state, there is no guarantee that things will work as in the first  
call to start.  
However, head should not crash; I will look into that tomorrow  
morning. Could you please provide a minimal flowgraph example, and  
your GR version as well as a little information on your platform (OS,  
architecture)?

Greetings  
Marcus

On 28.01.2014 23:58, Ken A. wrote:

> mailing list [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1  
Comment: Using GnuPG with Thunderbird - [http://www.enigmail.net/](http://www.enigmail.net/)

iQEcBAEBAgAGBQJS6Du8AAoJEAFxB7BbsDrLcyUH/0ba9S7nILMgYhHXb8cf/X4N  
Rh1kIMatQG8eV87+dVR0FFVXrEABFlrGenFX+/hxG/yhuge7D81OZHpC+fho8yjh  
Rfb8ibiRQ9FJO9NPHiKE6SiN5F32kGFzub39CqcoN4JL3b9OltExKoqs8VAJ3gRr  
I/hugN4vPVlWugJr11TAEhBqqsU9eJFFaKs5y0wQ3FErGl3huIdnWv7WHBblvc/s  
/t7hKDMb7P3iV0mKmlOfeGDvIMX8XNUN/e23NIwQ5PPhgW3t5HGVWZmX8ytdCuOZ  
f/tjhH2bxYMrUak2MzGu3zE5BAVjpE9LRnykMIkreDUSRiXtsttPCDbeaEzNIwY=  
=f9xC  
-----END PGP SIGNATURE-----
