Jump to content

Crash if a local mod file is a symlink


krop
  • Branch: Live Branch Version: Linux Pending

To work on translations, `~/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po` is a symlink pointing to my work folder.
Since the november QoL release, this causes a client crash on startup.

The location and permissions this symlink points to didn't change for years.

Ingame trace:

 

FileNotFoundException: Could not find file "/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po"

System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <f98723dd4586469db5213ec59da723ca>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) (at <f98723dd4586469db5213ec59da723ca>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) (at <f98723dd4586469db5213ec59da723ca>:0)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding) (at <f98723dd4586469db5213ec59da723ca>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string,System.Text.Encoding)
System.IO.File.InternalReadAllLines (System.String path, System.Text.Encoding encoding) (at <f98723dd4586469db5213ec59da723ca>:0)
System.IO.File.ReadAllLines (System.String path, System.Text.Encoding encoding) (at <f98723dd4586469db5213ec59da723ca>:0)
Localization.LoadLocalTranslationFile (Localization+SelectedLanguageType source, System.String path) (at <d1a138216664440ab155c0269220fd53>:0)
LanguageOptionsScreen.LoadTranslation (System.String mod_id) (at <d1a138216664440ab155c0269220fd53>:0)
LanguageOptionsScreen.SetCurrentLanguage (System.String mod_id) (at <d1a138216664440ab155c0269220fd53>:0)
Localization.Initialize () (at <d1a138216664440ab155c0269220fd53>:0)
Global.Awake () (at <d1a138216664440ab155c0269220fd53>:0)
UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion, Transform)
Util:KInstantiate(GameObject, Vector3, Quaternion, GameObject, String, Boolean, Int32)
Util:KInstantiate(GameObject, GameObject, String)
LaunchInitializer:Update()

Build: U53-643502-SCD



The game doesn't crash if the strings.po file is copied in the local mod folder rather than having a symlink.


Steps to Reproduce

See above

 




User Feedback


That's likely a change due to the unity upgrade - either that or if you run steam containerized it could be a change in them preventing steam from reaching out to your files proper, there's been a lot of this going on lately.

If you wouldn't mind doing an strace of the failure that would be very helpful in seeing why it fails now and if there's anything we can do to fix it. Otherwise to mitigate you might look at bind mounts instead of symlinks.

  • Like 1

Share this comment


Link to comment
Share on other sites

30 minutes ago, nome said:

That's likely a change due to the unity upgrade - either that or if you run steam containerized it could be a change in them preventing steam from reaching out to your files proper, there's been a lot of this going on lately.

If you wouldn't mind doing an strace of the failure that would be very helpful in seeing why it fails now and if there's anything we can do to fix it. Otherwise to mitigate you might look at bind mounts instead of symlinks.

Any suggestion on the right params to use?

strace -o /path/to/logfile.txt %command% doesn't help

Share this comment


Link to comment
Share on other sites

How long do you have before it crashes? Running from steam and attaching an strace is great if you can do it. Another option is to rename the original binary and replace it with a shell script that runs the renamed binary under strace.

Note you can probably get away with -efile since we only care about filesystem stuff. Cuts the noise a bit.

  • Like 1

Share this comment


Link to comment
Share on other sites

Since I can also start without translation and make the game crash when clicking on the translations button, that helped. So, `strace -efile -fp <PID>` gives hints. The game considers the file doesn't exist:

 

[pid 140036] stat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", 0x7ffc88a6a4d0) = -1 ENOENT (No such file or directory)
[pid 140036] lstat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", {st_mode=S_IFLNK|0777, st_size=47, ...}) = 0
[pid 140036] stat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", 0x7ffc88a6a2b0) = -1 ENOENT (No such file or directory)
[pid 140036] lstat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", {st_mode=S_IFLNK|0777, st_size=47, ...}) = 0
[pid 140036] stat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr", {st_mode=S_IFDIR|0700, st_size=252, ...}) = 0
[pid 140036] stat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", 0x7ffc88a6a508) = -1 ENOENT (No such file or directory)
[pid 140036] lstat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", {st_mode=S_IFLNK|0777, st_size=47, ...}) = 0
[pid 140036] lstat("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", {st_mode=S_IFLNK|0777, st_size=47, ...}) = 0
[pid 140036] openat(AT_FDCWD, "/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr/strings.po", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 140036] access("/home/krop/.config/unity3d/Klei/Oxygen Not Included/mods/Local/mod_fr", F_OK) = 0

 

Share this comment


Link to comment
Share on other sites

And I presume that when you're operating in shell it does exist? If so, I would suspect that you're dealing with a side effect of the containerization of steam trying to keep you safe from malicious games going and reading random files on your hard drive and the change is unrelated to the oxygen not included update.

Share this comment


Link to comment
Share on other sites

Looks like that, a symlink pointing to the same folder doesn't cause a crash.

Alright, that's not convenient but I have ideas to work around this.

Share this comment


Link to comment
Share on other sites

As I said earlier, you can look at things like bind mounts to put your translation resources inside the container's namespace

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...