Re: Deadlock in Gst::init()



On May 12, 2012, at 2:02 AM, Antoine Jacoutot <ajacoutot bsdfrog org> wrote:

> On Thu, May 10, 2012 at 11:03:41PM -0400, José Alburquerque wrote:
>> I can't reproduce this on an ubuntu 12.04 system using the same
>> versions of GStreamer and gstreamermm.  'make check' of the
>> gstreamermm-0.10.10.1 tarball succeeds (building and running the tests
>> which all call Gst::init()).  Also, the hello_world example works just
>> fine.  Here's some output:
> 
> Hi José.
> 
> The reason you cannot reproduce it on Linux is because the default mutex type is different.
> It is set to PTHREAD_MUTEX_NORMAL while on OpenBSD we set it to PTHREAD_MUTEX_STRICT_NP (which allows us to catch issues like this one).
> As far as I understand, self-deadlock checks are stronger with STRICT_NP than NORMAL so the issue goes unnoticed in the last case...

Hi Antoine,

NORMAL on linux should deadlock. Something else is going on here.
I'm not sure yet what it is.

On May 11, 2012, at 12:33 AM, José Alburquerque <jaalburquerque gmail com> wrote:

> On Thu, 2012-05-10 at 23:03 -0400, José Alburquerque wrote:
>> On Thu, 2012-05-10 at 17:56 -0400, Kurt Miller wrote:
>>> Using gstreamermm-0.10.10.1 with gstreamer-0.10.36 Gst::init()
>>> indirectly attempts a recursive load of the adder plugin. The
>>> recursive load deadlocks due to the use of a static mutex in
>>> gst_plugin_load_by_name(). This is reproduceable with
>>> subtitleeditor on OpenBSD HEAD/current.
>>> 
>>> Here is the stack trace showing the recursive call to
>>> gst_plugin_load_by_name():
>>> 
>>> #2  0x0009c065 in _rthread_mutex_lock (mutexp=0x7c1e6670, trywait=0, abstime=0x0) at /usr/src/lib/librthread/rthread_sync.c:127
>>> #3  0x08c68ec2 in g_mutex_lock () from /usr/local/lib/libglib-2.0.so.3200.0
>>> #4  0x02f1f3e5 in gst_plugin_load_file (filename=0x7c1f6580 "/usr/local/lib/gstreamer-0.10/libgstadder.so", error=0xcfbc0bc8)
>>>    at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:722
>>> #5  0x02f2022b in gst_plugin_load_by_name (name=0x7c3c2bf5 "adder") at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1297
>>> #6  0x02f2185d in gst_plugin_feature_load (feature=0x7c3c32e8) at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:111
>>> #7  0x0b5e3954 in gst_adder_get_type () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/adder.cc:29
>>> #8  0x0ff679e1 in plugin_init (plugin=0x7c397d48) at /usr/obj/ports/gst-plugins-base-0.10.36/gst-plugins-base-0.10.36/gst/adder/gstadder.c:1322
>>> #9  0x02f1e6ff in gst_plugin_register_func (plugin=0x7c397d48, desc=0x2ff66020, user_data=0x0)
>>>    at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:557
>>> #10 0x02f1f611 in gst_plugin_load_file (filename=0x7c1f6580 "/usr/local/lib/gstreamer-0.10/libgstadder.so", error=0xcfbc0dc8)
>>>    at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:843
>>> #11 0x02f2022b in gst_plugin_load_by_name (name=0x7c3c2bf5 "adder") at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1297
>>> #12 0x02f2185d in gst_plugin_feature_load (feature=0x7c3c32e8) at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:111
>>> #13 0x0b5e3954 in gst_adder_get_type () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/adder.cc:29
>>> #14 0x0b624d21 in Gst::wrap_init () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/wrap_init.cc:386
>>> #15 0x0b6258d0 in initialize_wrap_system () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/init.cc:36
>>> #16 0x0b625a77 in Gst::init (argc=@0xcfbc0fb4, argv=@0xcfbc0fb8)
>>>    at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/init.cc:53
>>> #17 0x1c01d13c in Glib::PropertyProxy<Glib::ustring>::get_value ()

I'm curious why frame 8 above doesn't end up going
recursive on Linux like it does for OpenBSD. When I step through
The code on OpenBSD it seems unavoidable.

Thanks,
-Kurt



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]