Gr_vector_source_c.cc segmentation fault

Hello, All:

My program got Segmentation Fault. I used gdb to trace the process and
got
the following return:

(gdb) continue
Continuing.
[New Thread -1223844944 (LWP 25403)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1223844944 (LWP 25403)]
0xb7706c79 in gr_vector_source_c::work (this=0x82bf1c8,
noutput_items=3968, input_items=@0xb70d88e8, output_items=@0x82c0560)
at gr_vector_source_c.cc:58
58 optr[i] = d_data[offset++];
Current language: auto; currently c++
(gdb)

Could anyone give some clues what is wrong with the vector?
Thanks a lot,
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 Thu, Mar 01, 2007 at 10:46:45PM -0500, Liu X. wrote:

[Switching to Thread -1223844944 (LWP 25403)]
Thanks a lot,
Xin

What version of GNU Radio are you using?
Is it from a tarball or from svn?
What OS, version and distribution are you using?
What version of g++ are you using?

Eric

Thanks for your reply, Eric.

What version of GNU Radio are you using?
gnuradio-3.0rc1

Is it from a tarball or from svn?
It is from svn.

What OS, version and distribution are you using?
I am using:
Linux jul 2.6.15-23-386 #1 PREEMPT Tue May 23 13:49:40 UTC 2006 i686
GNU/Linux

What version of g++ are you using?
g+±4.0.3
python 2.4.3

Thanks.

Xin

On Fri, Mar 02, 2007 at 05:17:38PM -0500, Liu X. wrote:

Thanks for your reply, Eric.

What version of GNU Radio are you using?
gnuradio-3.0rc1

That’s an old “release candidate”, from October 2006.

Try either the latest gnuradio-3.0.3 tarball, or the stable branch or
the trunk in subversion.

Directions on getting the code: http://gnuradio.org/trac/wiki

Eric

Yes, it is Ubuntu.
Any known issue with Ubuntu?

Thank you,
Xin

2007/3/2, Liu X. [email protected]:

What OS, version and distribution are you using?
I am using:
Linux jul 2.6.15-23-386 #1 PREEMPT Tue May 23 13:49:40 UTC 2006 i686
GNU/Linux

Judging by your kernel version, that Ubuntu, isn’t it?


Trond D.