Mir

Setting a surface keymap crashes in xkbcommon: xkb_keymap_new_from_names()

Bug #1530946 reported by Lukáš Tinkl
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Pocket Desktop
Triaged
High
Stephen M. Webb
Canonical System Image
Fix Committed
High
Stephen M. Webb
Mir
Fix Released
High
Andreas Pokorny
The Avila project
Fix Committed
High
Unassigned
mir (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Trying to set a keymap on a Mir surface crashes somewhere between Mir and xkbcommon with this backtrace:

http://paste.ubuntu.com/14399228/

Code from: https://code.launchpad.net/~lukas-kde/qtmir/kbdLayout and https://code.launchpad.net/~lukas-kde/unity8/kbdLayout

The xkb_names structure (four char*) is sent over the wire as four addresses. Our tests do not fail because they use the in process client..

Related branches

summary: - Setting a surface keymap crashes in xkbcommon
+ Setting a surface keymap crashes in xkbcommon:
+ xkb_keymap_new_from_names()
Changed in mir:
importance: Undecided → High
Changed in mir:
status: New → Invalid
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Have you tried using empty strings instead of null for unused fields?

Changed in mir:
status: Invalid → Confirmed
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Yup, similar crash

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

so I hacked TestClientInput.clients_receive_keymap_change_events (tests/acceptance_tests/test_client_input.cpp) to do:

 xkb_rule_names names;
  names.rules = nullptr;
  names.model = nullptr;
  names.layout = "us";
  names.variant = nullptr;
  names.options = nullptr;

EXPECT_CALL(first_client, handle_keymap(_))
        .Times(1)
        .WillOnce(mt::WakeUp(&first_client.all_events_received));

server.the_shell()->focused_surface()->set_keymap(names);
first_client.all_events_received.wait_for_at_most_seconds(2);

No crash.

Can you examine xkb_rule_names and list the contents?

Changed in mir:
status: Confirmed → Incomplete
assignee: nobody → Alberto Aguirre (albaguirre)
Changed in mir:
assignee: Alberto Aguirre (albaguirre) → Andreas Pokorny (andreas-pokorny)
status: Incomplete → Confirmed
description: updated
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
assignee: nobody → Stephen M. Webb (bregma)
milestone: none → ww04-2016
importance: Undecided → Critical
status: New → Triaged
Changed in canonical-pocket-desktop:
status: New → Triaged
importance: Undecided → High
Changed in canonical-devices-system-image:
importance: Critical → High
Changed in canonical-pocket-desktop:
assignee: nobody → Stephen M. Webb (bregma)
Changed in mir:
milestone: none → 0.19.0
Changed in mir:
status: Confirmed → In Progress
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision 3266, scheduled for release in mir, milestone 0.20.0

Changed in mir:
status: In Progress → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

mir (0.19.0+16.04.20160128-0ubuntu1) xenial; urgency=medium

Changed in mir:
status: Fix Committed → Fix Released
Changed in mir (Ubuntu):
status: New → Fix Released
Changed in canonical-devices-system-image:
status: Triaged → Fix Committed
Changed in avila:
status: New → Fix Committed
milestone: none → ww04-2016
importance: Undecided → High
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.