supertux 2 can't start with SDL_VIDEODRIVER=mir [Couldn't initialize SDL: Failed to connect to the mir server]

Bug #1661836 reported by dinamic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Incomplete
High
Stephen M. Webb
Mir
Invalid
Undecided
Unassigned
libsdl2 (Ubuntu)
Incomplete
High
Brandon Schaefer
supertux (Ubuntu)
Incomplete
High
Unassigned
unity8 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

17.04 / unity8 session

from what i understand this is an SDL2 app and should work on unity8, it did before

$ journalctl --user-unit ubuntu-app-launch-application-legacy-supertux2-1486212780752430.service
-- Logs begin at Sat 2017-02-04 14:24:38 EET, end at Sat 2017-02-04 14:55:01 EET. --
Feb 04 14:53:00 pixel-desktop systemd[3969]: Starting ubuntu-app-launch-application-legacy-supertux2-1486212780752430.service...
Feb 04 14:53:01 pixel-desktop supertux2[8395]: [2017-02-04 14:53:01.377093] <ERROR> MirConnectionAPI: Caught exception at client library boundary (in mir_connection_release): /build/mir-1Sl_GZ/mir-0.26.0
Feb 04 14:53:01 pixel-desktop supertux2[8395]: Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<mir::socket_disconnected_error> >
Feb 04 14:53:01 pixel-desktop supertux2[8395]: std::exception::what: Failed to send message to server: Broken pipe
Feb 04 14:53:01 pixel-desktop supertux2[8395]: [boost::errinfo_errno_*] = 32, "Broken pipe"
Feb 04 14:53:01 pixel-desktop supertux2[8395]: [FATAL] /build/supertux-LmXSob/supertux-0.5.1/src/supertux/main.cpp:510 Unexpected exception: Couldn't initialize SDL: Failed to connect to the mir server:
Feb 04 14:53:01 pixel-desktop systemd[3969]: ubuntu-app-launch-application-legacy-supertux2-1486212780752430.service: Main process exited, code=exited, status=1/FAILURE
Feb 04 14:53:01 pixel-desktop systemd[3969]: Failed to start ubuntu-app-launch-application-legacy-supertux2-1486212780752430.service.
Feb 04 14:53:01 pixel-desktop systemd[3969]: ubuntu-app-launch-application-legacy-supertux2-1486212780752430.service: Unit entered failed state.
Feb 04 14:53:01 pixel-desktop systemd[3969]: ubuntu-app-launch-application-legacy-supertux2-1486212780752430.service: Failed with result 'exit-code'.

dinamic (dinamic6661)
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

dinamic, you are a star...

Unfortunately I can think of a few reasons why this might happen.
  1. Unity8 server died (although you would have noticed)
  2. Apparmour problems
  3. Fullscreen apps may crash the server in Mir 0.26.0 (bug 1661508)

And worse, when I try to test supertux under Mir right now it fails for a 4th reason:

$ mirrun /usr/games/supertux2
[FATAL] /build/supertux-LmXSob/supertux-0.5.1/src/supertux/main.cpp:510 Unexpected exception: Couldn't initialize SDL: Failed to connect to the mir server: Failed to connect to server socket: No such file or directory

Which sounds like a known issue with non-root users not being able to auto-discover the Mir socket path. However then running it as root also fails (SDL crashes trying to use X11).

I can't tell where the cause of this bug is. Might also be in SDL.

Changed in supertux (Ubuntu):
importance: Undecided → High
Changed in libsdl2 (Ubuntu):
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Bug 1503971 is one of the problems I was hitting.

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

It appears this is an old bug. Also confirmed on xenial...

(gdb) bt
#0 0x00007ffff51ce97d in XQueryExtension ()
   from /usr/lib/x86_64-linux-gnu/libX11.so.6
#1 0x00007ffff51c24f2 in XInitExtension ()
   from /usr/lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007ffff6fb069c in ?? () from /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
#3 0x00007ffff6fac041 in glXQueryVersion ()
   from /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
#4 0x00007ffff6d5cb34 in glxewInit ()
   from /usr/lib/x86_64-linux-gnu/libGLEW.so.1.13
#5 0x00000000005b63cb in GLRenderer::GLRenderer() ()
#6 0x00000000005b31d3 in GLVideoSystem::GLVideoSystem() ()
#7 0x00000000004f4a65 in VideoSystem::create(VideoSystem::Enum) ()
#8 0x00000000004ad662 in Main::launch_game() ()
#9 0x00000000004af0ad in Main::run(int, char**) ()
#10 0x00000000004a9f13 in main ()

Perhaps when you say "should work on unity8, it did before" you are recalling it working in Xmir (which we have discussed and fixed before). But I'm not aware of supertux ever yet working on SDL2-Mir native.

Changed in mir:
status: New → Invalid
Changed in unity8 (Ubuntu):
status: New → Invalid
summary: - supertux 2 doesn't start
+ supertux 2 can't start with SDL_VIDEODRIVER=mir
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: supertux 2 can't start with SDL_VIDEODRIVER=mir

Confirmed supertux still works perfectly under Xmir.

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

Oh, and we have discussed this bug before too.

Duplicate of bug 1605478.

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

OK, maybe not a duplicate. I can't explain why supertux is failing to find the Mir socket for you. But if it could then I would expect it to crash like it always has for me (bug 1605478).

summary: - supertux 2 can't start with SDL_VIDEODRIVER=mir
+ supertux 2 can't start with SDL_VIDEODRIVER=mir [Couldn't initialize
+ SDL: Failed to connect to the mir server]
Revision history for this message
kevin gunn (kgunn72) wrote :

just adding, my experience is SDL "mirconnectionapi: caught exception at client boundary"

tags: added: unity8-desktop
Changed in canonical-devices-system-image:
importance: Undecided → High
assignee: nobody → Stephen M. Webb (bregma)
Changed in libsdl2 (Ubuntu):
assignee: nobody → Brandon Schaefer (brandontschaefer)
kevin gunn (kgunn72)
Changed in canonical-devices-system-image:
milestone: none → u8c-1
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like this is just an (un)lucky case for bug 1605478. Sometimes it won't crash if you're either:
   (a) lucky enough to have a memory state that doesn't segfault; or
   (b) running an X server somewhere else on the system.

In that case I would expect the Mir connection to fail with some error message. But it could still be bug 1605478 that's the root cause.

Let's get a fix for bug 1605478 released first then see if this one persists.

Changed in canonical-devices-system-image:
status: New → Incomplete
Changed in libsdl2 (Ubuntu):
status: New → Incomplete
Changed in supertux (Ubuntu):
status: New → Incomplete
Changed in canonical-devices-system-image:
milestone: u8c-1 → u8c-2
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.