discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Freeing memory problem in GNURadio


From: Gorur, Anisha - 0662 - MITLL
Subject: Re: [Discuss-gnuradio] Freeing memory problem in GNURadio
Date: Mon, 11 Jun 2018 17:49:08 +0000

After some more debugging, I've distilled my problem and it's really similar to here: https://lists.gnu.org/archive/html/discuss-gnuradio/2017-06/msg00104.html

The flowgraph tries to access a port, and gets messed up after reading a bad pointer in memory. Has anyone seen or fixed this error? I'm working off of a clean SDK install and am following all of the cross compile instructions, so I'm not sure what it could be.


Program received signal SIGBUS, Bus error.
0xb64de4dc in operator++ (this=0x5)
    at /home/user/projects/new_emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/smart_ptr/detail/atomic_count_sync.hpp:45
45      /home/user/projects/new_emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/smart_ptr/detail/atomic_count_sync.hpp: No such file or directory.
(gdb) bt
#0  0xb64de4dc in operator++ (this=0x5)
    at /home/user/projects/new_emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/smart_ptr/detail/atomic_count_sync.hpp:45
#1  pmt::intrusive_ptr_add_ref (p=0x1) at /home/user/projects/new_emb/src/gnuradio/gnuradio-runtime/lib/pmt/pmt.cc:66
#2  0xb64e3a88 in intrusive_ptr (rhs=..., this=0xbeffeb80)
    at /home/user/projects/new_emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/smart_ptr/intrusive_ptr.hpp:92
#3  pmt::dict_has_key (dict=..., key=...) at /home/user/projects/new_emb/src/gnuradio/gnuradio-runtime/lib/pmt/pmt.cc:910
#4  0xb6565964 in gr::flowgraph::check_valid_port (address@hidden, e=...)
    at /home/user/projects/new_emb/src/gnuradio/gnuradio-runtime/lib/flowgraph.cc:158
#5  0xb6567ad8 in gr::flowgraph::connect (address@hidden, src="" dst=...)
    at /home/user/projects/new_emb/src/gnuradio/gnuradio-runtime/lib/flowgraph.cc:502
...

Thanks,

Anisha


From: Discuss-gnuradio <discuss-gnuradio-bounces+address@hidden> on behalf of Gorur, Anisha - 0662 - MITLL <address@hidden>
Sent: Friday, June 8, 2018 4:27:15 PM
To: address@hidden
Subject: [Discuss-gnuradio] Freeing memory problem in GNURadio
 
Hello,
I've been having a strange problem with the gr-fec block, and I think it may be connected to other issues I'm having. I'm running a flowgraph on the E310 using the LDPC Encoder Definition (via Generator), LDPC Generator Matrix, and FEC Async Encoder blocks and it has been running fine for a few months. For another block, I needed to update the Volk library because I wanted a new kernel, but when I did so a couple of things started to break.

I thought this was due to my update of GNURadio/Volk, but I have reinstalled the SDK as well as UHD and GNUradio from source (using these instructions: https://files.ettus.com/manual/page_usrp_e3x0.html) and I still get the same problems. I am using UHD version 3.9.2 (I need to for other compatibility issues, this has not given me trouble in the past) and GNURadio 3.7.11.1 (The version I was using when everything worked). My cross compiling also seems to be working fine, I get no errors in my cmake or make process. I am using the fpga files and SDK from here: http://files.ettus.com/e3xx_images/e3xx-release-4/

In the following gdb backtraces, I've built both GNURadio and my OOT module with -DCMAKE_BUILD_TYPE=Debug. 

Error 1:
When I kill a flowgraph with the LDPC Encoder in it, I get either a  segfault or an invalid pointer error when the program tries to call the  destructor of ldpc_gen_mtrx_encoder_impl.cc. (full backtrace in message_port_in_not_working.txt)

```
-- Loading FPGA image: /home/root/emb/usr/share/uhd/images/usrp_e3xx_fpga_idle_sg3.bit...[Thread 0xa95ff460 (LWP 1241) exited]
 done
[Thread 0xb1546460 (LWP 1227) exited]
*** Error in `/usr/bin/python': munmap_chunk(): invalid pointer: 0xb6fa7d10 ***

Program received signal SIGABRT, Aborted.
0xb6d38894 in __GI_raise (address@hidden) at ../sysdeps/unix/sysv/linux/raise.c:55
55        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  0xb6d38894 in __GI_raise (address@hidden) at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0xb6d3c394 in __GI_abort () at abort.c:89
#2  0xb6d707b8 in __libc_message (do_abort=<optimized out>, fmt=0xb6e28a00 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0xb6d7aa74 in malloc_printerr (action="" str=0xb6e28a24 "munmap_chunk(): invalid pointer", ptr=<optimized out>) at malloc.c:4960
#4  0xb6d7ab94 in munmap_chunk (p=<optimized out>) at malloc.c:2817
#5  0xb3df81d8 in gsl_block_free (b=0xb6f9fda8 <PyInt_Type>) at /usr/src/debug/gsl/1.15-r0/gsl-1.15/block/init_source.c:78
#6  0xb3e47b40 in gsl_matrix_free (m=0x1d754) at /usr/src/debug/gsl/1.15-r0/gsl-1.15/matrix/init_source.c:189
#7  0xb3fbedc4 in gr::fec::code::ldpc_G_matrix_impl::~ldpc_G_matrix_impl (address@hidden, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /home/agorur/projects/emb/src/gnuradio/gr-fec/lib/ldpc_G_matrix_impl.cc:294
#8  0xb3fc0664 in ~ldpc_G_matrix_impl (this=0x7af6c0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /home/agorur/projects/emb/src/gnuradio/gr-fec/lib/ldpc_G_matrix_impl.cc:295
#9  checked_delete<gr::fec::code::ldpc_G_matrix_impl> (x=0x7af6c0) at /home/agorur/projects/emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/core/checked_delete.hpp:34
```

Error 2: I have my own message block, which has suddenly stopped working, the flowgraph does not recognize the input port (called pdus_in) and the backtrace traces back to a boost header file. (full backtrace in ldpc_destructor_free_error.txt)
```
-- Loading FPGA image: /home/root/emb/usr/share/uhd/images/usrp_e310_fpga_sg3.bit... done
-- Input frequency reference: 40 MHz
-- Detecting internal GPSDO [New Thread 0xb1546460 (LWP 1249)]
.... found
-- Initializing core control...
-- Performing register loopback test... pass
-- Performing register loopback test... pass
-- Performing register loopback test... pass
-- Performing CODEC loopback test... pass
-- Performing CODEC loopback test... pass
-- Setting time source to internal
-- Asking for clock rate 10.24 MHz
-- Actually got clock rate 10.24 MHz
-- Performing timer loopback test... pass
-- Performing timer loopback test... pass
-- Setting time source to gpsdo
Could not find port: pdus_in in:
system
pdus_in
Program received signal SIGBUS, Bus error.
0xb64d24d8 in fetch_add (order=boost::memory_order_relaxed, v=1, address@hidden: <error reading variable>) at /home/agorur/projects/emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/atomic/detail/ops_gcc_atomic.hpp:100
100     /home/agorur/projects/emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/atomic/detail/ops_gcc_atomic.hpp: No such file or directory.
(gdb) bt
#0  0xb64d24d8 in fetch_add (order=boost::memory_order_relaxed, v=1, address@hidden: <error reading variable>) at /home/agorur/projects/emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/atomic/detail/ops_gcc_atomic.hpp:100
#1  fetch_add (order=boost::memory_order_relaxed, v=1, this=0x6) at /home/agorur/projects/emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/atomic/detail/atomic_template.hpp:115
#2  pmt::intrusive_ptr_add_ref (p=0x2) at /home/agorur/projects/emb/src/gnuradio/gnuradio-runtime/lib/pmt/pmt.cc:69
#3  0xb655a5f8 in intrusive_ptr (rhs=..., this=0xbeffec54) at /home/agorur/projects/emb/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/boost/smart_ptr/intrusive_ptr.hpp:92
```
I've rebuilt the SDK multiple times, I'm really not sure what could be giving me these errors.
Thank you,

Anisha Gorur

reply via email to

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