> If you find that it's not working for you or still producing segmentation
> faults on close, please let me know (and let me know your OS, CPU, and any
> other relevant features you can think of). I have run it on a few machines
> and various VMs, but it's a limited set. You can try the
> gr-qtgui/apps/pyqt_example_c.py as a test.
> 

So I put together a simple flow graph in grc, noise -> throttle -> qt
sink. I ran it repeatedly and alt + f4'd. Here are the results. Python
app attached. Ubuntu 10.10 x64 latest gnuradio master
e8ff9ef4bb77517428e1208ff4b3551a38107bbd

jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$ ./top_block.py
Segmentation fault
jblum@blarg:~/work/grc$ ./top_block.py
jblum@blarg:~/work/grc$

So it prints segfault when I exit the app for many of those runs. I had
also tried this test with a UHD block where the destructors had a print
in it. What I observed was the the destructor w/ the print was not
called most of the time, even when it didnt print segfault. So my guess
is that many of those seemingly successful exit events are not good.

Can you run my app in succession 20 times and see if it says segfault?

Thanks,
-Josh
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Top Block
# Generated: Wed Apr 13 14:19:39 2011
##################################################

from PyQt4 import Qt
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio.eng_option import eng_option
from gnuradio.gr import firdes
from gnuradio.qtgui import qtgui
from optparse import OptionParser
import sip
import sys

class top_block(gr.top_block, Qt.QWidget):

	def __init__(self):
		gr.top_block.__init__(self, "Top Block")
		Qt.QWidget.__init__(self)
		self.setWindowTitle("Top Block")
		self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
		self.top_layout = Qt.QVBoxLayout(self)
		self.top_grid_layout = Qt.QGridLayout()
		self.top_layout.addLayout(self.top_grid_layout)

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 1e6

		##################################################
		# Blocks
		##################################################
		self.qtgui_sink_x_0 = qtgui.sink_c(
			1024, #fftsize
			firdes.WIN_BLACKMAN_hARRIS, #wintype
			0, #fc
			samp_rate, #bw
			"QT GUI Plot", #name
			True, #plotfreq
			False, #plotwaterfall
			False, #plottime
			False, #plotconst
		)
		self._qtgui_sink_x_0_win = sip.wrapinstance(self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget)
		self.top_layout.addWidget(self._qtgui_sink_x_0_win)
		self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate)
		self.gr_noise_source_x_0 = gr.noise_source_c(gr.GR_GAUSSIAN, 1, 42)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_throttle_0, 0), (self.qtgui_sink_x_0, 0))
		self.connect((self.gr_noise_source_x_0, 0), (self.gr_throttle_0, 0))

	def get_samp_rate(self):
		return self.samp_rate

	def set_samp_rate(self, samp_rate):
		self.samp_rate = samp_rate
		self.qtgui_sink_x_0.set_frequency_range(0, self.samp_rate)

if __name__ == '__main__':
	parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
	(options, args) = parser.parse_args()
	qapp = Qt.QApplication(sys.argv)
	tb = top_block()
	tb.start()
	tb.show()
	qapp.exec_()

_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to