Unity8 crashes and restarts when clicking on a menu [terminate called after throwing an instance of 'std::out_of_range' what(): map::at]

Bug #1656727 reported by Daniel van Vugt
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Unassigned
Mir
Invalid
Critical
Unassigned
MirAL
Invalid
Critical
Unassigned
miral (Ubuntu)
Invalid
Critical
Unassigned
qtmir (Ubuntu)
Fix Released
Critical
Daniel d'Andrada
unity8 (Ubuntu)
Fix Released
Critical
Daniel d'Andrada

Bug Description

Unity8 crashes and restarts when clicking on a menu:

terminate called after throwing an instance of 'std::out_of_range'
  what(): map::at

Test case:
  1. Launch AisleRiot
  2. Click on a menu

Expected: Menu opens
Observed: Unity8 crashes and restarts every time

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: unity8 8.15+17.04.20170110.4-0ubuntu1
ProcVersionSignature: Ubuntu 4.9.0-11.12-generic 4.9.0
Uname: Linux 4.9.0-11-generic x86_64
ApportVersion: 2.20.4-0ubuntu1
Architecture: amd64
Date: Mon Jan 16 10:29:08 2017
InstallationDate: Installed on 2016-11-03 (74 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Alpha amd64 (20161102)
SourcePackage: unity8
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in unity8 (Ubuntu):
importance: Undecided → Critical
Changed in mir:
importance: Undecided → Critical
Changed in canonical-devices-system-image:
importance: Undecided → Critical
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Might be related to bug 1497128?

Changed in miral:
importance: Undecided → Critical
tags: added: unity8-desktop
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity8 (Ubuntu):
status: New → Confirmed
summary: - Unity8 crashes and restarts when opening a menu [terminate called after
- throwing an instance of 'std::out_of_range' what(): map::at]
+ Unity8 crashes and restarts when clicking on a menu [terminate called
+ after throwing an instance of 'std::out_of_range' what(): map::at]
description: updated
Changed in miral (Ubuntu):
importance: Undecided → Critical
Changed in canonical-devices-system-image:
status: New → Confirmed
Changed in mir:
status: New → Confirmed
Changed in miral:
status: New → Confirmed
Changed in miral (Ubuntu):
status: New → Confirmed
Revision history for this message
Michał Sawicz (saviq) wrote :

The tracetop suggests this might be dupe of bug #1643976 - although not sure where we'd be instantiating a WebView in this case...

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I'm not sure exactly what is happening, but I suspect is needs something like the following in some other method. (from lp:qtmir src/platforms/mirserver/windowmanagementpolicy.cpp):

void WindowManagementPolicy::resize(const miral::Window &window, const Size size)
{
    miral::WindowSpecification modifications;
    modifications.size() = size;
    m_tools.invoke_under_lock([&window, &modifications, this]() {
        try {
            m_tools.modify_window(m_tools.info_for(window), modifications);
        } catch (const std::out_of_range&) {
            // usually shell trying to operate on a window which already closed, just ignore
            // TODO: MirSurface extends the miral::Window lifetime by holding a shared pointer to
            // the mir::scene::Surface, meaning it cannot detect when the window has been closed
            // and thus avoid calling this method.
        }
    });
}

Changed in qtmir:
importance: Undecided → Critical
status: New → Confirmed
Changed in miral:
status: Confirmed → Incomplete
Changed in mir:
status: Confirmed → Incomplete
Changed in miral (Ubuntu):
status: Confirmed → Incomplete
Changed in unity8 (Ubuntu):
assignee: nobody → Daniel d'Andrada (dandrader)
Changed in miral (Ubuntu):
status: Incomplete → Invalid
Changed in qtmir:
assignee: nobody → Daniel d'Andrada (dandrader)
Changed in miral:
status: Incomplete → Invalid
Changed in mir:
status: Incomplete → Invalid
Changed in unity8 (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.15+17.04.20170206-0ubuntu1

---------------
unity8 (8.15+17.04.20170206-0ubuntu1) zesty; urgency=medium

  [ Daniel d'Andrada ]
  * Initial support for child windows (menus, dialogs, tooltips) (LP:
    #1543467, #1591384, #1656727)

 -- Albert Astals Cid <email address hidden> Mon, 06 Feb 2017 09:12:23 +0000

Changed in unity8 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
kevin gunn (kgunn72) wrote :

i'm pretty sure this is fixed, i basically tested this scenario last week with no issues.

Changed in qtmir:
status: Confirmed → Fix Released
Changed in canonical-devices-system-image:
status: Confirmed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's not fixed - I recently reproduced it using mir-demos alone.

This is an old bug, we've been hitting occasionally for a couple of years.

Changed in canonical-devices-system-image:
status: Fix Released → Confirmed
Changed in qtmir:
status: Fix Released → Confirmed
Changed in unity8 (Ubuntu):
status: Fix Released → Confirmed
Changed in canonical-devices-system-image:
status: Confirmed → Fix Released
Changed in qtmir:
status: Confirmed → Fix Released
Changed in unity8 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sorry, both statements are true.

Aisleriot may well be fixed but the underlying Mir server crash remains. I logged that more recently as bug 1668466 that should stay open.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

No, the exception was thrown by libmiral code [miral::BasicWindowManager::info_for()] and caused by synchronisation issues in QtMir code that have been worked around.

Neither the libmiral nor the QtMir code in question is involved in any of the mir-demos.

Michał Sawicz (saviq)
affects: qtmir → qtmir (Ubuntu)
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.