Mir

[android] std::exception::what: error during hwc set() when unplugging external monitor

Bug #1498550 reported by Alberto Aguirre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Alberto Aguirre
mir (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Occasionally when unplugging an external monitor an exception is thrown during hwc set().

"
ERROR: Dynamic exception type: St13runtime_error
std::exception::what: error during hwc set(). rc = ffffffff
"

Related branches

description: updated
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

This is possibly a dup of https://bugs.launchpad.net/mir/+bug/1474891 but with mir 0.15.

The fix in lp:1474891 is not sufficient as the android platform may be already in the middle of waiting for HWC->set call with a list that includes the external display at the time the external display is unplugged. In which case, set can return -1, but before HWC sends the hotplug event so the exception is thrown.

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

The connection state of the external display can be queried through HWC getDisplayConfigs.

However, sometimes even when "set" fails, calling getDisplayConfigs still says the display is connected, so it cannot be reliably used to ignore all "set" errors.

There are three main failure cases:

set returns -1 when submitting a composition list that includes external display, getDisplayConfigs says external display is disconnected - good we can use this to infer the failure in set and not throw an exception.

set returns -1 when submitting a composition list that only includes the primary display (the last "set" called did include an external display list), no need to call getDisplayConfigs since there's no external displaylist - BAD, we cannot infer what the failure is about - though logcat seems to imply something wrong with the displays.

set returns -1 when submitting a composition list that includes external display, getDisplayConfigs says external display is connected - BAD we can't infer what the failure is about - though logcat says "display_commit: Invalid FB fd for display"

tags: added: android multimonitor
Changed in mir:
assignee: nobody → Alberto Aguirre (albaguirre)
status: New → In Progress
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

The branch linked minimizes the occurrence of this error since it only address scenario 1 above.

It may be possible to detect scenario 2 and 3 and address it by tearing down and recreating the compositor thread (similarly to what happens during hotplug on a display configuration change).

Scenario 2 is:

Submit list for both displays, unplug external display, HWC set returns -1, HWC reports display still connected (I assume this is a race in the HWC/kernel implementation). We could still throw an ExternalDisplayError.

Scenario 3:

Submit list for both displays, HWC returns 0 (i.e. success), unplug external display.
Submit list for primary display only, HWC returns -1, check if the last commit included external display, if it does, throw ExternalDisplayError

DisplayGroup could catch ExternalDisplayError and issue a display configuration change, which would tear restart the compositor thread.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

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

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
status: Fix Committed → In Progress
Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.2 KiB)

This bug was fixed in the package mir - 0.17.0+15.10.20151008.2-0ubuntu1

---------------
mir (0.17.0+15.10.20151008.2-0ubuntu1) wily; urgency=medium

  [ Alexandros Frantzis ]
  * New upstream release 0.17.0 (https://launchpad.net/mir/+milestone/0.17.0)
    - ABI summary: Only servers and graphics drivers need rebuilding;
      . Mirclient ABI unchanged at 9
      . Mirserver ABI bumped to 35
      . Mircommon ABI unchanged at 5
      . Mirplatform ABI bumped to 11
      . Mirprotobuf ABI bumped to 3
      . Mirplatformgraphics ABI bumped to 6
      . Mirclientplatform ABI unchanged at 3
    - Enhancements:
      . Introduce libmircookie, a simple mechanism for a group of cooperating
        processes to hand out and verify difficult-to-forge timestamps to
        untrusted 3rd parties.
      . More refactorings to support renderers other than GL.
      . Add MirBlob to the client API - a tool for serializing and
        deserializing data.
      . Introduce a libinput based input platform, not yet used by default.
      . Provide a mechanism for the shell to send events on surface
        construction.
      . Provide mir::shell::DisplayConfigurationController allowing shells
        to correctly change the display configuration, notifying clients
        as appropriate.
      . New DSO versioning guide.
      . Send events pertaining to the output a surface is currently on (dpi,
        form factor, scale) to clients.
    - Bug fixes:
      . [enhancement] XMir specific documentation should live in its own
        subsection (LP: #1200114)
      . Nested servers need cursor support (LP: #1289072)
      . Mir cursor is missing/invisible until the client sets it multiple
        times (LP: #1308133)
      . [regression] Fullscreen software surfaces (like Xmir -sw) can crash
        the Mir server (LP: #1493721)
      . [usc] Mir gives up and shuts down due to input with multimonitor qtmir
        (std::exception::what: Failure sending input event) (LP: #1496069)
      . Mouse cursor disappears upon entering the surface area of a nested
        client (LP: #1496849)
      . [android] input is not dispatched when attaching an external monitor
        (LP: #1498045)
      . [android] input coordinates are scaled incorrectly when an external
        display is connected (LP: #1498540)
      . [android] std::exception::what: error during hwc set() when unplugging
        external monitor (LP: #1498550)
      . tests do not compile without precompiled headers (LP: #1498829)
      . [android] std::exception::what: Failed to monitor fd: Operation not
        permitted when unplugging external display in a nested configuration
        (LP: #1499042)
      . Mir suddenly no longer builds since 'mesa (11.0.0-1ubuntu1) wily':
        /usr/include/EGL/eglplatform.h:100:35: fatal error:
        android/native_window.h: No such file or directory (LP: #1499134)
      . [android] various crashes when unplugging external display on a
        nested configuration (LP: #1501927)
      . Cursor becomes visible by itself when an external monitor is connected
        (LP: #1502200)
      . mesa FTBFS due to missing Requires in mirclient (LP: #1503450)

  [ CI Trai...

Read more...

Changed in mir (Ubuntu):
status: New → Fix Released
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.