Skip to content

Commit 5efc073

Browse files
committed
#4320 MacOS crash handling
1 parent f5d350f commit 5efc073

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

indra/llcommon/workqueue.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,22 @@ void LL::WorkQueueBase::callWork(const Work& work)
182182
}
183183
catch (...)
184184
{
185-
// Stash any other kind of uncaught exception to be rethrown by main thread.
186-
LL_WARNS("LLCoros") << "Capturing and rethrowing uncaught exception in WorkQueueBase "
185+
if (getKey() != "mainloop")
186+
{
187+
// Stash any other kind of uncaught exception to be rethrown by main thread.
188+
LL_WARNS("LLCoros") << "Capturing and rethrowing uncaught exception in WorkQueueBase "
187189
<< getKey() << LL_ENDL;
188-
189-
LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop");
190-
main_queue->post(
191-
// Bind the current exception, rethrow it in main loop.
192-
[exc = std::current_exception()]() { std::rethrow_exception(exc); });
190+
191+
LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop");
192+
main_queue->post(
193+
// Bind the current exception, rethrow it in main loop.
194+
[exc = std::current_exception()]() { std::rethrow_exception(exc); });
195+
}
196+
else
197+
{
198+
// let main loop crash
199+
throw;
200+
}
193201
}
194202
#endif // else LL_WINDOWS
195203
}

indra/newview/llappviewer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5696,7 +5696,8 @@ void LLAppViewer::forceExceptionThreadCrash()
56965696

56975697
void run()
56985698
{
5699-
throw std::exception();
5699+
const std::string exception_text = "This is a deliberate exception in a thread";
5700+
throw std::runtime_error(exception_text);
57005701
}
57015702
};
57025703

0 commit comments

Comments
 (0)