After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685332 - GstMeta registry race
GstMeta registry race
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.0.0
Other Linux
: Normal normal
: 1.0.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-02 20:49 UTC by Michael Smith
Modified: 2012-10-03 18:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Smith 2012-10-02 20:49:02 UTC
My test transcoding app often (~50% of the time) prints this out near startup:
  (python:8136): GLib-GObject-CRITICAL **: g_pointer_type_register_static: assertion `g_type_from_name (name) == 0' failed

I think (see stack below) this is because there's nothing preventing multiple concurrent calls to gst_meta_register from a single site, in different threads - i.e. like the GType registration, I think we need to use g_once_* stuff to prevent this.

I ran into this with the video meta, but I assume this applies to all the others. If people agree, I can prepare some patches.



With G_DEBUG=fatal_warnings, the stack looks like:

Program received signal SIGTRAP, Trace/breakpoint trap.

Thread 140737127630592 (LWP 8147)

  • #0 g_logv
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #1 g_log
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #2 g_pointer_type_register_static
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #3 gst_meta_register
    from /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
  • #4 gst_video_meta_get_info
    from /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
  • #5 gst_buffer_add_video_meta_full
    from /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
  • #6 ??
    from /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
  • #7 ??
    from /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
  • #8 ??
    from /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
  • #9 gst_buffer_pool_acquire_buffer
    from /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
  • #10 ??
    from /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0
  • #11 ??
    from /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0
  • #12 ??
    from /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0#13
  • #14 ??
    from /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so
  • #15 ??
    from /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0#16
  • #17 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #18 start_thread
    from /lib/x86_64-linux-gnu/libpthread.so.0
  • #19 clone
    from /lib/x86_64-linux-gnu/libc.so.6
  • #20 ??

Comment 1 Wim Taymans 2012-10-03 11:47:28 UTC
g_once is the way to go, I patched up the docs and the onces
in core, if you make some patches for the other, that would be great.

commit ed19974e25a6bf318a3ef2c3c86afe2369f56def
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Wed Oct 3 13:45:22 2012 +0200

    meta: do metadata registration threadsafe
    
    We need to use g_once to register the metadata implementations
    only once.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=685332