# Circular dependency caught in sort\_variables only String type

**URL:** <https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368>\
**Category:** GNU Radio\
**Created:** [October 6, 2014, 10:40am UTC](https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368 "2014-10-06T10:40:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 6, 2014, 10:40am UTC](https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368/1 "2014-10-06T10:40:48Z")

</div>

Hi,

I’m getting this error with string type variables using gnuradio 3.7.5  
and  
I cannot figure out how to solve it. I’m using a normal variable plus a  
config variable in this way:

Variable:  
id: variable\_A  
value: config\_variable\_A

Variable Config:  
id: config\_variable\_A  
…  
WriteBack: variable\_A

This way the variable reads the config file at the start and the  
variable  
config writes the latest value of the variable at the end. It works very  
well with Integers.

When I change the Config variable type to “String” and I generate the  
flow  
graph, I get the error:

Generate Error: circular dependency caught in sort\_variables

Could anyone please help me to get this behaviour for a String type  
variable please?

Thank you,  
Murray

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [October 6, 2014, 5:02pm UTC](https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368/2 "2014-10-06T17:02:31Z")

</div>

On Mon, Oct 6, 2014 at 4:39 AM, Murray T.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Variable Config:  
> graph, I get the error:
> 
> Generate Error: circular dependency caught in sort\_variables
> 
> Could anyone please help me to get this behaviour for a String type  
> variable please?
> 
> Thank you,  
> Murray

Yeah, this is a fundamental issue with the way that the GRC templates  
are  
formatted and described. The circular issue has come up rarely in the  
past,  
but it’s certainly been a problem for me here and there.

Tom

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [October 7, 2014, 2:16pm UTC](https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368/3 "2014-10-07T14:16:03Z")

</div>

Thanks for your comments,

Is there an open issue for this problem? Is this a bug or am I doing  
something that I shouldn’t?  
I cannot hard-code the string because I need to be able to change the IP  
address of a UDP Sink block.

Thanks,  
Murray

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [October 6, 2014, 9:04pm UTC](https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368/4 "2014-10-06T21:04:02Z")

</div>

I ran into this just last week, trying to have editable text fields for  
configuration information (“hackrf=0”, “rtl=0”, …) that would be store  
in  
the config block. I ended up punting on the issue, and just hard-coding  
those strings into my flow graph. Glad to know it wasn’t something I did  
wrong.

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [October 7, 2014, 5:31pm UTC](https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368/5 "2014-10-07T17:31:45Z")

</div>

On Tue, Oct 7, 2014 at 8:14 AM, Murray T.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thanks for your comments,
> 
> Is there an open issue for this problem? Is this a bug or am I doing  
> something that I shouldn’t?  
> I cannot hard-code the string because I need to be able to change the IP  
> address of a UDP Sink block.
> 
> Thanks,  
> Murray

It’s not really a bug since it’s part of the design of the variables.  
However, it could be a feature in a future release of GRC. We’re working  
on  
overhauling GRC in a number of ways that might help us better support  
this.  
Instead of making this an Issue in our Issue tracker, probably better  
for  
the GRC Roadmap:

[http://gnuradio.org/redmine/projects/gnuradio/wiki/GRCroadmap](http://gnuradio.org/redmine/projects/gnuradio/wiki/GRCroadmap)

Thanks,  
Tom

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [October 7, 2014, 6:14pm UTC](https://www.ruby-forum.com/t/circular-dependency-caught-in-sort-variables-only-string-type/232368/6 "2014-10-07T18:14:23Z")

</div>

Thanks for the explanation Tom.

Regards,  
Murray
