GNOME Bugzilla – Bug 316809
bug in gstinfo.c -> _gst_debug_register_funcptr
Last modified: 2005-09-21 21:39:13 UTC
I'me running 4 gst-launch at the same time in a loop, with all the same pipeline having 2 spiders in 2 thread (1 spider / thread). somthing like: gst-launch {src ! spider ... ! queue} mux {src ! spider .. ! queue } mux I found that sometimes, my process is stuck somewhere and take 100% of it's current CPU. I think this is cause by the fact that we should have a mutex to serialize the _gst_debug_register_funcptr. If I add a new mutex that lock/unlock at the begin/end of this function, it fix the problem. Does it make sens? Francis _______________ This addition fix the problem _______________ ... GHashTable *__gst_function_pointers = NULL; +static GStaticMutex __dbg_functions = G_STATIC_MUTEX_INIT; ... .. void * _gst_debug_register_funcptr (void *ptr, gchar * ptrname) { + g_static_mutex_lock(&__dbg_functions); if (!__gst_function_pointers) __gst_function_pointers = g_hash_table_new (g_direct_hash, g_direct_equal); if (!g_hash_table_lookup (__gst_function_pointers, ptr)) g_hash_table_insert (__gst_function_pointers, ptr, ptrname); + g_static_mutex_unlock(&__dbg_functions); return ptr; } _______________________________________________________ backtrace if I attach gdb when gst-launch run at 100% ______________________________________________________
+ Trace 63110
Thanks, committed to HEAD and 0.8 branch. 2005-09-21 Francis Labonte <francis_labonte at hotmail dot com> Reviewed by: Tim-Philipp Muller <tim at centricular dot net> * gst/gstinfo.c: (_gst_debug_nameof_funcptr), (_gst_debug_register_funcptr): Add mutex to serialise access to the hash table with the function pointer => function name string mapping; make that hash table static scope (#316809). Cheers -Tim