From 34e29a90a4c4e673fba9ed6ec377ec4ed85038e9 Mon Sep 17 00:00:00 2001 From: 13xforever Date: Wed, 30 Jul 2025 21:46:41 +0500 Subject: [PATCH] add another case of save data issues --- .../EventHandlers/LogParsing/LogParser.LogSections.cs | 1 + .../EventHandlers/LogParsing/LogParser.RegexPatterns.cs | 7 +++++++ .../LogParserResultFormatter.GeneralNotesSection.cs | 8 +++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs b/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs index f0b0ab33..1e9a65bf 100644 --- a/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs +++ b/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs @@ -239,6 +239,7 @@ internal partial class LogParser ["undub"] = UndubFlag(), ["Input: Pad"] = InputDeviceGamepad(), ["SDL: Found game controller"] = SdlControllerName(), + ["cellSaveData: cellSaveDataGetListItem"] = SaveDataBeforeSegfault(), ["SYS: Failed to remove save data"] = FailedToRemoveSaveData(), ["Trophy: Failed to remove"] = FailedToRemoveTrophy(), ["Failed to install trophy"] = FailedToInstallTrophy(), diff --git a/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs b/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs index 88dd2720..f7ad0874 100644 --- a/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs +++ b/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs @@ -359,4 +359,11 @@ internal partial class LogParser private static partial Regex FailedToRemoveTrophy(); [GeneratedRegex(@"Failed to install .+ '.*(?/dev_hdd0/.+)' \(.+\)\r?$", DefaultOptions)] private static partial Regex FailedToInstallTrophy(); + [GeneratedRegex( + @"cellSaveData:[^\n]+dirName=“(?\w+)”[^\n]+\r?\n"+ + @"[^\n]+SYS:\s*\n"+ + "Segfault", + DefaultOptions + )] + private static partial Regex SaveDataBeforeSegfault(); } \ No newline at end of file diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs index acafb706..5399b400 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs @@ -526,7 +526,7 @@ internal static partial class LogParserResult private static void BuildFatalErrorSection(DiscordEmbedBuilder builder, NameValueCollection items, NameUniqueObjectCollection multiItems, List notes) { var win32ErrorCodes = new HashSet(); - if (multiItems["fatal_error"] is {Length: > 0} fatalErrors) + if (multiItems["fatal_error"] is {Length: >0} fatalErrors) { var contexts = multiItems["fatal_error_context"]; var reducedFatalErrors = GroupSimilar(fatalErrors); @@ -646,7 +646,7 @@ internal static partial class LogParserResult notes.Add("⚠️ PPU desync detected, most likely cause is corrupted save data"); }*/ } - if (multiItems["bad_save_data_path"] is { Length: > 0 } badSavePaths) + if (multiItems["bad_save_data_path"] is { Length: >0 } badSavePaths) { if (badSavePaths is [string singlePath]) notes.Add($"❌ Corrupted save data `{singlePath}`"); @@ -666,7 +666,7 @@ internal static partial class LogParserResult ); } } - if (multiItems["bad_trophy_data_path"] is { Length: > 0 } badTrophyPaths) + if (multiItems["bad_trophy_data_path"] is { Length: >0 } badTrophyPaths) { if (badTrophyPaths is [string singlePath]) notes.Add($"❌ Corrupted trophy data `{singlePath}`"); @@ -687,6 +687,8 @@ internal static partial class LogParserResult } } + if (items["save_dir_before_segfault"] is { Length: > 0 } saveDirBeforeSegfault) + notes.Add($"❌ Potential save data corruption in `{saveDirBeforeSegfault}`"); if (items["os_type"] == "Windows") foreach (var code in win32ErrorCodes) {