discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] usrp_spectrum_sense.py segmentation fault problem


From: Sebastian Döring
Subject: Re: [Discuss-gnuradio] usrp_spectrum_sense.py segmentation fault problem
Date: Wed, 21 Dec 2011 14:36:58 +0100

On Tue, 20 Dec 2011 20:24:28 -0500
 Tom Rondeau <address@hidden> wrote:
On Tue, Dec 20, 2011 at 11:02 AM, Thomas Tsou <address@hidden> wrote:

On Tue, Dec 20, 2011 at 5:11 AM, Sebastian Döring
<address@hidden> wrote:
>>
------------------------------------------------------------------------------------------------------
>> #0  0x0013a455 in sem_post@@GLIBC_2.1 () from
>> /lib/tls/i686/cmov/libpthread.so.0
>> #1  0x0810ab61 in PyThread_release_lock (lock=0x0) at
>> ../Python/thread_pthread.h:374
>> #2 0x080dbad3 in PyEval_ReleaseLock () at ../Python/ceval.c:262
>> #3  0x00fa6073 in gr_py_feval_dd::calleval(double) ()

This is likely a similar issue with the Python GIL (global interpreter lock) that occurred previously on the E100. In that case the final
cause was a missing ctypes library.


http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2011-June/001479.html

To find out, try this thread hack. The patch is old, so you will probably need to apply manually against the current master.

diff --git a/uhd_spectrum_sense_sum.py b/uhd_spectrum_sense_sum.py
index 70f530f..31bf458 100644
--- a/uhd_spectrum_sense_sum.py
+++ b/uhd_spectrum_sense_sum.py
@@ -32,7 +32,11 @@ import sys
 import math
 import struct
 import time
+import threading

+class ThreadClass(threading.Thread):
+    def run(self):
+        return

 class tune(gr.feval_dd):
   """
@@ -306,6 +310,9 @@ def main_loop(tb):


 if __name__ == '__main__':
+    t = ThreadClass()
+    t.start()
+
   tb = my_top_block()
   try:
tb.start() # start executing flow graph in
another thread...

 Thomas



Please let us know if this patch works. I think this has been an outstanding issue in GNU Radio for a while. It'd be good to get a fix for
it in.

Thanks,
Tom

Thank you guys - it worked!
The line positions have a changed a bit and so I simply attached the new code (gnuradio build 20.12.2011).

--- a/usrp_spectrum_sense.py 2011-12-20 12:44:55.000000000 +0100 +++ b/usrp_spectrum_sense.py 2011-12-21 14:26:19.252873684 +0100
@@ -28,9 +28,14 @@
 import sys
 import math
 import struct
+import threading
sys.stderr.write("Warning: this is known to have issues on some machines+Python version combinations to seg fault due to the callback in bin_statitics. If you figure out why, we'd love to hear about it!\n") +class ThreadClass(threading.Thread):
+    def run(self):
+        return
+
 class tune(gr.feval_dd):
     """
     This class allows C++ code to callback into python.
@@ -240,6 +245,9 @@
 if __name__ == '__main__':
+    t = ThreadClass()
+    t.start()
+
     tb = my_top_block()
     try:
         tb.start()

Regards
Sebastian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]