Did you try a backtrace ?<br><br>Type bt <enter> in gdb ..<br><br>It will show you the backtrace of the sigsegv and thus the line that failed...<br><br>If not you can always try valgrind ...<br><br><br><div class="gmail_quote">
On Wed, May 6, 2009 at 7:59 PM, Guilherme <span dir="ltr"><<a href="mailto:grlongo.ireland@gmail.com">grlongo.ireland@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all.<br>
<br>
I finished building my code and it's compiled without any error, but<br>
when I run it I get the beautiful segmentation fault.<br>
<br>
No good.<br>
<br>
Running gdb I can't get the line of the problem, instead I have this:<br>
<br>
(gdb) run<br>
Starting program: /home/guilherme/EBA<br>
[Thread debugging using libthread_db enabled]<br>
[New Thread 0xb7a479b0 (LWP 5565)]<br>
<br>
Program received signal SIGSEGV, Segmentation fault.<br>
[Switching to Thread 0xb7a479b0 (LWP 5565)]<br>
0xb7bf2234 in ?? () from /usr/lib/libgstfft-0.10.so.0<br>
<br>
Is this a normal debug or I'm doing smth wrong?<br>
It seen a problem with my fft implementation. That is the code:<br>
<br>
<br>
#include<gst/gst.h><br>
<br>
<br>
#include<glib.h><br>
<br>
<br>
#include<gst/fft/gstffts16.h><br>
<br>
<br>
<br>
static gboolean bus_call(GstBus *bus, GstMessage *msg,<br>
gpointer data);<br>
<br>
<br>
<br>
int main(int argc, char *argv[])<br>
<br>
<br>
{<br>
<br>
<br>
GMainLoop *loop;<br>
<br>
<br>
<br>
<br>
<br>
GstElement *pipeline, *source, *filesink;<br>
<br>
<br>
GstBus *bus;<br>
<br>
<br>
GstBuffer *buffer;<br>
<br>
<br>
GstFFTS16 *fft;<br>
<br>
<br>
<br>
<br>
<br>
const gint16 *in;<br>
<br>
<br>
GstFFTS16Complex *freq;<br>
<br>
<br>
<br>
<br>
<br>
gst_init(&argc, &argv);<br>
<br>
<br>
<br>
<br>
<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
<br>
<br>
<br>
<br>
/*creating elements*/<br>
<br>
<br>
pipeline = gst_pipeline_new ("audio-player");<br>
<br>
<br>
source = gst_element_factory_make ("audiotestsrc",<br>
"file-source");<br>
<br>
<br>
filesink = gst_element_factory_make ("alsasink",<br>
"audio-output");<br>
<br>
<br>
fft = gst_fft_s16_new (128, FALSE);<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
if (!pipeline || !source || !filesink) {<br>
<br>
<br>
g_printerr ("One element could not be created.<br>
Exiting.\n");<br>
<br>
<br>
return -1;<br>
<br>
<br>
}<br>
<br>
<br>
<br>
<br>
<br>
/*set-up the pipeline*/<br>
<br>
<br>
<br>
<br>
<br>
/*create and set up buffer*/<br>
<br>
<br>
g_print ("\n\nCreating Buffer\n");<br>
<br>
<br>
buffer = gst_buffer_new();<br>
<br>
<br>
if(!buffer)<br>
<br>
<br>
g_printerr ("buffer could not be created\n");<br>
<br>
<br>
else<br>
<br>
<br>
g_print ("Buffer Created\n\n");<br>
<br>
<br>
<br>
<br>
<br>
/*set up fft transform*/<br>
<br>
<br>
gst_fft_s16_fft (fft, in, freq);<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
/*message handler*/<br>
<br>
<br>
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
<br>
<br>
gst_bus_add_watch (bus, bus_call, loop);<br>
<br>
<br>
gst_object_unref (bus);<br>
<br>
<br>
<br>
<br>
<br>
/*colocar todos elementos na pipeline*/<br>
<br>
<br>
gst_bin_add_many (GST_BIN (pipeline), source, filesink, NULL);<br>
<br>
<br>
<br>
<br>
<br>
/*Linkar elementos*/<br>
<br>
<br>
/*Cria o link entre os pads dos elementos*/<br>
<br>
<br>
gst_element_link_many (source, filesink, NULL);<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
/* set pipeline playing status */<br>
<br>
<br>
gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br>
<br>
g_print ("Running...\n");<br>
<br>
<br>
<br>
<br>
<br>
/*iterate*/<br>
<br>
<br>
g_main_loop_run (loop);<br>
<br>
<br>
g_print ("Recording\n");<br>
<br>
<br>
<br>
<br>
<br>
/* Out of the main loop, clean up nicely */<br>
<br>
<br>
g_print ("Returned, stopping playback\n");<br>
<br>
<br>
gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>
<br>
<br>
g_print ("Deleting pipeline\n");<br>
<br>
<br>
gst_object_unref (GST_OBJECT (pipeline));<br>
<br>
<br>
<br>
return 0;<br>
<br>
<br>
}<br>
<br>
<br>
<br>
static gboolean bus_call(GstBus *bus, GstMessage *msg,<br>
gpointer data) {<br>
<br>
<br>
<br>
return TRUE;<br>
<br>
<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
------------------------------------------------------------------------------<br>
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your<br>
production scanning environment may not be a perfect world - but thanks to<br>
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700<br>
Series Scanner you'll get full speed at 300 dpi even with all image<br>
processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br>