diff --git a/components/crashcatcher/windows_crashcatcher.cpp b/components/crashcatcher/windows_crashcatcher.cpp index 23dfac549c..d9ef00ef77 100644 --- a/components/crashcatcher/windows_crashcatcher.cpp +++ b/components/crashcatcher/windows_crashcatcher.cpp @@ -237,7 +237,7 @@ namespace Crash // must remain until monitor has finished waitMonitor(); - std::string message = "OpenMW has encountered a fatal error.\nCrash log saved to '" + std::string message = "OpenMW has encountered a fatal error.\nCrash dump saved to '" + Misc::StringUtils::u8StringToString(getCrashDumpPath(*mShm).u8string()) + "'.\nPlease report this to https://gitlab.com/OpenMW/openmw/issues !"; SDL_ShowSimpleMessageBox(0, "Fatal Error", message.c_str(), nullptr); diff --git a/components/crashcatcher/windows_crashcatcher.hpp b/components/crashcatcher/windows_crashcatcher.hpp index 89678c9ada..bcf1ed688d 100644 --- a/components/crashcatcher/windows_crashcatcher.hpp +++ b/components/crashcatcher/windows_crashcatcher.hpp @@ -21,6 +21,7 @@ namespace Crash // the main openmw process in task manager. static constexpr const int CrashCatcherTimeout = 2500; + static constexpr const int CrashCatcherThawTimeout = 250; struct CrashSHM; diff --git a/components/crashcatcher/windows_crashmonitor.cpp b/components/crashcatcher/windows_crashmonitor.cpp index 3708283efa..8398528ec9 100644 --- a/components/crashcatcher/windows_crashmonitor.cpp +++ b/components/crashcatcher/windows_crashmonitor.cpp @@ -87,9 +87,10 @@ namespace Crash SetEvent(mSignalAppEvent); } - bool CrashMonitor::waitApp() const + bool CrashMonitor::waitApp(bool thawMode) const { - return WaitForSingleObject(mSignalMonitorEvent, CrashCatcherTimeout) == WAIT_OBJECT_0; + return WaitForSingleObject(mSignalMonitorEvent, thawMode ? CrashCatcherThawTimeout : CrashCatcherTimeout) + == WAIT_OBJECT_0; } bool CrashMonitor::isAppAlive() const @@ -185,7 +186,7 @@ namespace Crash frozen = false; } - if (!mFreezeAbort && waitApp()) + if (!mFreezeAbort && waitApp(frozen)) { shmLock(); @@ -215,7 +216,7 @@ namespace Crash { handleCrash(true); TerminateProcess(mAppProcessHandle, 0xDEAD); - std::string message = "OpenMW appears to have frozen.\nCrash log saved to '" + std::string message = "OpenMW has frozen.\nCrash dump saved to '" + Misc::StringUtils::u8StringToString(getFreezeDumpPath(*mShm).u8string()) + "'.\nPlease report this to https://gitlab.com/OpenMW/openmw/issues !"; SDL_ShowSimpleMessageBox(0, "Fatal Error", message.c_str(), nullptr); @@ -289,10 +290,10 @@ namespace Crash { std::thread messageBoxThread([&]() { SDL_MessageBoxButtonData button = { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, 0, "Abort" }; - SDL_MessageBoxData messageBoxData = { SDL_MESSAGEBOX_ERROR, nullptr, "OpenMW appears to have frozen", - "OpenMW appears to have frozen. Press Abort to terminate it and generate a crash dump.\nIf OpenMW " - "hasn't actually frozen, this message box will disappear a within a few seconds of it becoming " - "responsive.", + SDL_MessageBoxData messageBoxData = { SDL_MESSAGEBOX_ERROR, nullptr, "OpenMW has frozen", + "OpenMW has frozen. This should never happen. Press Abort to terminate it and generate a crash dump to " + "help diagnose the problem.\nOpenMW may unfreeze if you wait, and this message box will disappear " + "after it becomes responsive.", 1, &button, nullptr }; int buttonId; diff --git a/components/crashcatcher/windows_crashmonitor.hpp b/components/crashcatcher/windows_crashmonitor.hpp index 16e173169e..25ee710fd3 100644 --- a/components/crashcatcher/windows_crashmonitor.hpp +++ b/components/crashcatcher/windows_crashmonitor.hpp @@ -41,7 +41,7 @@ namespace Crash void signalApp() const; - bool waitApp() const; + bool waitApp(bool thawMode) const; bool isAppAlive() const;