Cosmos
Cosmos copied to clipboard
Doing a FileSystem operation via an Action makes a CPU Exception and creates a corrupted file
Area of Cosmos - What area of Cosmos are we dealing with?
Filesystem
Expected Behaviour - What do you think that should happen?
It should create a file like supposed to
Actual Behaviour - What unexpectedly happens?
makes a CPU Exception x06 and creates a corrupted directory when its supposed to be a file and sometimes it corrupts the entire filesystem making it unusable
Reproduction - How did you get this error to appear?
if (!Kernel.tryCatch(() => File.WriteAllText(@"0:\fscheck.txt", "This is a test file"), Logger.LogLevel.Fatal))
{
Logger.Warn("File system checks failed. Disk operations won't be available");
return;
}
Kernel.tryCatch():
public static bool tryCatch(Action action, Logger.LogLevel exceptionLevel)
{
try
{
action();
}
catch (Exception ex)
{
Logger.Log(exceptionLevel, ex.Message);
return false;
}
return true;
}
Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?
last devkit as of 7/11/2022
Can you check if the issue also happens when you replace action with just throwing an exception?
try
{
throw new Exception();
}
catch (Exception ex)
{
Logger.Log(exceptionLevel, ex.Message);
return false;
}
return true;
Well it wouldnt be using an action anymore and it will work, the try catch or the logger.log isnt the problem
And I cant use my pc rn
Closing because we can't reproduce this issue