SpaceChem fails after recent update
After recent update of SpaceChem (one bundling mono inside), game segfaults soon after start unless I have mono installed systemwide. Full stack trace: http://pastebin.de/32054 or https://gist.github.com/5f2ead1bfef481f62b63
System information: Debian Wheezy i386, kernel 3.2. Nouveau.
The game is crashing because one of the Mono functions (System.Platform.IsMacOS) P/Invokes libc, but is failing to find the libc library. Since Mono is always shipped with Ubuntu, and whether or not it works on Debian depends on whether or not you have Mono installed, it's possible that we're missing a file in the version of Mono we ship with the game.
@lumag We're focusing on Ubuntu right now and don't have time to look into this, but if you want to investigate further it'd be a huge help!
@zachtronics
I did some research. It looks like your provided mono copy is not really relocatable. It uses several files from the root file system. First it looks for /etc/mono/config, which maps 'libc' dll name to libc.so.6. I can circumvent this by symlinking (just a hack) libc.so.6 to the SpaceChem dir. Then it also uses (somehow) /etc/mono/2.0/machine.config to map some uname information to 'linux' machine (see the log-libc.txt file in the https://gist.github.com/cf3187d738b1f3a4add5). Unfortunately full strace takes too much space, but after adding mono-runtime package, I can get SpaceChem to work w/o problems.
So, the source lies somewhere in the bundled mono version where it looks for the files in /etc,
After I added the following etc dir to the SpaceChem directory, things go smooth even without system-wide mono. Files copied from Debian's mono setup. Probably you can get them from your system also. ls -lR etc etc: total 0 drwxr-xr-x 3 lumag lumag 29 Jan 8 05:31 mono
etc/mono: total 4 drwxr-xr-x 2 lumag lumag 27 Jan 8 05:31 2.0 -rw-r--r-- 1 lumag lumag 1779 Jan 8 05:31 config
etc/mono/2.0: total 32 -rw-r--r-- 1 lumag lumag 29117 Jan 8 05:31 machine.config
Then I just add MONO_CFG_DIR=etc to the SpaceChem's mono invocation and it works!!!
Hope this helps.
@zachtronics Sorry if this looks a bit too confused/disordered. I was debugging right in time of writing the comment. The solution that made SC work for me was to add a (part of) /etc/mono hierarchy (etc/mono/config and etc/mono/2.0/machine.config) to the SpaceChem directory and modify execution script to pass MONO_CFG_DIR=etc environment variable to mono.
Easiest fix for Ubuntu 12.04 x86_64 is to install mono-runtime run sudo apt-get install mono-runtime. It failed to run before I installed and worked perfectly after I installed. I will also say that mono-runtime was not installed with a base load of Ubuntu 12.04 x86_64.
@INoUrScrts this brings a log of mono crap to my system. I think that the whole point was to have mono provided together with SpaceChem Linux bundle.
@zachtronics By the way. What about providing mono as a free Linux-only DLC for SpaceChem so that users that want it can download it separately. And users who have systemwide mono won't have to use your version?
@lumag Keith from Zachtronics here. I have implemented the fix you described above. Can you update to the "prerelease" branch of SpaceChem and tell me if it now works for you?
In case you haven't changed branches before: Open Steam to your library and right-click on SpaceChem. Select "Properties", then select the "BETAS" tab, and then select "prerelease" from the dropdown. Let it download its files and then try launching the game again.
@holmak No, it does not.
It should be etc/mono/config and etc/mono/2.0/machine.config files, not etc/config (note the mono/ subdirectory).
If I move files to the proper directory, it works!
@holmak Current prerelease branch works for me!
I didn’t have this issue, but wanted to mention nothing broke after I opted into the prerelease channel :) Ubuntu 12.04 LTS 64bit.
@lumag @johndrinkwater Thanks for the confirmation. It looks like that fixes it for everyone, so I'm going to make that build public.
@holmak Thank you. Public build also works for me now.
I noticed that the included build libSDL-1.2.so is linking against libcaca.so.0, which I don't have. When I replace it with a build that doesn't require libcaca, the game works perfectly for me, so it is obviously not needed.
For info on what libcaca does: http://caca.zoy.org/wiki/libcaca
Could you please either replace libSDL with a version that doesn't depend on libcaca, or bundle libcaca?
Thanks in advance
For me the game still crashes on startup (on Fedora 18 x64): http://pastebin.com/p49ZMkf0
@monreal Are you able to run other Steam games, or do they crash in the same way?
@holmak: SpaceChem is the only one not working for me... I can run the following Steam/Linux games just fine: And Yet It Moves, Aquaria, Cogs, Darwinia, Dungeons of Dredmor, Frozen Synapse, Galcon Fusion, Killing Floor, Space Pirates and Zombies, Splice, Steel Storm: Burning Retribution, Superbrothers: Sword & Sworcery EP, Team Fortress 2, TinyAndBig, Trine 2, World of Goo
@monreal Unfortunately my main 64 bit system is behind firewall which blocks Steam. I'll try setting up a 64 bit chroot on my laptop.
@grigi I can confirm that my problems were with a missing lib32-libcaca... I installed this and now it works, no change to anything. It was segfaulting before and saying there was a problem with libSDL_mixer.
Awesome! I replaced the SDL libraries with my own and now it's working. I've tried installing libcaca before but it did not worked.
@monreal @cybercyst @Skiski
I wander how do you install steam. I tried with the fresh Ubuntu 64-bit chroot. I installed base system, then installed steam. Steam:i386 pulls in libsdl1.2debian:i386 which in turn pulls in libcaca0:i386, thus providing libcaca.so.0 for libSDL-1.2.so.0 from SpaceChem.
I forgot to remind that I'm using Fedora 17 x64, no ubuntu. So maybe the SDL libraries provided by Fedora ain't exactly the same then the one provided by Ubuntu.
Are you using the default launcher, or are you using this line? LD_LIBRARY_PATH=$HOME/.steam/bin:/usr/lib:$PWD MONO_PATH=monolib $PWD/mono SpaceChem.exe
Because with the default launcher, the game doesn't start with the provided SDL libraries, even with libcaca installed. When I look at the crash log, it seems that it fails to find libSDL_mixer-1.2.so.0. Using the aformentioned line, it works.
If I replace the SDL libraries, both launcher works, and thus I'm able to use SpaceChem directly from Steam, without changing the launcher.
But now, I've noticed that I get another error: libGL error: failed to load driver: swrast libGL error: Try again with LIBGL_DEBUG=verbose for more details.
It's only a warning, since the game starts anyway, but it is strange...