[Top][All Lists]

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

Re: [Discuss-gnuradio] Segmentation fault (core dump)

From: Ed Criscuolo
Subject: Re: [Discuss-gnuradio] Segmentation fault (core dump)
Date: Mon, 07 Jul 2008 10:39:09 -0400
User-agent: Thunderbird (Macintosh/20071031)


  I believe the problem is that you are trying to have two different
types of output streams. According to the documentation on
gr_io_signature, it looks like multiple output streams must
all be of the same type. Or at least of types that have the
same size.

In your code, you try to declare an output signature with
two types:

  gr_make_io_signature2 (1, 2, sizeof (unsigned char), sizeof (float))) 

Apparently, the first one (sizeof(unsigned char)) is getting used
for all outputs, and the second one is being ignored.

Then, later in your "work" method, you setup the output pointers
as "pointer to unsigned char" and "pointer to float":

  unsigned char *out = (unsigned char *) output_items[0];
  float *foptr = (float *) output_items[1];

But since what you are being handed is a "pointer to unsigned char"
for both, the successive values of foptr will overwrite each other,
and the ones towards the end of the array will overrun the buffer

Your segmentation fault is likely caused by either the buffer overrun,
or trying to write a float to an odd or non-aligned address.

@(^.^)@  Ed

irene159 wrote:


I have modified gr_constellation_decoder_cb.cc in order to have a second
output stream (type float) sending back min_euclid_dist.

Please take a look and let me know if there are any errors, I am not sure of
how to code two outputs with different data types.

To update the code after this modification I have done a make and make
install in the directory /usr/src/gnuradio/gnuradio-core/src/lib/general as
well as in /usr/src/gnuradio/gnuradio-core/src/lib.

I am now permanently receiving "Segmentation fault (core dump)" error
Can somebody help me out ?

Regards, Irene

reply via email to

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