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 777449 - parse: Deadlock when trying to link an element that takes its object lock while querying caps
parse: Deadlock when trying to link an element that takes its object lock whi...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.11.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-18 13:39 UTC by Vivia Nikolaidou
Modified: 2017-01-18 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-freezer-New-element-to-test-a-pipeline-freeze.patch (7.50 KB, patch)
2017-01-18 13:40 UTC, Vivia Nikolaidou
rejected Details | Review

Description Vivia Nikolaidou 2017-01-18 13:39:20 UTC
Created a "freezer" element (code is trivial, but still attached) that is basically an empty GstBaseTransform, except it posts a GST_ELEMENT_ERROR in transform_caps and returns empty caps. The following line freezes the pipeline:

gst-launch-1.0 audiotestsrc ! "audio/x-raw" ! freezer ! fakesink

gdb backtrace:

Thread 1 (Thread 0x7ffff7fb3700 (LWP 26359))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_mutex_lock_slowpath
    at ././glib/gthread-posix.c line 1313
  • #2 g_mutex_lock
    at ././glib/gthread-posix.c line 1337
  • #3 gst_object_get_parent
    at gstobject.c line 733
  • #4 gst_object_get_path_string
    at gstobject.c line 984
  • #5 gst_element_message_full_with_details
    at gstelement.c line 1924
  • #6 gst_element_message_full
    at gstelement.c line 1999
  • #7 gst_freezer_transform_caps
    at gstfreezer.c line 103
  • #8 gst_base_transform_transform_caps
    at gstbasetransform.c line 536
  • #9 gst_base_transform_query_caps
    at gstbasetransform.c line 757
  • #10 gst_base_transform_default_query
    at gstbasetransform.c line 1603
  • #11 gst_pad_query
    at gstpad.c line 3949
  • #12 gst_pad_query_caps
    at gstutils.c line 2905
  • #13 gst_parse_element_can_do_caps
    at ./grammar.y line 603
  • #14 gst_parse_perform_link
    at ./grammar.y line 702
  • #15 priv_gst_parse_launch
    at ./grammar.y line 1254
  • #16 gst_parse_launch_full
    at gstparse.c line 327
  • #17 gst_parse_launchv_full
    at gstparse.c line 262
  • #18 main
    at gst-launch.c line 1041

Log file:
https;//ahiru.eu/~vivia/freezer-log.xz
Comment 1 Vivia Nikolaidou 2017-01-18 13:40:45 UTC
Created attachment 343720 [details] [review]
0001-freezer-New-element-to-test-a-pipeline-freeze.patch
Comment 2 Sebastian Dröge (slomo) 2017-01-18 13:43:30 UTC
commit 80c5fd50dbb72a9cf3584ba0c2d9cd70a7cc90b2
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Jan 18 15:07:58 2017 +0200

    parse: Don't hold element's object lock while querying element pads' caps
    
    This can easily deadlock if the element uses the object lock for
    something internally, like posting an error message. Use an GstIterator
    for iterating over the pads instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777449