[SRU] Bug in SDL2 blocks Unity-based games

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

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!

I'm using it correctly

tags: added: verification-done verification-done-artful
removed: verification-needed verification-needed-artful
Chris Halse Rogers (raof) wrote :

Is this also verification-done for bionic? We can't release the artful update until the bionic update is also ready (to avoid regressions when people update from artful to bionic).

I switched the main system to bionic, but forgot to update the bug

thanks!

tags: added: verification-done-bionic
removed: verification-needed-bionic
Łukasz Zemczak (sil2100) wrote :

Could you please check and write here which versions of libsdl2 have been used during testing?

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libsdl2 - 2.0.8+dfsg1-1ubuntu1.18.04.1

---------------
libsdl2 (2.0.8+dfsg1-1ubuntu1.18.04.1) bionic; 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 Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for libsdl2 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Robie Basak (racb) wrote :

I'd prefer to see a verification report that includes the package version string tested as requested before releasing to Artful please, especially since there are multiple versions and an override involved here, and people upgrading between them, which I think makes an error in what I'm releasing vs. what was tested more likely.

Other SRU team members' views may vary.

Crazy Leung (mudinlove) wrote :
Download full text (3.8 KiB)

I still got similar issue when run CDDA:
---------------
./cataclysm-launcher
dbus[6581]: arguments to dbus_message_new_method_call() were incorrect, assertion "path != NULL" failed in file ../../../dbus/dbus-message.c line 1362.
This is normally a bug in some application using the D-Bus library.

  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted (core dumped)
---------------
I have upgraded the libsdl2 to this version (2.0.8+dfsg1-1ubuntu1.18.04.1):
---------------
apt-cache show libsdl2-2.0-0
Package: libsdl2-2.0-0
Architecture: i386
Version: 2.0.8+dfsg1-1ubuntu1.18.04.1
Multi-Arch: same
Priority: optional
Section: universe/libs
Source: libsdl2
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian SDL packages maintainers <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1249
Depends: libasound2 (>= 1.0.27), libc6 (>= 2.27), libpulse0 (>= 0.99.1), libsndio6.1 (>= 1.1.0), libwayland-client0 (>= 1.9.91), libwayland-cursor0 (>= 1.0.2), libwayland-egl1-mesa (>= 10.0.2) | libwayland-egl1, libx11-6 (>= 2:1.2.99.901), libxcursor1 (>> 1.1.2), libxext6, libxi6 (>= 2:1.2.99.4), libxinerama1, libxkbcommon0 (>= 0.5.0), libxrandr2 (>= 2:1.2.99.3), libxss1, libxxf86vm1
Conflicts: libsdl-1.3-0
Replaces: libsdl-1.3-0
Filename: pool/universe/libs/libsdl2/libsdl2-2.0-0_2.0.8+dfsg1-1ubuntu1.18.04.1_i386.deb
Size: 383652
MD5sum: 9fda33c5f6ec98313f62ec3e0f6cfe36
SHA1: f1fc8a330baca873bf436316cce10a4ab831e0d8
SHA256: bcd85071947d8601e50e44c9008b9b4dac2765583ef6bf8c5fce7049bdf1751b
Homepage: https://www.libsdl.org/
Description-en: Simple DirectMedia Layer
 SDL is a library that allows programs portable low level access to a video
 framebuffer, audio output, mouse, and keyboard.
 .
 This version of SDL is compiled with X11 and Wayland graphics drivers and OSS,
 ALSA, sndio and PulseAudio sound drivers.
Description-md5: d559f821a8f0d5e89c678fe44650c80c
Task: kubuntu-desktop, kubuntu-full, lubuntu-gtk-desktop, lubuntu-desktop, lubuntu-qt-desktop, ubuntustudio-video, ubuntustudio-graphics, ubuntustudio-audio, ubuntukylin-desktop, ubuntu-budgie-desktop
Supported: 3y

Package: libsdl2-2.0-0
Architecture: i386
Version: 2.0.8+dfsg1-1ubuntu1
Multi-Arch: same
Priority: optional
Section: universe/libs
Source: libsdl2
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian SDL packages maintainers <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1249
Depends: libasound2 (>= 1.0.27), libc6 (>= 2.27), libpulse0 (>= 0.99.1), libsndio6.1 (>= 1.1.0), libwayland-client0 (>= 1.9.91), libwayland-cursor0 (>= 1.0.2), libwayland-egl1-mesa (>= 10.0.2) | libwayland-egl1, libx11-6 (>= 2:1.2.99.901), libxcursor1 (>> 1.1.2), libxext6, libxi6 (>= 2:1.2.99.4), libxinerama1, libxkbcommon0 (>= 0.5.0), libxrandr2 (>= 2:1.2.99.3), libxss1, libxxf86vm1
Conflicts: libsdl-1.3-0
Replaces: libsdl-1.3-0
Filename: pool/universe/libs/libsdl2/libsdl2-2.0-0_2.0.8+dfsg1-1ubuntu1_i386.deb
Size: 383256
MD5sum: 013a266824586b6697d65c83fdbd37c6
SHA1: 4fb...

Read more...

@mudinlove, this might be a different issue, please open a new bug.

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

Other bug subscribers