SDL apps fail to start, and then Xmir crashes on client exit

Bug #1602561 reported by dinamic on 2016-07-13
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libsdl2 (Ubuntu)
Nominated for Xenial by Christopher Townsend
supertux (Ubuntu)
Nominated for Xenial by Christopher Townsend
xorg-server (Ubuntu)
Daniel van Vugt
Nominated for Xenial by Christopher Townsend

Bug Description


A crash in Xmir can be observed sometimes when starting particular X applications.

[Test Case]

1. Create a Libertine container and install supertux.
2. Try to run supertux.

Obverse there is no longer a crash in Xmir in /var/crash.

[Regression Potential]

None observed.

Original Description:

supertux doesn't start

dinamic (dinamic6661) wrote :
dinamic (dinamic6661) wrote :

Libertine Dbus session bridge socket is not ready. Waiting...
mbpixbuf: unable to use XShm. DISPLAY remote?
wm_set_cursor_visibility: visible using XCreateFontCursor
[FATAL] /build/supertux-7_Bg7b/supertux-0.4.0/src/supertux/main.cpp:444 Unexpected exception: Couldn't initialize SDL: No available displays
(EE) Backtrace:
(EE) 0: Xmir (xorg_backtrace+0x4e) [0x562a70de937e]
(EE) 1: Xmir (0x562a70c48000+0x1a5709) [0x562a70ded709]
(EE) 2: /lib/x86_64-linux-gnu/ (0x7f1af9726000+0x113e0) [0x7f1af97373e0]
(EE) 3: Xmir (0x562a70c48000+0x171fc9) [0x562a70db9fc9]
(EE) 4: Xmir (0x562a70c48000+0x177bfc) [0x562a70dbfbfc]
(EE) 5: Xmir (0x562a70c48000+0x3df10) [0x562a70c85f10]
(EE) 6: Xmir (0x562a70c48000+0x3f6a0) [0x562a70c876a0]
(EE) 7: Xmir (0x562a70c48000+0x3a850) [0x562a70c82850]
(EE) 8: Xmir (0x562a70c48000+0x3ade1) [0x562a70c82de1]
(EE) 9: Xmir (0x562a70c48000+0x158487) [0x562a70da0487]
(EE) 10: Xmir (0x562a70c48000+0x10ee7c) [0x562a70d56e7c]
(EE) 11: Xmir (0x562a70c48000+0x1970ea) [0x562a70ddf0ea]
(EE) 12: Xmir (DeleteWindow+0x2a8) [0x562a70de2598]
(EE) 13: Xmir (0x562a70c48000+0x18fd62) [0x562a70dd7d62]
(EE) 14: Xmir (FreeClientResources+0x6c) [0x562a70dd8f8c]
(EE) 15: Xmir (FreeAllResources+0x47) [0x562a70dd9037]
(EE) 16: Xmir (0x562a70c48000+0x16f4d6) [0x562a70db74d6]
(EE) 17: /lib/x86_64-linux-gnu/ (__libc_start_main+0xf0) [0x7f1af937d7e0]
(EE) 18: Xmir (_start+0x29) [0x562a70c81459]
(EE) Segmentation fault at address 0xb0
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting

Larry Price (larryprice) wrote :

Interesting - I've seen supertuxkart run on frieza, though it was unplayable. This could potentially have something to do with the nouveau drivers (

dinamic: are you running with the open-source or proprietary drivers? Does supertuxkart work in a unity 7 session on the same machine?

Stephen M. Webb (bregma) on 2016-07-13
Changed in libertine:
status: New → Triaged
importance: Undecided → Medium
dinamic (dinamic6661) wrote :

i'm using nouveau and runs on unity7, and it used to run on on xmir and native on mir (since it's just an SDL2 game), but something in the latest updates broke it (i'm using 16.10 + proposed)

xmir (oldish video), but it i run it a couple of weeks ago in xmir but not with libertine but i guess libertine does the same ...

dinamic (dinamic6661) wrote :

this is the only one that doesn't work for me, here's more apps installed with libertine

dinamic (dinamic6661) wrote :

btw, it's not supertux kart :D it's just supertux :D (it's a diff game, hehe)

Stephen M. Webb (bregma) wrote :

For the record, I can reproduce this on Intel drivers. It appears to be a crash in possibly related to cursor handling or maybe XSHM.

tags: added: xmir
Changed in xorg-server (Ubuntu):
status: New → Confirmed
importance: Undecided → High
summary: - supertux doesn't start
+ Some X apps like supertux2 now crash Xmir

I've encountered half a dozen different bugs in trying to test this. Eventually I figured out how to reproduce the crash mentioned so I'll focus on that one. Suffice to say any crash of the Xmir process is probably fixable in Xmir.

Changed in xorg-server (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: Confirmed → In Progress
Daniel van Vugt (vanvugt) wrote :

Valgrind says:

==4395== Invalid read of size 8
==4395== at 0x1419F5: xmir_handle_buffer_received (xmir.c:591)
==4395== by 0x52AEF3D: ??? (in /usr/lib/x86_64-linux-gnu/
==4395== by 0x52B63AE: ??? (in /usr/lib/x86_64-linux-gnu/
==4395== by 0x52A8BE7: ??? (in /usr/lib/x86_64-linux-gnu/
==4395== by 0x52B39BC: ??? (in /usr/lib/x86_64-linux-gnu/
==4395== by 0x52B3F48: mir_connection_release (in /usr/lib/x86_64-linux-gnu/
==4395== by 0x141D91: xmir_close_screen (xmir.c:1254)
==4395== by 0x1892C7: CursorCloseScreen (cursor.c:187)
==4395== by 0x20D303: AnimCurCloseScreen (animcur.c:106)
==4395== by 0x210E61: present_close_screen (present_screen.c:64)
==4395== by 0x275666: dix_main (main.c:352)
==4395== by 0x6EAD7DF: (below main) (libc-start.c:291)
==4395== Address 0x170f1a30 is 16 bytes inside a block of size 264 free'd
==4395== at 0x4C2EDEB: free (in /usr/lib/valgrind/
==4395== by 0x29E2C6: DeleteWindow (window.c:990)
==4395== by 0x294291: doFreeResource (resource.c:872)
==4395== by 0x29534B: FreeClientResources (resource.c:1138)
==4395== by 0x2953F6: FreeAllResources (resource.c:1153)
==4395== by 0x27557D: dix_main (main.c:321)
==4395== by 0x6EAD7DF: (below main) (libc-start.c:291)
==4395== Block was alloc'd at
==4395== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/
==4395== by 0x28ED99: _dixAllocateScreenObjectWithPrivates (privates.c:712)
==4395== by 0x29BBF2: CreateRootWindow (window.c:449)
==4395== by 0x275433: dix_main (main.c:229)
==4395== by 0x6EAD7DF: (below main) (libc-start.c:291)

Daniel van Vugt (vanvugt) wrote :

OK, there are several issues here...

1. wm_set_cursor_visibility: visible using XCreateFontCursor

Ignore that. It's just a log message from matchbox-window-manager.

2. supertux2 fails to start with:
[FATAL] /build/supertux-7_Bg7b/supertux-0.4.0/src/supertux/main.cpp:444 Unexpected exception: Couldn't initialize SDL: No available displays

That's a bug in Supertux and/or SDL for someone else to fix.

3. Xmir crashes with the above stack starting from around FreeAllResources.

That's a bug in Xmir where it will crash, but only after the last client has disconnected from the server.

So the Xmir crash is triggered by the supertux2 failure and not vice-versa. I will try to fix Xmir but that won't fix Supertux2/SDL ... someone else will need to look into that still.

summary: - Some X apps like supertux2 now crash Xmir
+ supertux2 fails to start, and then Xmir crashes on client exit

Actually #2:

[FATAL] /build/supertux-7_Bg7b/supertux-0.4.0/src/supertux/main.cpp:444 Unexpected exception: Couldn't initialize SDL: No available displays

Is probably due to an old Xmir feature/bug 1504422. That one was inherited from the previous Xmir author. I thought it was harmless (and a feature) but maybe it's not any more. What would have changed is Unity8's window management behaviour. If it just resizes the Xmir window once then it will trigger bug 1504422, which is possibly now causing Supertux2/SDL to fail to start.

Daniel van Vugt (vanvugt) wrote :

OK, half fixed.

Xmir won't crash any more:

But more work is required to make Supertux2 actually start...

dinamic (dinamic6661) wrote :

if i run supertux on Xmir from terminal i get this error

X Error of failed request: BadMatch (invalid parameter attributes)
  Major opcode of failed request: 7 (X_ReparentWindow)
  Serial number of failed request: 173
  Current serial number in output stream: 175

Daniel van Vugt (vanvugt) wrote :

It's fine. I've done half the fix and will do the other half next week.

Changed in libsdl2 (Ubuntu):
status: New → Invalid
Changed in libertine:
status: Triaged → Invalid
Changed in libsdl2 (Ubuntu):
status: Invalid → Won't Fix
Changed in supertux (Ubuntu):
status: New → Won't Fix
status: Won't Fix → Invalid
Stephen M. Webb (bregma) wrote :

If I run Xmir with -rootless SuperTux2 starts and runs (with other issues, I do not believe those are relevant to this bug).

Daniel van Vugt (vanvugt) wrote :

Correct, rootless works, seemingly because that's a workaround for bug 1504422 :)

Daniel van Vugt (vanvugt) wrote :
Changed in xorg-server (Ubuntu):
status: In Progress → Fix Committed
summary: - supertux2 fails to start, and then Xmir crashes on client exit
+ SDL apps fail to start, and then Xmir crashes on client exit
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xorg-server - 2:1.18.4-1ubuntu3

xorg-server (2:1.18.4-1ubuntu3) yakkety; urgency=medium

  * debian/patches/xmir.patch:
    - Fix bottom/right edge corruption. (LP: #1510849)
    - Fix key repeat. (LP: #1591356)
    - Don't delete outputs without replacing them. (LP: #1504422) (LP: #1602561)
    - Xmir -debug: Log WM types by name and number.
    - Implement fake GLX frame notification/timing.
    - Improve focus tracking.

 -- Robert Ancell <email address hidden> Thu, 21 Jul 2016 11:42:03 +0200

Changed in xorg-server (Ubuntu):
status: Fix Committed → Fix Released
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers