Jump to content

[macOS] Game tries to load dot-underscore files as mod dll, crashes


myxal
  • Branch: Live Branch Version: OSX Fixed

This is a minor annoyance in a non-default configuration, that can be easily avoided by running dot_clean or manual deletion, but still...

When storing ONI's game data on exFAT (or other writable, non-native filesystem), macOS creates these ._<filename> files, which hold infornation that can't be store natively - unix ownership/permissions, etc. I'm not sure why but ONI sometimes crashes when these files are present. Here's one crash after freshly extracting MapsNotIncluded into mods/local.

In-game log:

Spoiler
Quote

Exception while loading mod MapsNotIncluded_WorldParser at /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/mods/Local/MapsNotIncluded_WorldParser.
System.BadImageFormatException: Invalid Image: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/mods/Local/MapsNotIncluded_WorldParser/._MapsNotIncluded_WorldParser.dll
File name: '/Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/mods/Local/MapsNotIncluded_WorldParser/._MapsNotIncluded_WorldParser.dll'
  at (wrapper managed-to-native) System.Reflection.Assembly.LoadFrom(string,bool,System.Threading.StackCrawlMark&)
  at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00002] in <606c2e0a56af495988c860a4ac613e74>:0
  at KMod.DLLLoader.LoadDLLs (KMod.Mod ownerMod, System.String harmonyId, System.String path, System.Boolean isDev) [0x00099] in <c0957303ae5744e8a0dda26621d5beb9>:0

  at UnityEngine.Debug.LogError (System.Object message, UnityEngine.Object context) [0x00000] in <6fa2428cdd664a9c966f9bcf636d85c5>:0
  at Debug.LogError (System.Object obj, UnityEngine.Object context) [0x00000] in <a7677246e5a04e5fb63a80ed22547a4d>:0
  at DebugUtil.LogErrorArgs (UnityEngine.Object context, System.Object[] objs) [0x00000] in <a7677246e5a04e5fb63a80ed22547a4d>:0
  at DebugUtil.LogException (UnityEngine.Object context, System.String errorMessage, System.Exception e) [0x00000] in <a7677246e5a04e5fb63a80ed22547a4d>:0
  at KMod.DLLLoader.LoadDLLs (KMod.Mod ownerMod, System.String harmonyId, System.String path, System.Boolean isDev) [0x00000] in <c0957303ae5744e8a0dda26621d5beb9>:0
  at KMod.Mod.Load (KMod.Content content) [0x00000] in <c0957303ae5744e8a0dda26621d5beb9>:0
  at KMod.Manager.Load (KMod.Content content) [0x00000] in <c0957303ae5744e8a0dda26621d5beb9>:0
  at Global.Awake () [0x00000] in <c0957303ae5744e8a0dda26621d5beb9>:0
  at UnityEngine.Object.Internal_InstantiateSingleWithParent_Injected (UnityEngine.Object , UnityEngine.Transform , UnityEngine.Vector3& , UnityEngine.Quaternion& ) [0x00000] in <6fa2428cdd664a9c966f9bcf636d85c5>:0
  at UnityEngine.Object.Internal_InstantiateSingleWithParent (UnityEngine.Object data, UnityEngine.Transform parent, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) [0x00000] in <6fa2428cdd664a9c966f9bcf636d85c5>:0
  at UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Transform parent) [0x00000] in <6fa2428cdd664a9c966f9bcf636d85c5>:0
  at UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Transform parent) [0x00000] in <6fa2428cdd664a9c966f9bcf636d85c5>:0
  at Util.KInstantiate (UnityEngine.GameObject original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.GameObject parent, System.String name, System.Boolean initialize_id, System.Int32 gameLayer) [0x00000] in <a7677246e5a04e5fb63a80ed22547a4d>:0
  at Util.KInstantiate (UnityEngine.GameObject original, UnityEngine.GameObject parent, System.String name) [0x00000] in <a7677246e5a04e5fb63a80ed22547a4d>:0
  at LaunchInitializer.Update () [0x00000] in <c0957303ae5744e8a0dda26621d5beb9>:0
Build: U54-652372-SCR

 

Oddly enough, I usually don't get this on mods installed by Steam and/or updated by ModUpdater, even though the files are still present.

 


Steps to Reproduce
  1. Have writable exFAT volume (/Volumes/T7-exFAT), make a directory on it (App-data/ONI)
  2. Move ONI data directory to the exFAT volume (mv ~/Library/Application\ Support/unity.Klei.Oxygen\ Not\ Included/.  /Volumes/T7-exFAT/App-data/ONI/
  3. Link new dir from the original location (rmdir ~/Library/Application\ Support/unity.Klei.Oxygen\ Not\ Included;  ln -s /Volumes/.../ONI ~/Library/Application\ Support/unity.Klei.Oxygen\ Not\ Included
  4. Extract some zipped mod manually, like MapsNotIncluded: https://github.com/barratt/mapsnotincluded.org/releases
  5. Launch game
  6. Observe crash



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

@EricKlei - I've had this happen again recently (build U55-663500-SCR) after subscribing to Blueprints Expanded. 

Also, I was looking through the log to report an unrelated mod crash, and noticed tons of warnings about "corrupt saves" where the game is trying to parse these ._* files.

Also, should the fix apply to files being loaded by mods (Blueprints), or is that up to the modders (@SGT_Imalas)?

Quote

...

[11:04:01.436] [1] [WARNING] Corrupted save file: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/save_files/Debug SO/._CSV testing start.sav
System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at FastReader.ReadBytes (System.Int32 length) [0x0000b] in <d89821605ff4492a8a41ad2598b0d1e4>:0
  at SaveGame.GetHeader (IReader br, SaveGame+Header& header, System.String debugFileName) [0x00040] in <168da09165c447d5a0cbd6e739fbd310>:0
  at SaveLoader.LoadHeader (System.String filename, SaveGame+Header& header) [0x00026] in <168da09165c447d5a0cbd6e739fbd310>:0
  at LoadScreen.IsFileValid (System.String filename) [0x00002] in <168da09165c447d5a0cbd6e739fbd310>:0
[11:04:01.437] [1] [WARNING] Corrupted save file: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/save_files/Debug SO/._cryofuel experiments v2.sav
System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at FastReader.ReadBytes (System.Int32 length) [0x0000b] in <d89821605ff4492a8a41ad2598b0d1e4>:0
  at SaveGame.GetHeader (IReader br, SaveGame+Header& header, System.String debugFileName) [0x00040] in <168da09165c447d5a0cbd6e739fbd310>:0
  at SaveLoader.LoadHeader (System.String filename, SaveGame+Header& header) [0x00026] in <168da09165c447d5a0cbd6e739fbd310>:0
  at LoadScreen.IsFileValid (System.String filename) [0x00002] in <168da09165c447d5a0cbd6e739fbd310>:0

 

...
[09:50:22.971] [1] [INFO] Error when loading blueprint: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/blueprints/ranches/._mixed puft ranch d (m).blueprint,
[09:50:22.972] [1] [INFO] Error when loading blueprint: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/blueprints/ranches/._mixed puft ranch d.blueprint,
[09:50:22.972] [1] [INFO] Error when loading blueprint: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/blueprints/ranches/._pacu ranch 3-tank.blueprint,
[09:50:22.973] [1] [INFO] Error when loading blueprint: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/blueprints/ranches/._puft egg sorter.blueprint,
[09:50:22.974] [1] [INFO] Error when loading blueprint: /Users/USER/Library/Application Support/unity.Klei.Oxygen Not Included/blueprints/ranches/._puft nursery.blueprint,

 

Edited by myxal
remove PII

Share this comment


Link to comment
Share on other sites

the blueprint loading error is indeed on me to fix

tbf, it is a non critical error that doesnt break anything so it could be a warning instead (I should adjust the wording)

(ps: you didnt censor your user name in the corrupted save file msg)

Edited by SGT_Imalas
  • Big Ups 1

Share this comment


Link to comment
Share on other sites

I removed the warnings when reading saves but since this only affects the Player.log it won't show up in the patch notes.

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...