USPR segmentation fault

Hello, All:
I am running the following small program which generate a periodical
signal using vectors. I got Segmentation Fault, as shown in the
following:

========================================================================
lx@lx-desktop:sudo ./Signal3.py
Blocked waiting for GDB attach (pid = 7714)
Press Enter to continue:
Sample rate = 8M
Signal will generated by : A: Flex 2400 Tx
Carrier : 2.468G
Press Enter to quit :
uUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUSegmentation fault

Could anyone give any suggestion on how to trace the bug or why it
happens?

BTW, I tried to use gdb, whenver I do “(gdb) attach PID” the program
stops
running, it resumes until I quit from gdb.

Thank you for your input.
xin

The python program

#!/usr/bin/env python
from gnuradio import gr
from gnuradio import usrp
from gnuradio import eng_notation
import os
print ‘Blocked waiting for GDB attach (pid = %d)’ % (os.getpid(),)
raw_input ('Press Enter to continue: ')

def build_graph (carrier=2.462e9):

interp = 16
duc0 = 5e6 # IF frequency
nchan = 1

fg = gr.flow_graph ()

dest = usrp.sink_c (0, interp, nchan)
sample_rate = dest.dac_freq() / interp
print "Sample rate = ", eng_notation.num_to_str (sample_rate)
dest.set_tx_freq (0, duc0)
dest.set_pga(0,20)

max = (2**15)-1
min = -max
vector = []
for i in range(40):
vector.append(complex(max,max))
vector.append(complex(max,min))
vector.append(complex(min,max))
vector.append(complex(min,min))
for i in range(60):
vector.append(complex(0,0))

src = gr.vector_source_c(vector,True)
fg.connect (src, dest)

dboard = usrp.selected_subdev(dest, (0,0))

print “Signal will generated by :”, dboard.side_and_name()

rf = dest.tune(dboard._which, dboard, carrier)
if rf:
print “Carrier :”, eng_notation.num_to_str(rf.baseband_freq)
else:
print “The range of the daugtherboard’s frequency is :”,
eng_notation.num_to_str(dboard.freq_range()[0]), “-”,
eng_notation.num_to_str(dboard.freq_range()[1])
raise SystemExit

return fg

if name == ‘main’:

mygraph = build_graph ()
mygraph.start ()
raw_input ("Press Enter to quit : ")
mygraph.stop ()

On Wed, Feb 28, 2007 at 12:17:57PM -0500, Liu X. wrote:

Carrier : 2.468G
Press Enter to quit :
uUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUSegmentation fault

Could anyone give any suggestion on how to trace the bug or why it
happens?

Your program runs OK for me. It does not segfault.

I tested it with the current svn trunk.

Eric

Thank you for your reply, Eric.
May I ask how long you test the program? For me the segmentation fault
appears after some time (some minutes)of running .
Also I wonder what is your OS and version?
Thank you,
Xin

On Wed, Feb 28, 2007 at 04:19:14PM -0500, Liu X. wrote:

Thank you for your reply, Eric.
May I ask how long you test the program? For me the segmentation fault
appears after some time (some minutes)of running .
Also I wonder what is your OS and version?
Thank you,
Xin

I ran it for a couple of minutes.

I tested under SuSE 10.1 on a core duo x86 laptop.

[eb@cyan more-ecu]$ uname -a
Linux cyan 2.6.16.27-0.6-smp #1 SMP Wed Dec 13 09:34:50 UTC 2006 i686
i686 i386 GNU/Linux

Eric