# New block: Segfault thrown when calling self.connect

**URL:** <https://www.ruby-forum.com/t/new-block-segfault-thrown-when-calling-self-connect/212275>\
**Category:** GNU Radio\
**Created:** [September 28, 2011, 12:10am UTC](https://www.ruby-forum.com/t/new-block-segfault-thrown-when-calling-self-connect/212275 "2011-09-28T00:10:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 28, 2011, 12:10am UTC](https://www.ruby-forum.com/t/new-block-segfault-thrown-when-calling-self-connect/212275/1 "2011-09-28T00:10:17Z")

</div>

Hello,  
I wrote a GNU Radio block using the template from here:  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/Basic\_block](http://gnuradio.org/redmine/projects/gnuradio/wiki/Basic_block)  
which shall eventually become a source module providing access to a  
low-speed electroencephalographic capture board I designed and built, in  
order to “abuse” the GNU Radio framework for that kind of data analysis.  
This is the test program I tried to run (generated with grc, modified by  
hand):

> <https://github.com/jaseg/openmind-viewer/blob/master/apps/top_block.py>

On each run the program throws a segfault in the second connect call on  
line 55:  
self.connect((self.openmind\_buspirate\_source\_0, 0),  
(self.gr\_interleaved\_short\_to\_complex\_0, 0))  
When I follow the segfault using gdb or pdb I end up somewhere in the  
gnuradio internals.  
I have no idea what causes this segfault and would be glad for any  
hints.  
The source files of the rest of the block are to be found here (I do not  
know which are actually relevant to this question):

> **[GitHub - jaseg/openmind-viewer: A gnuradio-based viewer for brain waves...](https://github.com/jaseg/openmind-viewer)**
>
> A gnuradio-based viewer for brain waves captured with openmind hardware - GitHub - jaseg/openmind-viewer: A gnuradio-based viewer for brain waves captured with openmind hardware

Thanks in advance (hoping that I provided enough information)

---

<div class="post-metadata">

**Author:** ![SSSebastian\_GSStteS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@SSSebastian\_GSStteS](https://www.ruby-forum.com/u/SSSebastian_GSStteS)\
**Post date:** [September 28, 2011, 1:02am UTC](https://www.ruby-forum.com/t/new-block-segfault-thrown-when-calling-self-connect/212275/2 "2011-09-28T01:02:39Z")

</div>

On 09/27/2011 06:09 PM, Sebastian Gtte wrote:

> line 55:  
> self.connect((self.openmind\_buspirate\_source\_0, 0),  
> (self.gr\_interleaved\_short\_to\_complex\_0, 0))  
> When I follow the segfault using gdb or pdb I end up somewhere in the  
> gnuradio internals.  
> I have no idea what causes this segfault and would be glad for any hints.  
> The source files of the rest of the block are to be found here (I do not  
> know which are actually relevant to this question):  
> [GitHub - jaseg/openmind-viewer: A gnuradio-based viewer for brain waves captured with openmind hardware · GitHub](https://github.com/jaseg/openmind-viewer)  
> Thanks in advance (hoping that I provided enough information)

Without looking too deeply into it, having looked-over your block  
source, I might suggest that a better approach to interfacing to  
your “buspirate” device would be to write an external program and  
have it communicate data over a named pipe, and your Gnu Radio  
“stuff” can simply use a ‘file source’ on the named-pipe. There’s no  
real performance penalty for this–named pipes are quite fast, and  
your source looks like it runs at a paltry 115200Kbps, which is “way  
down in the noise” as far as sample rates go.

My suspicion is that there’s something wrong with your I/O signatures  
which is causing the Gnu Radio flow-graph “organizer” to  
barf in a non-graceful way.

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org/)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.
