Bug 1580541 - Bug in SDL2 blocks Unity-based games
Summary: Bug in SDL2 blocks Unity-based games
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: SDL2
Version: 27
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Igor Gnatenko
QA Contact: Fedora Extras Quality Assurance
URL: https://store.steampowered.com/app/38...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-21 18:06 UTC by Ryan C. Gordon
Modified: 2018-05-30 14:32 UTC (History)
3 users (show)

Fixed In Version: SDL2-2.0.8-5.fc28 SDL2-2.0.7-3.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-25 15:05:53 UTC
Type: ---


Attachments (Terms of Use)
Upstream fix (3.32 KB, patch)
2018-05-21 18:09 UTC, Ryan C. Gordon
no flags Details | Diff

Description Ryan C. Gordon 2018-05-21 18:06:04 UTC
User-Agent:       Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Build Identifier: 


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 Fedora is probably having this problem for users that have the SDL2 package installed since release 27, which is the first to ship SDL 2.0.6.

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.

Thanks for your time!


Reproducible: Always

Steps to Reproduce:
1. Install Fedora 27 or later
2. Install Fedora's SDL2 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/fedora/installed/libSDL2-2.0.so.0, but we'd encourage you to just update the SDL package with the patch.

Comment 1 Ryan C. Gordon 2018-05-21 18:09:07 UTC
Created attachment 1439733 [details]
Upstream fix


Just going to attach the SDL2 patch here, for completeness.

--ryan.

Comment 2 Fedora Update System 2018-05-21 18:51:58 UTC
SDL2-2.0.8-5.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2838e5e9ff

Comment 3 Fedora Update System 2018-05-21 19:04:17 UTC
SDL2-2.0.7-3.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-400200f010

Comment 4 Fedora Update System 2018-05-22 15:03:18 UTC
SDL2-2.0.7-3.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-400200f010

Comment 5 Fedora Update System 2018-05-22 19:38:06 UTC
SDL2-2.0.8-5.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2838e5e9ff

Comment 6 Fedora Update System 2018-05-25 15:05:53 UTC
SDL2-2.0.8-5.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2018-05-30 14:32:12 UTC
SDL2-2.0.7-3.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.