I am trying to use GDB to debug this code, but it is difficult since I
am using GDB for the first time, know very little about Python, do not
know advanced C++ coding (haven’t really used virtual functions before)
and don’t know much about the physical behavior of radios… I was
hoping to study the working program to learn.
So far I have:
-
Downloaded the UCLA ZigBee project from CGRAN.
-
Updated the old flow_graph code to top_block in the python files. I
have also had to update Numeric code to NumPy/OldNumeric (done
automatically with a provided script).
-
Make and install the project.
-
Run src/examples/cc2420_rxtest.py (this seems to run fine, but I
cannot fully test it without the matching transmitter)
-
Run src/examples/cc2420_txtest.py (this segfaults)
So I run the txtest with a blocked wait and attach GDB. Then I press
enter to continue and use “continue” in GDB. It hits the segfault and
gives this error info. I’m not sure how to read it:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f0c43a3d700 (LWP 17349)]
0x00007f0c48a60ab0 in ucla_delay_cc::work (this=,
noutput_items=3584, input_items=,
output_items=) at ucla_delay_cc.cc:60
60 out[j] = gr_complex (real(in[j]), imag(in[j-d_delay]));
The test packet sent is the same each time:
tb.send_pkt(struct.pack(‘9B’, 0x1, 0x80, 0x80, 0xff, 0xff, 0x10, 0x0,
0x20, 0x0))
The program normally has a 1 second wait between attempts to send
packets and loops to send 10 packets. If I remove this wait and loop to
send 100 packets, the program will segfault after a random number of
packets (usually 1 or 2, but sometimes 5 and rarely as much as 45).
With the wait, it always segfaults after the 1st packet. I guess the
program dumps a packet on the queue then continues (not surprising). So
there is a separate queue reading thread and somehow that is causing the
seg fault when it gets around to reading the packet or trying to send
it. My understanding of gnuradio is very limited though, so I’m not
sure what to make of this.
If anyone has an idea please let me know and I will do my best to
continue hunting this down.
Note: I am using a USRP1, the latest (as of a week or two ago) install
script by Marcus to install gnuradio with the UHD (on Ubuntu 11.04
x86_64). The segfault occurs whether I use the RFX1800 daughterboard or
RFX2400 daughterboard.