[gst-devel] Gdb - help with debbug

Antoine Tremblay hexa00 at gmail.com
Thu May 7 04:41:55 CEST 2009


Did you try a backtrace ?

Type bt <enter> in gdb ..

It will show you the backtrace of the sigsegv and thus the line that
failed...

If not you can always try valgrind ...


On Wed, May 6, 2009 at 7:59 PM, Guilherme <grlongo.ireland at gmail.com> wrote:

> Hi all.
>
> I finished building my code and it's compiled without any error, but
> when I run it I get the beautiful segmentation fault.
>
> No good.
>
> Running gdb I can't get the line of the problem, instead I have this:
>
> (gdb) run
> Starting program: /home/guilherme/EBA
> [Thread debugging using libthread_db enabled]
> [New Thread 0xb7a479b0 (LWP 5565)]
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0xb7a479b0 (LWP 5565)]
> 0xb7bf2234 in ?? () from /usr/lib/libgstfft-0.10.so.0
>
> Is this a normal debug or I'm doing smth wrong?
> It seen a problem with my fft implementation. That is the code:
>
>
>          #include<gst/gst.h>
>
>
>          #include<glib.h>
>
>
>          #include<gst/fft/gstffts16.h>
>
>
>
>          static gboolean bus_call(GstBus *bus, GstMessage *msg,
>          gpointer data);
>
>
>
>          int main(int argc, char *argv[])
>
>
>          {
>
>
>              GMainLoop *loop;
>
>
>
>
>
>              GstElement *pipeline, *source, *filesink;
>
>
>              GstBus *bus;
>
>
>              GstBuffer *buffer;
>
>
>              GstFFTS16 *fft;
>
>
>
>
>
>              const gint16 *in;
>
>
>              GstFFTS16Complex *freq;
>
>
>
>
>
>              gst_init(&argc, &argv);
>
>
>
>
>
>              loop = g_main_loop_new (NULL, FALSE);
>
>
>
>
>
>              /*creating elements*/
>
>
>              pipeline      = gst_pipeline_new          ("audio-player");
>
>
>              source        = gst_element_factory_make  ("audiotestsrc",
>          "file-source");
>
>
>              filesink      = gst_element_factory_make  ("alsasink",
>          "audio-output");
>
>
>              fft           = gst_fft_s16_new           (128, FALSE);
>
>
>
>
>
>
>
>
>              if (!pipeline || !source || !filesink) {
>
>
>                  g_printerr ("One element could not be created.
>          Exiting.\n");
>
>
>                  return -1;
>
>
>              }
>
>
>
>
>
>              /*set-up the pipeline*/
>
>
>
>
>
>              /*create and set up buffer*/
>
>
>              g_print ("\n\nCreating Buffer\n");
>
>
>              buffer = gst_buffer_new();
>
>
>              if(!buffer)
>
>
>                  g_printerr ("buffer could not be created\n");
>
>
>              else
>
>
>                  g_print ("Buffer Created\n\n");
>
>
>
>
>
>              /*set up fft transform*/
>
>
>              gst_fft_s16_fft (fft, in, freq);
>
>
>
>
>
>
>
>
>
>              /*message handler*/
>
>
>              bus =  gst_pipeline_get_bus (GST_PIPELINE (pipeline));
>
>
>              gst_bus_add_watch (bus, bus_call, loop);
>
>
>              gst_object_unref (bus);
>
>
>
>
>
>              /*colocar todos elementos na pipeline*/
>
>
>              gst_bin_add_many (GST_BIN (pipeline), source, filesink, NULL);
>
>
>
>
>
>              /*Linkar elementos*/
>
>
>              /*Cria o link entre os pads dos elementos*/
>
>
>              gst_element_link_many (source, filesink, NULL);
>
>
>
>
>
>
>
>
>              /* set pipeline playing status */
>
>
>              gst_element_set_state (pipeline, GST_STATE_PLAYING);
>
>
>              g_print ("Running...\n");
>
>
>
>
>
>              /*iterate*/
>
>
>              g_main_loop_run (loop);
>
>
>              g_print ("Recording\n");
>
>
>
>
>
>              /* Out of the main loop, clean up nicely */
>
>
>             g_print ("Returned, stopping playback\n");
>
>
>             gst_element_set_state (pipeline, GST_STATE_NULL);
>
>
>
>             g_print ("Deleting pipeline\n");
>
>
>             gst_object_unref (GST_OBJECT (pipeline));
>
>
>
>            return 0;
>
>
>          }
>
>
>
>          static gboolean bus_call(GstBus *bus, GstMessage *msg,
>          gpointer data) {
>
>
>
>              return TRUE;
>
>
>          }
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090506/b354dea4/attachment.htm>


More information about the gstreamer-devel mailing list