Gnuradio "double free or corruption (!prev)" error

60 Views Asked by At

I make two OOT block in gnuradio for udp tx/rx, with the itemsize 188 for input/output, rx block recieve udp ts stream and do packetFragmentation, and tx block do defragmentation then transmit udp stream to VLC, it and work success as the flowgraph below (ffmpeg -> gnuradio udprx -> gnuradio -> VLC) :

Then I want to connect to the modulation system, but it can't work because of the itemsize mismatch ,bbheader only accept 1 itemsize instead 188

so I tried to make two blocks, let two sides can respectively accept 188 and 1 itemsize

#include "udppacket_impl.h"
#include <gnuradio/io_signature.h>

namespace gr {
namespace udp0129 {

udppacket::sptr udppacket::make() { return gnuradio::make_block_sptr<udppacket_impl>(); }


/*
 * The private constructor
 */
udppacket_impl::udppacket_impl()
    : gr::sync_block("udppacket",
                     gr::io_signature::make(1 , 1 , sizeof(unsigned char)*188),
                     gr::io_signature::make(1 , 1 , sizeof(unsigned char)))
{
}

/*
 * Our virtual destructor.
 */
udppacket_impl::~udppacket_impl() {}

int udppacket_impl::work(int noutput_items,
                         gr_vector_const_void_star& input_items,
                         gr_vector_void_star& output_items)
{
    const unsigned char *in = (const unsigned char *) input_items[0];
    unsigned char *out = (unsigned char *) output_items[0];

    for(int i = 0; i < noutput_items; i++) 
    {
        out[i]=in[i];
    }

    
    return noutput_items;
}

}
}

#include "packetudp_impl.h"
#include <gnuradio/io_signature.h>

namespace gr {
namespace udp0129 {


packetudp::sptr packetudp::make() { return gnuradio::make_block_sptr<packetudp_impl>(); }


/*
 * The private constructor
 */
packetudp_impl::packetudp_impl()
    : gr::sync_block("packetudp",
                     gr::io_signature::make(
                         1 , 1 , sizeof(unsigned char)),
                     gr::io_signature::make(
                         1 , 1 , sizeof(unsigned char)*188))
{
}

/*
 * Our virtual destructor.
 */
packetudp_impl::~packetudp_impl() {}

int packetudp_impl::work(int noutput_items,
                         gr_vector_const_void_star& input_items,
                         gr_vector_void_star& output_items)
{
    const unsigned char *in = (const unsigned char *) input_items[0];
    unsigned char *out = (unsigned char *) output_items[0];

    for(int i = 0; i < noutput_items; i++) 
    {
        out[i]=in[i];
    }

    
    return noutput_items;
}

} /* namespace udp0129 */
} /* namespace gr */

flowgraph can be run ,but it can't work properly ,when I push the udp stream flow from ffmpeg , VLC side jump out messeage said screenshot

In gnuradio it automaticly stop the program with the message below:

enter image description here

I need some help with this

0

There are 0 best solutions below