discuss-gnuradio
[Top][All Lists]
Advanced

[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 20:38:04 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

Arrrgh!  Apologies to all.  I totally missed the all-important "2"
at the end of Irene's gr_make_io_signature2 call. Please ignore my
previous post.

@(^.^)@  Ed


Ed Criscuolo wrote:
Irene,

  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
entirely.

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





reply via email to

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