Tuesday, October 27, 2015

Anode, Gentoo Linux, and Unity3D

One of our customers for Anode attempted to the run the game on their Gentoo Linux machine and found that it immediately crashed. Unity did not provide a very helpful stack trace for us to dig into.

It took almost a week and a half of research, but we finally narrowed down what the problem was. Our customer who discovered the problem was incredibly helpful during the process.

Suffice to say, when we built Anode using the most current version of Unity we had available (5.2.1f1, also tested more recently with 5.2.2f1 and 5.2.2p1) and had sound assets referenced in the scene file, the game would crash, but only if we ran on Gentoo Linux through the Steam client. If we ran via the command line or a desktop shortcut, the game was fine. We also confirmed this with a simple Unity project started from scratch.

One of the symptoms of this problem we noticed was during the Unity build process, where it would warn "Failed to add the asset file size for sharedassets0.resource". If we referenced a sound asset, this warning would appear, and we'd get the crash on Gentoo. If we removed the sound reference, the warning would not appear, and the game would not crash. This is also happened when we tried to include sound assets in the Resources folder rather than a direct scene reference (though in that case the warning was "Failed to add the asset file size for resources.resource").

This Unity forum thread talks a lot about the warning, but in the end concludes that it's harmless, and in fact Patch 4 for Unity 5.2.1 suppresses the warning message during the build. We had seen this warning earlier during the development of the game, but it did indeed seem harmless, since the game ran find on Windows, Mac, and Ubuntu Linux. However, even with 5.2.1p4 suppressing the warning, we still found the same Gentoo crash with the builds it made.

We currently have an issue submitted to Unity about this, and will keep an eye on it.