# Segmentation fault

**URL:** <https://www.ruby-forum.com/t/segmentation-fault/217040>\
**Category:** GNU Radio\
**Created:** [February 20, 2012, 11:50am UTC](https://www.ruby-forum.com/t/segmentation-fault/217040 "2012-02-20T11:50:00Z")\
**Posts on this page:** 4\
**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:** [February 20, 2012, 11:50am UTC](https://www.ruby-forum.com/t/segmentation-fault/217040/1 "2012-02-20T11:50:00Z")

</div>

Hi all,

I’ve been working lately to get to work the mimo files from trondeau’s  
branch. After some trials, I thought I’ve successfully merged the master  
branch into this branch so I could use the mimo files. However, when  
trying to run the benchmark\_mimo\_ofdm.py file a segmentation fault is  
happening. I’ve been reading about this error but I don’t know yet where  
it  
comes from. I’ve checked the “How do I debug GNU Radio in Python” from  
the  
FAQ to see what to do in this case. I’ve followed the 2 steps suggested  
in  
this point but I don’t understand the results coming from the (gdb)  
backtrace. If anyone has experience with this problem or knows how to  
understand this message I would really appreciate any help. I enclose  
the  
messages I’m getting.

This is what it shows when trying to run benchmark\_ofdm\_mimo.py:

./benchmark\_ofdm\_mimo.py  
linux; GNU C++ version 4.4.1 [gcc-4\_4-branch revision 150839];  
Boost\_103900; UHD\_003.004.000-122b947

27435  
Press Enter to continue  
Noise voltage: 4.472135955  
Frequency offset: 0  
Symbols per Packet: 16.0  
Samples per Packet: 11520.0

> > > gr\_fir\_ccf: using 3DNow!  
> > > gr\_fir\_ccc: using 3DNow!Ext  
> > > gr\_fir\_fff: using 3DNow!  
> > > Transmitter using 1  
> > > Receiver using 2  
> > > x

After following the steps suggested it shows:

(gdb) backtrace  
#0 gr\_ofdm\_alamouti\_frame\_acquisition::calculate\_equalizer  
(this=0x1137c40, channel=, symbol=,  
zeros\_on\_left=) at  
gr\_ofdm\_alamouti\_frame\_acquisition.cc:210  
#1 0x00007f4b40673f67 in  
gr\_ofdm\_alamouti\_frame\_acquisition::general\_work  
(this=0x1137c40, noutput\_items=,  
ninput\_items=, input\_items=std::vector of  
length  
3, capacity 3 = {…}, output\_items=)  
at gr\_ofdm\_alamouti\_frame\_acquisition.cc:245  
#2 0x00007f4b40702c65 in gr\_block\_executor::run\_one\_iteration  
(this=0x7f4b187d7f20) at gr\_block\_executor.cc:378  
#3 0x00007f4b407235c2 in gr\_tpb\_thread\_body::gr\_tpb\_thread\_body  
(this=, block=…) at gr\_tpb\_thread\_body.cc:49  
#4 0x00007f4b4071c20c in  
boost::detail::function::void\_function\_obj\_invoker0\<gruel::thread\_body\_wrapper\<tpb\_container\>,  
void\>::invoke(boost::detail::function::function\_buffer&) () from  
/usr/local/lib64/libgnuradio-core-3.4.2git.so.0  
#5 0x00007f4b4010cd64 in boost::function0::operator()  
(this=) at /usr/include/boost/function/function\_template.hpp:989  
#6 0x00007f4b3fce1010 in thread\_proxy () from  
/usr/lib64/libboost\_thread.so.1.39.0  
#7 0x00007f4b415d665d in start\_thread () from /lib64/libpthread.so.0  
#8 0x00007f4b40ce9ecd in clone () from /lib64/libc.so.6  
#9 0x0000000000000000 in ?? ()

Thanks in advance,

Jorge

---

<div class="post-metadata">

**Author:** ![Jorge\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@Jorge\_H](https://www.ruby-forum.com/u/Jorge_H)\
**Post date:** [February 20, 2012, 11:43pm UTC](https://www.ruby-forum.com/t/segmentation-fault/217040/2 "2012-02-20T23:43:10Z")

</div>

On Mon, Feb 20, 2012 at 5:48 AM, Jorge H. \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> backtrace. If anyone has experience with this problem or knows how to  
> Press Enter to continue
> 
> ```
> ninput_items=<value optimized out>, input_items=std::vector of length
> 
> ```
> 
> #5 0x00007f4b4010cd64 in boost::function0::operator() (this=\<value

Hi Jorge,  
So what that backtrace is telling you is on the #0 line that the seg  
fault  
is occurring here:  
gr\_ofdm\_alamouti\_frame\_acquisition.cc:210

So it’s that file, line 210.

All that does is narrow your search down for where it’s going wrong, but  
this one isn’t going to tell you what’s wrong with it.

So you’re doing a 1x2 code. I know when Matt and I left off with this  
branch, there were some definite issues, and this might just be one of  
them. Have you tried to do a 2x1 MIMO? I’m pretty sure we had that  
working.  
I can’t really remember…

I’m afraid I can’t help you more right now, yo’re going to have to look  
into that file and try to figure out why it’s segfaulting one you. But,  
thanks for reading over the FAQ and posting the back trace! And you  
figured  
out how to merge those two branches, so it sounds like you’re heading in  
the right direction!

Tom

---

<div class="post-metadata">

**Author:** ![Jorge\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@Jorge\_H](https://www.ruby-forum.com/u/Jorge_H)\
**Post date:** [February 22, 2012, 3:27pm UTC](https://www.ruby-forum.com/t/segmentation-fault/217040/3 "2012-02-22T15:27:45Z")

</div>

Hi,

Actually what I’m trying to do is a 2x1 MIMO, but I was trying to run  
the  
benchmark with its default set up to see if I had success with the  
merging.  
As you said, this segmentation fault must appear somewhere when trying  
to  
implement 2 receivers, when you adjust the parameters for 2 tx antennas  
and  
1 rx antennas there is no problem to run it.

So, now I think I have this benchmark\_ofm\_mimo prepared to work I’m  
finding  
another problems…I am using two USRP2 with XCVR2450 daughterboards in  
the  
transmitter side and another one in the receiver side (less than 1 meter  
of  
distance between tx and rx). My first problem comes when setting the  
sample  
rate, I don’t know if I should set the sample rate in the rx usrp as the  
sum of the two sample rates of the tx usrps, or it has nothing to  
do…Also, I’ve been reading the UHD/USRP2 application notes and I think  
I’ve got how to configure the slave usrp but I am not sure. I enclose my  
code so anyone who has any adviece can have a look at it. Appart from  
this  
issues, my heaviest problem is how to introduce an input into the  
transmission chain. I see how packets are made and sent in the  
benchmark\_ofmd\_mimo, but how should I proceed if I want to use my own  
source block (in my case it would be a wavfile source)? Thank you for  
your  
support, I will appreciate any help!

2012/2/20 Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Jorge\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@Jorge\_H](https://www.ruby-forum.com/u/Jorge_H)\
**Post date:** [February 22, 2012, 3:30pm UTC](https://www.ruby-forum.com/t/segmentation-fault/217040/4 "2012-02-22T15:30:15Z")

</div>

I had forgotten to enclose the code, here it goes!

```
   # USRP2 sinks

```

#####################################################################################################

```
    # slave USRP2
    self.usrp2_sink_slave = uhd.single_usrp_sink(
        device_addr="addr=192.168.20.3",
        io_type=uhd.io_type_t.COMPLEX_FLOAT32,
        num_channels=1,
        )
    _config = uhd.clock_config()
    _config.ref_source = uhd.clock_config.REF_MIMO
    _config.pps_source = uhd.clock_config.PPS_MIMO
    self.usrp2_sink_slave.set_clock_config(_config, 0)
    self.usrp2_sink_slave.set_samp_rate(self.output_samp_rate)
    self.usrp2_sink_slave.set_center_freq(self.center_frequency, 0)
    self.usrp2_sink_slave.set_gain(self.tx_gain, 0)
    # master USRP2
    self.usrp2_sink_master = uhd.single_usrp_sink(
        device_addr="addr=192.168.10.4",
        io_type=uhd.io_type_t.COMPLEX_FLOAT32,
        num_channels=1,
        )
    self.usrp2_sink_master.set_samp_rate(self.output_samp_rate)
    self.usrp2_sink_master.set_center_freq(self.center_frequency, 0)
    self.usrp2_sink_master.set_gain(self.tx_gain, 0)

```

2012/2/22 Jorge H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
