Cities: Skylines

Cities: Skylines

Not enough ratings
`funlockfile` crashes on Linux: a few tips that may help fix your game
By zero_slash_zero
A few things that may help fix your game on Linux if you suffer from issues with funlockfile crashes.
   
Award
Favorite
Favorited
Unfavorite
Intro
If you're here, I assume you already know that your game is crashing from a null pointer related to funlockfile. Something like this:
Receiving unhandled NULL exception #0 0x007f3b44533f00 in funlockfile #1 0x007f3b445344b8 in (Unknown)

If anything is missing from this guide, please do let me know in the comments! I'm also open to fixes for other *nix OSes, so leave those down there too please!

Any stupid questions in the comments will elicit no response from me.
Install the Mono runtime
The game is written in C#, and on Windows/macOS the runtime is installed automatically (not sure here, don't quote me). On Linux, however, it isn't. This isn't a problem most of the time, but the moment you start using mods it appears more often.

Debian/Ubuntu (tested on Linux Mint 20.1):
sudo apt install mono-devel

Now try starting your game and trying to reproduce your crash.
Increase open file limit
This will break the Steam Overlay, so if you need it do not follow these steps!

Open up a terminal and run
ulimit -Hn
This should spit out a number over at least 1,000,000. If it isn't, follow some internet guide to change the hard open file limit on your system. Change it to at least 1,048,576.

Next, run
find ~ -name Cities_Loader.sh
This should spit out exactly one result. Open up that file in your favorite code editor and add this line directly below the line that says
#!/bin/sh
ulimit -n hard
Save and exit.

Finally, open up game properties and set the launch location to
/path/to/Cities_Loader.sh %command%
Replace /path/to/Cities_Loader.sh with the path to Cities_Loader.sh. Try starting your game again and reproducing the crash.
4 Comments
borb-bot 20 Sep, 2022 @ 2:06pm 
Wow, after nearly giving up this worked for me. Thank you very much! :steamthumbsup:
shakespear 13 Apr, 2022 @ 7:53pm 
Balls
RA3236 12 Dec, 2021 @ 8:41pm 
Increasing the hard open file limit did it for me.
For anyone curious, on Arch Linux and presumably its derivatives, you need to open [code]/etc/security.limits.conf[/code] and insert [code]* hard nofile 1048576[/code] into the file, then restart your computer. Then check the result with [code]ulimit -Hn[/code].
Sokrates 22 Oct, 2021 @ 11:43am 
Hey thanks for your guide. The last part of the guide stopped crashes from occurring, but it shows an error every-time you launch the game and start a save. however it does not seem to affect anything.