Gstreamer & GLib memory management/profiling

Tim Müller tim at centricular.com
Fri Oct 31 06:20:42 PDT 2014


On Fri, 2014-10-31 at 13:46 +0100, Sergei Vorobyov wrote:

Hi,

> GLib's memory profiling seems incompatible with GStreamer. The
> snippet:

I don't see why anything in GStreamer should be "incompatible" with that
GLib API.

> extern GMemVTable *glib_mem_profiler_table;
> 
> 
> gint main (gint argn, gchar** args) {
>     GError *e;
>     g_mem_set_vtable (glib_mem_profiler_table);
>     if (g_mem_is_system_malloc ())
>         g_print ("system malloc is used\n");
>     else
>         g_print ("NOT system malloc is used\n");
>     g_print ("********************* point 1\n");
>     if (!gst_init_check (&argn, &args, &e)) { 
>         g_print ("failed gst_init_check: %s\n", e->message);
>     }
>     g_print ("********************* point 2\n");
>     
>     g_mem_profile ();
> 
> 
>     ...
> 
> 
> crashes at gst_init producing:
> 
> 
> fl at nuc5:~/bin$ ./mp-v01.020 
> NOT system malloc is used
> ********************* point 1
> 
> 
> (mp-v01.020:15561): GLib-WARNING **: free(0x1b32fd0): memory has been
> freed 12297829382473034410 times already
> *** Error in `./mp-v01.020': realloc(): invalid pointer:
> 0x0000000001b35e80 ***
> Aborted (core dumped)

I would guess this is just a bug somewhere (mixing glib and non-glib
alloc/realloc/free API somewhere). Do you have a full stack trace from
gdb?

Cheers
 -Tim




More information about the gstreamer-devel mailing list