Unity8 deadlock when trying to screenshot without a current gst registry

Bug #1525285 reported by errors.ubuntu.com bug bridge
66
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Michał Sawicz
Clutter GStreamer Bindings
Fix Released
Medium
clutter-gst-3.0 (Ubuntu)
Confirmed
High
Unassigned
Nominated for Xenial by Alberto Salvia Novella
Nominated for Zesty by Michał Sawicz
qtmir (Ubuntu)
Fix Released
High
Albert Astals Cid
Nominated for Xenial by Alberto Salvia Novella
Nominated for Zesty by Michał Sawicz

Bug Description

The Ubuntu Error Tracker has been receiving reports about a problem regarding unity8. This problem was most recently seen with version 8.11+16.04.20151126-0ubuntu2, the problem page at https://errors.ubuntu.com/problem/811233d22c3b1dcb08f9f596e5dbf9d0e23e4220 contains more details.

Inspecting gst-clutter causes it to try and connect to the display server. When it's unity8 that triggered the registry update, registry generation blocks while gst-clutter tries to connect back to unity8. That results in a deadlock, because we're unable to answer the authorization challenge because we're blocked by the registry generation.

This is a bug in either gst-clutter or libclutter (filed upstream), but we should try and make sure that we don't block on this either.

To reproduce:
- log in to unity8
- rm ~/.cache/gstreamer-1.0/registry.x86_64.bin
- press PrtScr to get a screenshot
- deadlock

To recover:
- run gst-inspect-1.0 somewhere

Related branches

Michał Sawicz (saviq)
affects: unity8 (Ubuntu) → qtmultimedia-opensource-src (Ubuntu)
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtmultimedia-opensource-src (Ubuntu):
status: New → Confirmed
Michał Sawicz (saviq)
description: updated
Changed in canonical-devices-system-image:
assignee: nobody → John McAleely (john.mcaleely)
milestone: none → backlog
status: New → Confirmed
Revision history for this message
Michał Sawicz (saviq) wrote :

Just managed to find that the culprit is actually the clutter plugin (gstreamer1.0-clutter-3.0), uninstalling that (sudo dpkg -r --force-depends gstreamer1.0-clutter-3.0) makes the session start again.

Michał Sawicz (saviq)
no longer affects: qtmultimedia-opensource-src (Ubuntu)
summary: - /usr/bin/unity8:6:__GI_ppoll:ppoll:gst_poll_wait:exchange_packets:plugin_loader_free
+ inspecting clutter plugin hangs outside X11
Michał Sawicz (saviq)
description: updated
description: updated
Revision history for this message
Michał Sawicz (saviq) wrote : Re: inspecting clutter plugin hangs outside X11

There are suspect code blocks like the following:

#if defined (CLUTTER_WINDOWING_X11)
  /* Required by some GStreamer element like VA */
  XInitThreads ();
#endif

But that doesn't seem to be the problem, even if looks really shady (AFAICT basically means that if clutter was built with x11 support, it will call XInitThreads(), even if you're not actually running under X11).

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in clutter-gst-3.0 (Ubuntu):
status: New → Confirmed
Changed in clutter-gst-3.0 (Ubuntu):
importance: Undecided → High
Changed in clutter-gst-3.0 (Ubuntu):
assignee: nobody → John McAleely (john.mcaleely)
status: Confirmed → Triaged
Changed in clutter-gst-3.0 (Ubuntu):
assignee: John McAleely (john.mcaleely) → nobody
Revision history for this message
Iain Lane (laney) wrote :

Will just pointed me to this. Any chance that someone could forward this bug to upstream, or link the bug if it's already been done?

Changed in canonical-devices-system-image:
assignee: John McAleely (john.mcaleely) → nobody
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
milestone: backlog → u8c-1
status: Confirmed → Triaged
importance: Undecided → High
Changed in canonical-devices-system-image:
assignee: nobody → Michał Sawicz (saviq)
Revision history for this message
Albert Astals Cid (aacid) wrote :

> Will just pointed me to this. Any chance that someone could forward this bug to upstream, or link the bug if it's already been done?

Posted at https://bugzilla.gnome.org/show_bug.cgi?id=780193

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looking at the backtrace i get nowadays http://paste.ubuntu.com/24195519/

Is this even still a bug? I can only reproduce it if i am on a VT and run the commands, then it gets stuck but if i loggin into a clean unity8 session having cleaned the file, it's all fine.

I'm confused now :S

Revision history for this message
Michał Sawicz (saviq) wrote :

There was a change in when we trigger the registry (as in we don't on startup), but I've been getting the same hangs when trying to take a screenshot in unity8 (which triggers a sound).

Revision history for this message
Michał Sawicz (saviq) wrote :

Starting unity8 without the registry present and taking a screenshot results in: http://paste.ubuntu.com/24214544/

Revision history for this message
Michał Sawicz (saviq) wrote :

And gst-plugin-scanner hangs with: http://pastebin.ubuntu.com/24214612/

Michał Sawicz (saviq)
summary: - inspecting clutter plugin hangs outside X11
+ Unity8 deadlock when trying to screenshot without a current gst registry
description: updated
Changed in clutter-gst-3.0 (Ubuntu):
status: Triaged → New
importance: High → Undecided
Changed in qtmir (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Gerry Boland (gerboland)
Michał Sawicz (saviq)
description: updated
Changed in canonical-devices-system-image:
milestone: u8c-1 → u8c-2
milestone: u8c-2 → u8c-z
Revision history for this message
Gerry Boland (gerboland) wrote :

Would be good if QtMir didn't authenticate processes on the GUI thread, but on the relevant Mir thread. This should be possible.

Changed in clutter-gst:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in clutter-gst-3.0 (Ubuntu):
status: New → Confirmed
tags: added: unity8-desktop
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: Triaged → In Progress
Changed in qtmir (Ubuntu):
status: Triaged → In Progress
assignee: Gerry Boland (gerboland) → Albert Astals Cid (aacid)
Changed in clutter-gst-3.0 (Ubuntu):
importance: Undecided → High
Changed in clutter-gst:
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtmir - 0.5.1+17.04.20170328-0ubuntu1

---------------
qtmir (0.5.1+17.04.20170328-0ubuntu1) zesty; urgency=medium

  [ Alan Griffiths ]
  * MirAL will be correcting another spelling error shortly. Avoid an
    FTBFS when that happens.
  * Compatibility with lp:mir and lp:~alan-griffiths/miral/1.3

  [ Albert Astals Cid ]
  * Remove empty property and move invokable
  * Run ApplicationManager::authorizeSession in the calling thread (LP:
    #1525285)

  [ Andreas Pokorny ]
  * Report and consume exception that may occur on constructing a keymap
    (LP: #1557634)

  [ Daniel d'Andrada ]
  * Ensure the window that got a key down also gets the corresponding
    key up (LP: #1671072)

  [ Gerry Boland ]
  * Don't let a child window go offscreen because its parent moved
  * Add env var equivalent to desktop_file_hint

  [ Lukáš Tinkl ]
  * Raise (activate) windows when an app focus is requested (LP:
    #1672337)

 -- Michał Sawicz <email address hidden> Tue, 28 Mar 2017 17:14:50 +0000

Changed in qtmir (Ubuntu):
status: In Progress → Fix Released
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.