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 756567 - Wayland crash when called from gstreamer
Wayland crash when called from gstreamer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.5
Other Linux
: Normal major
: 1.6.1
Assigned To: George Kiagiadakis
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-14 12:37 UTC by Catalin
Modified: 2015-10-28 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Traces when works (21.29 KB, text/plain)
2015-10-14 12:37 UTC, Catalin
Details
Demo app that replicates crash (2.01 KB, text/x-csrc)
2015-10-22 07:14 UTC, Cristian Chiriac
Details
Demo app bt (10.62 KB, text/plain)
2015-10-22 07:15 UTC, Cristian Chiriac
Details

Description Catalin 2015-10-14 12:37:29 UTC
Created attachment 313259 [details]
Traces when works

Hi,
I need some help on debugging the following crash. This is happening during playing a video(reusing the pipeline). Interesting that, the crash in happening when opening the second video(first is played without issues).

Attached to this bug are the traces at working time and bellow are the traces when crash is happened.

Thank you,
Catalin

Catchpoint 1 (signal SIGSEGV), get_next_argument (signature=0x1 <error: Cannot access memory at address 0x1>, details=details@entry=0x7ef0ba38) at src/connection.c:413
413	in src/connection.c
(gdb) 
(gdb) bt full
  • #0 get_next_argument
    at src/connection.c line 413
  • #1 wl_argument_from_va_list
    at src/connection.c line 476
  • #2 wl_proxy_marshal_constructor
    at src/wayland-client.c line 625
  • #3 wl_display_get_registry
    at /home/uidj9537/DevKits/10.06.rayl-std-10-07/tmp/staging/armv7a-mv-linux/usr/include/wayland-client-protocol.h line 189
  • #4 gst_wl_display_new_existing
    at wldisplay.c line 226
  • #5 gst_wayland_sink_set_display_from_context
    at gstwaylandsink.c line 245
  • #6 gst_wayland_sink_set_context
    at gstwaylandsink.c line 400
  • #7 gst_element_set_context
    at gstelement.c line 3048
  • #8 activate_sink_bus_handler
    at gstplaybin2.c line 4224
  • #9 gst_bus_post
    at gstbus.c line 324
  • #10 gst_element_post_message_default
    at gstelement.c line 1688
  • #11 gst_element_post_message
    at gstelement.c line 1728
  • #12 gst_wayland_sink_find_display
    at gstwaylandsink.c line 281
  • #13 gst_wayland_sink_change_state
    at gstwaylandsink.c line 322
  • #14 gst_element_change_state
    at gstelement.c line 2602
  • #15 gst_element_set_state_func
    at gstelement.c line 2558
  • #16 gst_element_set_state
    at gstelement.c line 2459
  • #17 activate_sink
    at gstplaybin2.c line 4278
  • #18 activate_group
    at gstplaybin2.c line 5028
  • #19 setup_next_source
    at gstplaybin2.c line 5414
  • #20 gst_play_bin_change_state
    at gstplaybin2.c line 5502
  • #21 gst_element_change_state
    at gstelement.c line 2602
  • #22 gst_element_continue_state
    at gstelement.c line 2312
  • #23 gst_element_change_state
    at gstelement.c line 2639
  • #24 gst_element_set_state_func
    at gstelement.c line 2558
  • #25 gst_element_set_state
    at gstelement.c line 2459
  • #26 set_gst_player_state
    at src/libme_gst.c line 220
  • #27 libmeSetPlaybackState
    at src/libme_gst.c line 1899
  • #28 play_control
    at pb_engine/media_player_gst.c line 342
  • #29 media_playback_object_play_track
    at media_player_dbus.c line 1170
  • #30 dbus_glib_marshal_media_playback_object_BOOLEAN__INT_BOXED_INT_BOOLEAN_POINTER
    at ./inc/plugin-playback-dbus-server.h line 100
  • #31 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #32 ??
    from /usr/lib/libdbus-1.so.3
  • #33 dbus_connection_dispatch
    from /usr/lib/libdbus-1.so.3
  • #34 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #35 g_main_dispatch
    at gmain.c line 3122
  • #36 g_main_context_dispatch
    at gmain.c line 3737
  • #37 g_main_context_iterate
    at gmain.c line 3808
  • #38 g_main_loop_run
    at gmain.c line 4002
  • #39 main
    at media_player_main.c line 854

Comment 1 Catalin 2015-10-15 09:40:01 UTC
I'm using GStreamer 1.4.5 version.
Comment 2 Daniel Stone 2015-10-15 10:53:06 UTC
George, the display ownership stuff got fixed since, right?
Comment 3 George Kiagiadakis 2015-10-19 11:07:07 UTC
This doesn't look like a waylandsink bug. The crash happens at the point where waylandsink requests the display handle (wl_display) from the application. Then, because it's the second time the file is being played, playbin gives the display handle context that it had cached from the first time (playbin caches all GstContext) to waylandsink and waylandsink crashes in wl_display_get_registry(), so I would assume that the wl_display pointer is invalid. This can only happen if the application disconnects from the display and re-connects while playbin is in the NULL state, I suppose... Do you do anything like that in your application?
Comment 4 Catalin 2015-10-20 13:14:26 UTC
Hi George,
I'm a greenhorn in using gstramer. All we tried to do was to reuse a pipeline for a different media(video) file(same thing tried and worked in case of mp3 files). Right now we workaround this by using a new pipeline(but I'm not sure that is best practice). Same thing was tested(reusing the pipeline) on desktop AMD64 machine(ubuntu 14) and worked.
Comment 5 Nicolas Dufresne (ndufresne) 2015-10-20 14:01:46 UTC
Would it be possible to provide a simplified C program that reproduce this issue. This way we can test if we can reproduce this crash and also check if it was fixed in newer version (allowing to identify potential patches that may help). We also need to make sure this is a bug on GStreamer side rather then on libwayland side.
Comment 6 Cristian Chiriac 2015-10-22 07:14:12 UTC
Created attachment 313838 [details]
Demo app that replicates crash
Comment 7 Cristian Chiriac 2015-10-22 07:15:52 UTC
Created attachment 313839 [details]
Demo app bt
Comment 8 Cristian Chiriac 2015-10-22 07:17:07 UTC
Hello guys,
I'm Catalin's colleague. I attached the code of a small test app that is supposed to play two movies and replicates the crash. I also added the bt and it is pretty similar to the one we got in our player. Hope this helps.
Comment 9 Tim-Philipp Müller 2015-10-22 08:06:33 UTC
Thanks Cristian.
Comment 10 George Kiagiadakis 2015-10-26 13:49:01 UTC
Thanks, I can reproduce it in gst master with your demo. I'm on it...
Comment 11 George Kiagiadakis 2015-10-26 15:12:57 UTC
commit c2f34b981427f2698ce47195627a40894b640962
Author: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date:   Mon Oct 26 15:30:08 2015 +0100

    waylandsink: don't advertise the local wl_display context

    This wl_display proxy is temporary only until waylandsink goes NULL,
    at which point the connection to the display is disposed. Unfortunately,
    if this is advertised as a GstContext, playbin will cache it and re-feed
    it to the sink when it goes PLAYING again, but the wl_display pointer
    will at that point be invalid and cause a crash.

    Another solution to the problem would be to also cache the GstWlDisplay
    object inside the GstContext, which would automatically ref-count
    the display connection, but I see no reason in doing that at the moment,
    as there are no known users of this GstContext outside waylandsink.
    It's probably better to avoid chasing hidden refcounts.

    https://bugzilla.gnome.org/show_bug.cgi?id=756567
Comment 12 George Kiagiadakis 2015-10-26 15:18:55 UTC
Backported also to 1.6.x:

commit 450bac6ce59a72ce45cda6bc128fef56dada419a
Author: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date:   Mon Oct 26 15:30:08 2015 +0100

    waylandsink: don't advertise the local wl_display context

    This wl_display proxy is temporary only until waylandsink goes NULL,
    at which point the connection to the display is disposed. Unfortunately,
    if this is advertised as a GstContext, playbin will cache it and re-feed
    it to the sink when it goes PLAYING again, but the wl_display pointer
    will at that point be invalid and cause a crash.

    Another solution to the problem would be to also cache the GstWlDisplay
    object inside the GstContext, which would automatically ref-count
    the display connection, but I see no reason in doing that at the moment,
    as there are no known users of this GstContext outside waylandsink.
    It's probably better to avoid chasing hidden refcounts.

    https://bugzilla.gnome.org/show_bug.cgi?id=756567
Comment 13 Catalin 2015-10-28 12:03:42 UTC
We tested the patch and worked well

Thank you !!!