Mir

Rotating display to 90 and 270 degrees crashes shell

Bug #1638611 reported by Jonas G. Drange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Michał Sawicz
Mir
Invalid
High
Unassigned
qtmir (Ubuntu)
Fix Released
High
Gerry Boland
ubuntu-system-settings (Ubuntu)
Invalid
High
Jonas G. Drange
unity8 (Ubuntu)
Invalid
High
Michał Sawicz

Bug Description

Reproduce:
rotate display to mir_orientation_left

What happens:
(The following is a log from the client, in this case System Settings)
[2016-11-02 16:51:04.111664] <ERROR> Mesa/NativeSurface: Caught exception at Mir/EGL driver boundary (in advance_buffer): /build/mir-S1BioZ/mir-0.24.1+16.04.20160928/src/client/no_tls_future-inl.h(73): Throw in function T mir::client::PromiseState<T>::get_value() [with T = std::shared_ptr<mir::client::MirBuffer>]
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::runtime_error> >
std::exception::what: broken_promise

2016-11-02 16:51:04,111 - WARNING - QEGLPlatformContext: eglSwapBuffers failed: 3000

What should happen:
like with mir_orientation_inverted it should just work.

USC log: http://pastebin.ubuntu.com/23416688/
U8 log: http://pastebin.ubuntu.com/23451419/

Related branches

description: updated
summary: - Rotating some display to 90 degrees makes mir throw
+ Rotating some display to 90 and 270 degrees makes mir throw
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Rotating some display to 90 and 270 degrees makes mir throw

I'd like to get this resolved, but we'd need more information yet.

You have shown a client (System Settings) crashed at 16:51:04, but that USC was still running fine 12 minutes later at 17:03.

Which log is this line from? System Settings?
2016-11-02 16:51:04,111 - WARNING - QEGLPlatformContext: eglSwapBuffers failed: 3000

If so then you will find the client crashed because Unity8 went away. So we need to see where/why Unity8 has crashed(?)

Changed in mir:
status: New → Incomplete
Changed in canonical-devices-system-image:
importance: Undecided → High
status: New → Incomplete
Changed in mir:
importance: Undecided → High
tags: added: unity8-desktop
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also what command (or code) did you use to rotate the screen?

Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

You can likely use silo 2140 (soon) to replicate this and get to the logs you need.

Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

unity8 session on xenial+overlay is broken for me, so I can test this. Suggest someone who's able to start a unity8 session install silo 2140 and grab a unity8 log if they are able to reproduce.

Code is in silo 2140, but I basically use mir_connection_set_base_display_config.

Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

> Also what command (or code) did you use to rotate the screen?

used mir_connection_set_base_display_config

description: updated
Changed in canonical-devices-system-image:
status: Incomplete → Confirmed
Changed in mir:
status: Incomplete → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like we should have a test tool for this kind of thing... or modify 'mirout' to be able to make changes to the base display config.

Also, I recently encountered the same Mir exception. It occurred in a client when my server crashed.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Hey, sorry about the delay... I'm looking at the API now (mir_connection_set_base_display_config) and it appears that one is deprecated so you should not use it.

Unfortunately mir-team has done a poor job of documenting that it's a deprecated API. The only hint that it's being deprecated is in the docs for mir_connection_create_display_config() which you are probably using. And it's even worse that Mir's out mirout tool (out.c) still uses the old API which will eventually go away.

So you should probably only use functions which take the MirDisplayConfig type, and not the MirDisplayConfiguration type. Information about the newer API using MirDisplayConfig is in:
  /usr/include/mirclient/mir_toolkit/mir_display_configuration.h
  /usr/include/mirclient/mir_toolkit/mir_connection.h

More confusing again is that the "new" function names and file name actually matches the "old" type name better than the new API it represents.

Sorry about the bad news... I'm only looking at this new API in detail myself for the first time.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Using the new API I've built a test tool which among other things replicates what you're doing:
https://code.launchpad.net/~vanvugt/mir/mirout-basic-commands/+merge/311372

I've found that enable/disable can crash the server (bug 1643446), but rotation works fine (albeit distorted - bug 1643488).

So it sounds like just Unity8 is crashing. We'll need a stack trace from it.

Changed in mir:
status: Confirmed → Invalid
Revision history for this message
Bill Filler (bfiller) wrote :

@jgdx
When you have a chance please re-test this using the new api specified above

Changed in ubuntu-system-settings (Ubuntu):
importance: Undecided → High
assignee: nobody → Jonas G. Drange (jonas-drange)
Revision history for this message
Bill Filler (bfiller) wrote :

Tested this with latest mir 0.26 and silo 2140 https://bileto.ubuntu.com/#/ticket/2140 for ubuntu-system-settings. when I try rotating, I get the following crash from unity8

Thread 27 "QSGRenderThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fec84b6e700 (LWP 8251)]
0x00007fec94716d07 in Screen::makeCurrent() ()
   from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqpa-mirserver.so
(gdb) bt
#0 0x00007fec94716d07 in Screen::makeCurrent() ()
   from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqpa-mirserver.so
#1 0x00007fec9471d516 in MirOpenGLContext::makeCurrent(QPlatformSurface*) ()
   from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqpa-mirserver.so
#2 0x00007fec9d51b81c in QOpenGLContext::makeCurrent(QSurface*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#3 0x00007fec9e6ba69b in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#4 0x00007fec9cb447e8 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5 0x00007fec9bc176ba in start_thread (arg=0x7fec84b6e700) at pthread_create.c:333
#6 0x00007fec9c23c82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb)

Changed in ubuntu-system-settings (Ubuntu):
status: New → Invalid
Changed in qtmir (Ubuntu):
importance: Undecided → High
summary: - Rotating some display to 90 and 270 degrees makes mir throw
+ Rotating display to 90 and 270 degrees crashes shell
Changed in qtmir (Ubuntu):
status: New → Confirmed
Changed in qtmir:
importance: Undecided → High
assignee: nobody → Gerry Boland (gerboland)
Changed in qtmir (Ubuntu):
assignee: nobody → Gerry Boland (gerboland)
no longer affects: qtmir
Changed in unity8 (Ubuntu):
importance: Undecided → High
assignee: nobody → Michał Sawicz (saviq)
Revision history for this message
Bill Filler (bfiller) wrote :

@vanvugt
please see above trace and confirm problem not in mir.. thanks

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks Bill. I can't see any Mir code in that stack trace. And Gerry is indeed the best person to look at it since he recently fixed another (related?) GL context crash that looked similar.

It's worth noting that Unity8 has historically (on phablet) done its own screen rotation independently of Mir's. I'm actually not sure if Unity8 supports Mir's screen rotation settings (via display config).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh! Good news: Gerry's fix hasn't landed yet so this bug may get fixed by that very soon:

lp:~gerboland/qtmir/fix-glcontext-loss-on-reconfigure

(bug 1521403)

Changed in qtmir (Ubuntu):
status: Confirmed → In Progress
Changed in unity8 (Ubuntu):
status: New → Invalid
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
assignee: nobody → Gerry Boland (gerboland)
assignee: Gerry Boland (gerboland) → Michał Sawicz (saviq)
Changed in qtmir:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Gerry Boland (gerboland)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  [ Michał Sawicz ]
  * We're at provides 26 already (LP: #1662608)

  [ Alan Griffiths ]
  * Identify the code that depends directly on mirserver-dev headers

  [ Albert Astals Cid ]
  * Check we provide the same unity-application-impl that we require

  [ Daniel d'Andrada ]
  * Resolve mir cursor names using mir symbols instead of plain strings
    (LP: #1662827)

  [ Gerry Boland ]
  * ScreenModel: Only expose windows on displays that are turned on (LP:
    #1521403, #1638611, #1656250)
  * Restore lost LTTng tracepoints, and delete unused ones (LP:
    #1658084)

  [ Nick Dedekind ]
  * Added Extended Display Information Data (EDID) parsing.

  [ Alan Griffiths, Nick Dedekind ]
  * Iteration 0 of miral::PersistDisplayConfig. This does nothing yet
    (and breaks nothing in the process). This MP creates a place (miral-
    prototypes) to build prototype miral features and sketches out what
    will need to be implemented for PersistDisplayConfig. (LP: #1644189)

 -- Michał Sawicz <email address hidden> Wed, 15 Feb 2017 13:23:17 +0000

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

Other bug subscribers

Remote bug watches

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