Using NBS, X apps under Unity8 need interaction to start in pocket-desktop

Bug #1584784 reported by Kevin DuBois on 2016-05-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Kevin DuBois
Fix Released
Kevin DuBois
mir (Ubuntu)
qtmir (Ubuntu)
xorg-server (Ubuntu)
Daniel van Vugt

Bug Description

With Mir 0.23.0, X apps under Unity8 need some interaction to get the applications to start. 0.23.0 is blocked pending fix.

Related branches

Kevin DuBois (kdub) on 2016-05-23
tags: added: frieza nbs xmir
Changed in mir:
status: New → Incomplete
status: Incomplete → In Progress
Changed in xorg-server (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Kevin DuBois (kdub) wrote :

I think it might be something going on with the focus causing the window not to be realized (perhaps). I've checked that the buffers aren't getting 'stuck'

Kevin DuBois (kdub) wrote :

Well, for some reason, this appears to be where the (gedit) window gets realized in our existing release:

Atom _NET_WM_NAME = 267
Realize window 0xabaa7a98 "": 985x1093 +0+0 parent=0xab8dadc8
 depth=24 redir=0 type=0 class=1 visibility=3 viewable=1
Atom UTF8_STRING = 268
Realize window 0xabaadca0 "gedit": 985x1093 +0+0 parent=0xabaa7a98
 depth=24 redir=0 type=0 class=1 visibility=3 viewable=1
 override=0 _NET_WM_WINDOW_TYPE=254 WM_TRANSIENT_FOR=(nil)
Realize window 0xabaadfa0 "": 1x1 -1-1 parent=0xabaadca0
 depth=0 redir=0 type=2 class=2 visibility=3 viewable=0

which doesn't happen in the 0.23 silo. The server will continue to schedule redraws, and resizing the window seems to cause it to realize.

What events lead up to a window being realized on startup?

Kevin DuBois (kdub) wrote :

also, havent been able to reproduce the behavior with the demo servers, just qtmir+Xmir on pocket desktop (where its easy to reproduce)

Chris Halse Rogers (raof) wrote :

What? The window *should* be realised on first map, which should happen basically immediately (and is driven by the X11 client, not Mir).

Changed in xorg-server (Ubuntu):
status: New → Invalid
Daniel van Vugt (vanvugt) wrote :

I can't seem to reproduce any such issue with Mir demo servers or Xmir. Old clients including Xmir work just fine when run against Mir 0.23 and lp:mir for me.

Admittedly I haven't tested the critical combination of Mir 0.23 + Unity8.

I expect you have too many variables though. When you upgraded to Mir 0.23.0 you probably also upgraded Unity8, QtMir etc. There's no telling which project contains the bug...

Just a thought... Xmir makes heavy use of callbacks to schedule frames since Xorg is essentially single-threaded. Make sure buffer swapping callbacks via the client API still work correctly in 0.23.0 with NBS.

summary: - 0.23 xapps need interaction to start in pocket-desktop
+ With Mir 0.23.0, X apps need interaction to start in pocket-desktop
description: updated
summary: - With Mir 0.23.0, X apps need interaction to start in pocket-desktop
+ With Mir 0.23.0, X apps under Unity8 need interaction to start in
+ pocket-desktop
Kevin DuBois (kdub) wrote :

Its also interesting that this only happens in pocket desktop mode. The applications start up successfully when in phone-mode.

Kevin DuBois (kdub) wrote :

Its very difficult to get backtraces for X apps when running in pocket desktop (had to rewrite puritine scripts to break out of confinement), but got a bt from Xeyes when the problem is occurring; bt is attached.

Kevin DuBois (kdub) wrote :

seems matchbox is getting jammed trying to connect to the server too... I'm guessing this is why the map/realize isn't happing.

Daniel van Vugt (vanvugt) wrote :

Indeed, I was thinking the same thing. If your Xmir debug log shows no realization then the server is hung on something earlier than that (like connecting to Mir maybe). Remember Xmir is heavily dependent on client API callbacks for non-blocking-single-threaded behaviour.

Got a stack trace of Xmir itself while not yet drawing anything?

Kevin DuBois (kdub) wrote :

I didn't include an Xmir stack trace yesterday because it didn't appear stuck, it was submitting buffers (black frames) repeatedly.

I compiled Xmir and added some logs. I caught swap_buffers blocking up in Xmir (in the pocket desktop scenario only, seems to be a racy, perhaps on how big the frame size is) but it seems the block triggers the scenario.

And from poking around Xmir when the problem occurs, it seems like the "BlockHandler" is only called once, and the system stuck submitting frames repeatedly, instead of servicing the WM+Xapp connection requests.

And furthermore, I think that the system only got in this case with libertine+UAL+unity8+pocketdesktop because when UAL's involved, Xmir+WM+Xapp get launched in very close sucession, whereas with the desktop test plan, they're manually launched, so they start "far" apart.

Kevin DuBois (kdub) on 2016-05-27
Changed in qtmir:
status: New → Invalid
Kevin DuBois (kdub) wrote :

fix is wip, still testing... hope to get it out the door Tuesday (Monday is US holiday)

summary: - With Mir 0.23.0, X apps under Unity8 need interaction to start in
- pocket-desktop
+ Using NBS, X apps under Unity8 need interaction to start in pocket-
+ desktop
kevin gunn (kgunn72) on 2016-06-01
Changed in mir (Ubuntu):
status: New → In Progress
Mir CI Bot (mir-ci-bot) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.24.0

Changed in mir:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mir - 0.23.0+16.10.20160602.1-0ubuntu1

mir (0.23.0+16.10.20160602.1-0ubuntu1) yakkety; urgency=medium

  [ Kevin DuBois ]
  * New upstream release 0.23.0 (https://launchpad.net/mir/+milestone/0.23.0)
    - ABI summary:
      . mirclient ABI unchanged at 9
      . mirserver ABI bumped to 40
      . mircommon ABI bumped at 6
      . mirplatform ABI unchanged at 11
      . mirprotobuf ABI unchanged at 3
      . mirplatformgraphics ABI unchanged at 9
      . mirclientplatform ABI unchanged at 5
      . mirinputplatform ABI unchanged at 5
    - Enhancements:
      . Enable internal usage of more flexible graphics buffer submission,
        precursing client API additions.
    - Bug fixes:
      . Potential NBS performance loss after resize (LP: #1579076)
      . Performance loss with NBS and overlays on (LP: #1578159)
      . Mir crashes with useless backtrace when mg::Platform methods throw
        (LP: #1553549)
      . Virtual output is not removed when screencast client disappears
        (LP: #1573572)
      . Can't VT switch from mir_demo_server (any more) (LP: #1576260)
      . mir_demo_server(_minimal): Window movement/resizing stops responding
        when the cursor leaves the surface, and can lead to windows 1px wide
        and unrecoverable. (LP: #1447886)
      . Virtual display output configuration is set to LVDS (LP: #1573782)
      . Mir-on-X11 doesn't pass Alt+primary button drag to Mir (LP: #1575765)
      . Mir-on-X11 breaks mir_proving_server resize logic (LP: #1575192)
      . Resizing can crash mir_demo_server (LP: #1575211)
      . [regression] Cursor stops at phantom edge on M10 and N7 (LP: #1580774)
      . [regression] MIR_CLIENT_PERF_REPORT is showing bogus render times and
        buffer lag (LP: #1581368)
      . Test failures in ClientLogging.reports_performance due to the above
        fix. (LP: #1583970, LP: #1584603, LP: #1584605)
      . Do not throw when creating some objects under HWC 1.5 (LP: #1583086)
      . Correct black frame issue under Xmir (LP: #1584784)

  [ Tarmac, Kevin DuBois <email address hidden>, Daniel van Vugt <email address hidden>, Andreas Pokorny <email address hidden>, Alberto Aguirre ]
  * 0.23.0 Mir release

 -- Kevin DuBois <email address hidden> Thu, 02 Jun 2016 13:18:03 +0000

Changed in mir (Ubuntu):
status: In Progress → Fix Released
no longer affects: mir/0.24
Changed in mir:
status: Fix Committed → Fix Released
Michał Sawicz (saviq) on 2017-03-13
Changed in qtmir (Ubuntu):
status: New → Invalid
no longer affects: qtmir
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers