Jump to content

Save freeze: UnityException: get_consoleLogPath can only be called from the main thread


Tapk
  • Branch: Live Branch Version: Linux Fixed

Attached save file freezes (music keeps running, but UI is stuck; "OxygenNoIncluded is not responsive" dialog appears after a while) a few seconds after loading, 100% reproducible.

Red text at lower left saying:

Quote

UnityException: get_consoleLogPath can only be called from the main thread.

[...]

 

screenshot.jpg

Spacecamp6.sav


Steps to Reproduce

Load the provided file.




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.

I went back a save, deconstructed some rockets and did other things differently, with the same result. I think the crash happens immediately when the iron volcano at the bottom of the screenshot starts shaking pre-eruption. There is also this in the log which makes me think the volcano is part of the problem:

Quote

[06:38:21.850] [84] [INFO] SimMessage: Invalid temperature T=0.000000, M=0.002624

I'd appreciate any hint for how to rescue my game.

Share this comment


Link to comment
Share on other sites

I've got the same problem. Game stops responding on frozen asteroid with iron volcanoes.

End portion of Player.log:

Quote

[01:29:43.971] [33] [WARNING] Effective mass cannot be greater than capacity!
[01:29:52.407] [60] [INFO] Reporting error.

[01:29:52.407] [60] [INFO] SimMessage: Invalid temperature T=0.000000, M=0.010101
[01:29:52.407] [60] [INFO]
UnityException: get_consoleLogPath can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
  at (wrapper managed-to-native) UnityEngine.Application.get_consoleLogPath()
  at Util.LogFilePath () [0x00001] in C:\jenkins_workspace\workspace\SimGame_Windows\game\Assets\Plugins\Klei\util\Util.cs:616
  at KCrashReporter.GetLogContents () [0x00001] in C:\jenkins_workspace\workspace\SimGame_Windows\game\Assets\scripts\game\KCrashReporter.cs:383
  at KCrashReporter.ReportError (System.String msg, System.String stack_trace, System.String save_file_hash, ConfirmDialogScreen confirm_prefab, UnityEngine.GameObject confirm_parent, System.String userMessage) [0x002fd] in C:\jenkins_workspace\workspace\SimGame_Windows\game\Assets\scripts\game\KCrashReporter.cs:538
  at KCrashReporter.ReportSimDLLCrash (System.String msg, System.String stack_trace, System.String dmp_filename) [0x0007c] in C:\jenkins_workspace\workspace\SimGame_Windows\game\Assets\scripts\game\KCrashReporter.cs:633
  at Sim.DLL_MessageHandler (System.Int32 message_id, System.IntPtr data) [0x00087] in C:\jenkins_workspace\workspace\SimGame_Windows\game\Assets\scripts\sim\SimBindings.cs:249
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs) (at C:\buildslave\unity\build\Runtime\Export\Scripting\UnhandledExceptionHandler.bindings.cs:46)
 
(Filename: C:/jenkins_workspace/workspace/SimGame_Windows/game/Assets/Plugins/Klei/util/Util.cs Line: 616)

 

 

Share this comment


Link to comment
Share on other sites

make sure that you report also what game version you using.

UnityEngine.Application.consoleLogPath()  can be used only in main thread like most unity inbuilt commands, what also is kind off stupid from them because this command is a static and get only

of course that not should freeze game tho by default but as its error, it can todo that as it not returns to location

best probably would be that you call this command only one time at main thread when game starts and save that consoleLogPath data somewhere to memory

this is small thread test what i tested in unity ,works just fine

using UnityEngine;
using System.Threading;

public class Test : MonoBehaviour
{
    static string logpath;

    public static void utest()
    {
        Debug.Log(logpath);
    }
    // Start is called before the first frame update
    void Start()
    {
        logpath = Application.consoleLogPath;
        Thread t = new Thread(new ThreadStart(utest));
        t.Start();
    }
}

 

i don't see also that volcano issue in windows build version 447268, maybe i todo something wrong

Edited by gabberworld

Share this comment


Link to comment
Share on other sites

The version can be seen on the screenshot. Just tested EX1-447598 on Linux - the exact same crash.

Relevant portion of Player.log:

Quote

[01:25:26.787] [1] [WARNING] AdjustLoad() failed
[01:25:26.852] [1] [WARNING] AdjustLoad() failed
[01:25:26.897] [1] [WARNING] AdjustLoad() failed
[01:25:26.973] [1] [WARNING] AdjustLoad() failed
[01:26:14.402] [26] [INFO] Reporting error.

[01:26:14.402] [26] [INFO] SimMessage: Invalid temperature T=0.000000, M=0.462777
[01:26:14.402] [26] [INFO] simlib/UpdateTemperature.cpp:40
UnityException: get_consoleLogPath can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
  at (wrapper managed-to-native) UnityEngine.Application.get_consoleLogPath()
  at Util.LogFilePath () [0x00001] in <03f804e9b1b9428aa014e0ecfbc4c595>:0 
  at KCrashReporter.GetLogContents () [0x00001] in <e2f823eba39e48d4920089deff990e71>:0 
  at KCrashReporter.ReportError (System.String msg, System.String stack_trace, System.String save_file_hash, ConfirmDialogScreen confirm_prefab, UnityEngine.GameObject confirm_parent, System.String userMessage) [0x002fd] in <e2f823eba39e48d4920089deff990e71>:0 
  at KCrashReporter.ReportSimDLLCrash (System.String msg, System.String stack_trace, System.String dmp_filename) [0x0007c] in <e2f823eba39e48d4920089deff990e71>:0 
  at Sim.DLL_MessageHandler (System.Int32 message_id, System.IntPtr data) [0x00087] in <e2f823eba39e48d4920089deff990e71>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)
 
(Filename: <03f804e9b1b9428aa014e0ecfbc4c595> Line: 0)
 

 

Share this comment


Link to comment
Share on other sites

25 minutes ago, Tapk said:

The version can be seen on the screenshot. Just tested EX1-447598 on Linux - the exact same crash.

Relevant portion of Player.log:

 

can be that Linux and windows act differently, i guess need wait for fix

Share this comment


Link to comment
Share on other sites

I'm unable to reproduce this on Linux or Windows. I tried loading the save on release and preview and let it run a couple cycles without crashing. The save file does not have the iron volcanoes uncovered so issued dig commands to uncover them. I'm not sure it's geyser related though.

Based on the Player.log, the simulation is failing an assert which checks to see if a non-zero mass has a temperature greater than zero. In other words an absolute zero temperature is an error.

I've fixed the get_consoleLogPath exception locally but this is secondary to the temperature assert failing.

In the next update to the preview branch I've modified the assert message to include the game cell so we can at least narrow down which area to look at. I'll post here when that goes live.

@Luxab does Tapk's save file crash for you as well? Do you have a save you could share where this happens reliably?

  • Like 1
  • Thanks 1

Share this comment


Link to comment
Share on other sites

Thank you for looking. I've just now realized that I've attached the wrong save file, which is very strange because it was the one with the most recent timestamp in cloud_save_files, and when messing with the local files I've accidentally deleted the right one. The problem happened ~8 cycles after, when I got the bottom-center volcano uncovered.

Btw, is there a way to restore the saves from the cloud? I see the buttons to convert local saves to cloud and back in the UI, but since I've lost the entire subdirectory, my saves never even show up in the list.

Share this comment


Link to comment
Share on other sites

Today's update 448339 to the preview branch contains my assert message change but it does not include my fix for get_consoleLogPath. If you encounter this error again please include your save file and section of your Player.log with the message. It should look like this:

[01:26:14.402] [26] [INFO] SimMessage: Invalid temperature T=0.000000, M=0.462777, cell=40099
[01:26:14.402] [26] [INFO] simlib/UpdateTemperature.cpp:40

Regarding cloud saves, If this shows 0 MB then your files are gone, otherwise it should download them next time you launch or quit the game.

image.png

  • Thanks 2

Share this comment


Link to comment
Share on other sites

Ah sorry haven't checked on this for a bit, I'm on Win10

My save is almost 9MB lol so I can't attach it directly on the forum but here's a link (if there's a better way to send it let me know): https://filetransfer.io/data-package/0QOkqDG0#link

It reliably crashes for me within a minute from pressing play at the beginning of cycle 926. Just tried it on the preview branch. Player.log looks like this -

Quote

[22:26:03.791] [1] [INFO] -- GAME --
Unloading 1 Unused Serialized files (Serialized files now loaded: 1)
[22:26:07.835] [1] [INFO] Checking which steam branch we're on. Got: [public_testing]
[22:26:15.301] [1] [WARNING] Cell 41389 already has a utility network endpoint assigned. Adding FlowUtilityNetwork+NetworkItem will stomp previous endpoint, destroying the object that's already there.
[22:26:15.302] [1] [WARNING] Cell 41390 already has a utility network endpoint assigned. Adding FlowUtilityNetwork+NetworkItem will stomp previous endpoint, destroying the object that's already there.
[22:26:15.303] [1] [WARNING] Cell 41391 already has a utility network endpoint assigned. Adding FlowUtilityNetwork+NetworkItem will stomp previous endpoint, destroying the object that's already there.
[22:26:15.543] [1] [WARNING] Cell 68463 already has a utility network endpoint assigned. Adding FlowUtilityNetwork+NetworkItem will stomp previous endpoint, destroying the object that's already there.
[22:26:15.544] [1] [WARNING] Cell 68464 already has a utility network endpoint assigned. Adding FlowUtilityNetwork+NetworkItem will stomp previous endpoint, destroying the object that's already there.
[22:26:15.544] [1] [WARNING] Cell 68465 already has a utility network endpoint assigned. Adding FlowUtilityNetwork+NetworkItem will stomp previous endpoint, destroying the object that's already there.
[22:26:23.920] [1] [WARNING] Trying to put null go into scene partitioner
[22:26:23.920] [1] [WARNING] Trying to put null go into scene partitioner
[22:26:24.894] [1] [WARNING] missing 'ui' anim in 'artifacts_kanim (KAnimFile)'
[22:26:26.413] [1] [WARNING] Trying to stop a song that isn't playing: Music_Starmap
[22:26:29.130] [1] [INFO] Screen resolution updated, saving values to prefs: 3440x1440 @ 120, fullscreen: True
System memory in use before: 1.55 GB.
System memory in use after: 1.61 GB.

Unloading 6 unused Assets to reduce memory usage. Loaded Objects now: 842226.
Total: 2250.706400 ms (FindLiveObjects: 65.372300 ms CreateObjectMapping: 17.844000 ms MarkObjects: 2166.550500 ms  DeleteObjects: 0.938900 ms)

[22:26:56.716] [45] [INFO] Reporting error.

[22:26:56.716] [45] [INFO] SimMessage: Invalid temperature T=0.000000, M=0.205191, cell=11670
[22:26:56.716] [45] [INFO]
UnityException: get_consoleLogPath can only be called from the main thread.

 

Share this comment


Link to comment
Share on other sites

Changed Status to Known Issue

Thanks, I'm able to reproduce it with the save file on Windows. I'm glad it's not a Linux-only bug. This might take a while to figure out as loading such a large save with debug tools enabled is really slow.

My intuition is it's related to this bug, which is how gas and liquids are displaced (or not) to make room for an emitted element.

 

  • Thanks 2

Share this comment


Link to comment
Share on other sites

Changed Status to Fixed

I've isolated the root problem and fixed it locally. The issue was a temperature transfer related bug and not related to the geysers like I initially thought. The fix will go out in the next public testing branch update. Thanks for all the help in tracking down this issue :).

  • Thanks 3

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