From b64e5802600ef3d24a627127f9b527d1209bbdff Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 17 Nov 2025 20:30:37 +0200 Subject: #4939 Bugsplat often confuses log files on mac, try to make it more reliable --- indra/newview/llappdelegate-objc.mm | 4 ++-- indra/newview/llappviewer.cpp | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index a5b8ddd25c..11761dbaae 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -350,12 +350,12 @@ struct AttachmentInfo info.push_back(AttachmentInfo(secondLogPath, "text/xml")); } - // We "happen to know" that info[0].basename is "SecondLife.old" -- due to + // We "happen to know" that info[0].basename is "SecondLife.crash" -- due to // the fact that BugsplatMac only notices a crash during the viewer run // following the crash. // The Bugsplat service doesn't respect the MIME type above when returning // the log data to a browser, so take this opportunity to rename the file - // from .old to _log.txt + // from .crash to _log.txt info[0].basename = boost::filesystem::path(info[0].pathname).stem().string() + "_log.txt"; infos("attachmentsForBugsplatStartupManager attaching log " + info[0].basename); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9bc5b57695..9b16cbd3bf 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3622,7 +3622,10 @@ void LLAppViewer::writeSystemInfo() if (! gDebugInfo.has("Dynamic") ) gDebugInfo["Dynamic"] = LLSD::emptyMap(); -#if LL_WINDOWS && !LL_BUGSPLAT +#if LL_DARWIN + // crash processing in CrashMetadataSingleton reads SLLog + gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.crash"); +#elif LL_WINDOWS && !LL_BUGSPLAT gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"SecondLife.log"); #else // Far from ideal, especially when multiple instances get involved. @@ -4034,6 +4037,22 @@ void LLAppViewer::processMarkerFiles() } LLAPRFile::remove(error_marker_file); } + +#if LL_DARWIN + if (!mSecondInstance && gLastExecEvent != LAST_EXEC_NORMAL) + { + // While windows reports crashes immediately, mac reports next run and + // may take a while to trigger crash report so it has a special file. + // Remove .crash file if exists + std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLife.old"); + std::string crash_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLife.crash"); + LLFile::remove(crash_log_file); + // Rename ".old" log file to ".crash" + LLFile::rename(old_log_file, crash_log_file); + } +#endif } void LLAppViewer::removeMarkerFiles() -- cgit v1.3