New block: Segfault thrown when calling self.connect

Hello,
I wrote a GNU Radio block using the template from here:
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):

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):

Thanks in advance (hoping that I provided enough information)

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
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