Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gstreamer-rs gstreamer-rs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 38
    • Issues 38
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • gstreamer-rsgstreamer-rs
  • Issues
  • #196
Closed
Open
Issue created Apr 25, 2019 by Sebastian Dröge@slomo🍵Owner

examples/glupload: Segfault on close with Wayland backend

CC @vjaquez @ystreet @nielsdg

Code in question can be found here: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/blob/bf96e264c933acadbd00e846f4184e7b9ec9b309/examples/src/bin/glupload.rs

Segfault happens in the finalize function of GstGLDisplayWayland in

  g_clear_pointer (&display_wayland->shell, wl_shell_destroy);

Leaking the display from the example code works around this:

diff --git a/examples/src/bin/glupload.rs b/examples/src/bin/glupload.rs
index 4c5deb4..462ee8e 100644
--- a/examples/src/bin/glupload.rs
+++ b/examples/src/bin/glupload.rs
@@ -418,6 +418,8 @@ impl App {
             let gl_context = shared_context.clone();
             let events_proxy = events_loop.create_proxy();
 
+            std::mem::forget(gl_display.clone());
+
             #[allow(clippy::single_match)]
             bus.set_sync_handler(move |_, msg| {
                 match msg.view() {

My guess is that the problem here is that glutin is disconnecting the wayland display before the last reference to the GstGLDisplayWayland is released. We then destroy those interfaces without the underlying display still being there and that simply crashes.

Or maybe we're not supposed to keep/destroy these interfaces if it is a foreign display?

How do lifetimes work in Wayland for these things? :)

Edited Apr 25, 2019 by Sebastian Dröge
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking