[SRU] Bug in SDL2 blocks Unity-based games

Bug #1772471 reported by Ryan C. Gordon on 2018-05-21
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libsdl2 (Ubuntu)
Undecided
Unassigned
Artful
Undecided
LocutusOfBorg
Bionic
Undecided
LocutusOfBorg

Bug Description

[ Impact ]
* people using unity3d and steam games, with bundled sdl2 libraries

[ Regression Potential ]
* Low, this is part of the upcoming new release, and the request comes from upstream

[ Steps to reproduce ]
("Unity" here refers to the video game engine at https://unity3d.com/ and not Ubuntu's Unity project.)

There is a bug in SDL2 that causes Unity-based games to fail in certain configurations. The basic idea is that Unity is statically linked to SDL, and then a plugin also links dynamically to SDL, and the dynamically loaded version accidentally resolves an important symbol to the address in the statically linked version, causing chaos.

You can see this happen in the game Firewatch ( https://store.steampowered.com/app/383870/Firewatch/ ).

This bug will trigger if the game dynamically loads an SDL2 version > 2.0.5. Steam ships their own copy of SDL in their "steam runtime," but will favor a system-installed version if available, which means that Ubuntu is probably having this problem for users that have the libsdl2 package installed since release 17.10, which is the first to ship SDL 2.0.6. Debian Stretch is still on 2.0.5 and probably not triggering this bug quite yet.

The upstream fix is simple, and should apply cleanly to any SDL version that is 2.0.3 or later.

https://hg.libsdl.org/SDL/rev/7babfecee045

I _think_ all Unity titles are x86-64 binaries, so this doesn't affect every architecture, but the SDL2 patch is correct for any target worth pushing an update for.

This fix will be in SDL 2.0.9, but we don't have a timetable for that release yet, so I thought it might be worth encouraging distros to apply that one patch to their current SDL2 packages in the meantime, to make sure Firewatch and other games work out of the box.

Steps to Reproduce:
1. Install x86-64 Ubuntu 17.10 or later
2. Install Ubuntu's libsdl2 package.
3. Install Steam ( https://store.steampowered.com/ or maybe a distro-specific package )
3. Install Firewatch via Steam (if you need a copy, we can supply it)
4. Launch Firewatch

Actual Results:
Game launches, possibly makes an OpenGL window without rendering anything into it, and then either crashes or hangs indefinitely. Be prepared to kill the process if necessary.

Expected Results:
Game launches and gets to its main menu.

One can also bypass this bug with the environment variable SDL_DYNAMIC_API=/path/to/where/ubuntu/installed/libSDL2-2.0.so.0, but we'd encourage you to just update the SDL package with the patch.

Thanks for your time!

--ryan.

Hello Ryan, I committed the fix in cosmic, will update artful/bionic once it goes in release.

Changed in libsdl2 (Ubuntu):
status: New → Fix Committed
summary: - Bug in SDL2 blocks Unity-based games
+ [SRU] Bug in SDL2 blocks Unity-based games
description: updated
Changed in libsdl2 (Ubuntu Artful):
status: New → In Progress
Changed in libsdl2 (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → LocutusOfBorg (costamagnagianfranco)
Changed in libsdl2 (Ubuntu Artful):
assignee: nobody → LocutusOfBorg (costamagnagianfranco)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libsdl2 - 2.0.8+dfsg1-1ubuntu2

---------------
libsdl2 (2.0.8+dfsg1-1ubuntu2) cosmic; urgency=medium

  * debian/patches/SDL2-dynapi-symbol-resolution-fix.patch:
    cherry-pick upstream fix for Unity-based games shipping bundled
    libsdl2 version (LP: #1772471)
    - thanks Ryan Gordon for the patch and help!

 -- Gianfranco Costamagna <email address hidden> Tue, 22 May 2018 09:24:20 +0200

Changed in libsdl2 (Ubuntu):
status: Fix Committed → Fix Released

Hello Ryan, or anyone else affected,

Accepted libsdl2 into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libsdl2/2.0.8+dfsg1-1ubuntu1.18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libsdl2 (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Changed in libsdl2 (Ubuntu Artful):
status: In Progress → Fix Committed
tags: added: verification-needed-artful
Łukasz Zemczak (sil2100) wrote :

Hello Ryan, or anyone else affected,

Accepted libsdl2 into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libsdl2/2.0.6+dfsg1-3ubuntu1.17.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers