summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-02-26 19:11:57 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-02-26 21:50:46 +0200
commit39610cbfb381eec0b144f22cd1b34a4ff6911322 (patch)
tree26542c630387e5e8b96817c5e5d40ba6fca46798
parent454d5b48715772889db12d142486e75a3a4dfed3 (diff)
#3591 Remove now pointless rethrow
-rw-r--r--indra/llcommon/llcoros.cpp36
-rw-r--r--indra/llcommon/llcoros.h27
-rw-r--r--indra/newview/llappviewer.cpp2
3 files changed, 9 insertions, 56 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
index ab56a3d3b7..b16f166d28 100644
--- a/indra/llcommon/llcoros.cpp
+++ b/indra/llcommon/llcoros.cpp
@@ -228,22 +228,6 @@ std::string LLCoros::logname()
return data.mName.empty()? data.getKey() : data.mName;
}
-void LLCoros::saveException(const std::string& name, std::exception_ptr exc)
-{
- mExceptionQueue.emplace(name, exc);
-}
-
-void LLCoros::rethrow()
-{
- if (! mExceptionQueue.empty())
- {
- ExceptionData front = mExceptionQueue.front();
- mExceptionQueue.pop();
- LL_WARNS("LLCoros") << "Rethrowing exception from coroutine " << front.name << LL_ENDL;
- std::rethrow_exception(front.exception);
- }
-}
-
void LLCoros::setStackSize(S32 stacksize)
{
LL_DEBUGS("LLCoros") << "Setting coroutine stack size to " << stacksize << LL_ENDL;
@@ -312,14 +296,19 @@ static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific
U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS* exception_infop)
{
- if (code == STATUS_MSC_EXCEPTION)
+ if (LLApp::instance()->reportCrashToBugsplat((void*)exception_infop))
+ {
+ // Handled
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+ else if (code == STATUS_MSC_EXCEPTION)
{
// C++ exception, go on
return EXCEPTION_CONTINUE_SEARCH;
}
- else if (!LLApp::instance()->reportCrashToBugsplat((void*)exception_infop))
+ else
{
- // handle it
+ // handle it, convert to std::exception
return EXCEPTION_EXECUTE_HANDLER;
}
@@ -381,14 +370,7 @@ void LLCoros::toplevel(std::string name, callable_t callable)
// viewer will carry on.
LOG_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << name));
}
- catch (...)
- {
- // Stash any OTHER kind of uncaught exception in the rethrow() queue
- // to be rethrown by the main fiber.
- LL_WARNS("LLCoros") << "Capturing uncaught exception in coroutine "
- << name << LL_ENDL;
- LLCoros::instance().saveException(name, std::current_exception());
- }
+ // uncaught exception by default will cause std::terminate()
}
//static
diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h
index c3820ae987..913414fbc1 100644
--- a/indra/llcommon/llcoros.h
+++ b/indra/llcommon/llcoros.h
@@ -171,19 +171,6 @@ public:
static std::string getName();
/**
- * rethrow() is called by the thread's main fiber to propagate an
- * exception from any coroutine into the main fiber, where it can engage
- * the normal unhandled-exception machinery, up to and including crash
- * reporting.
- *
- * LLCoros maintains a queue of otherwise-uncaught exceptions from
- * terminated coroutines. Each call to rethrow() pops the first of those
- * and rethrows it. When the queue is empty (normal case), rethrow() is a
- * no-op.
- */
- void rethrow();
-
- /**
* This variation returns a name suitable for log messages: the explicit
* name for an explicitly-launched coroutine, or "mainN" for the default
* coroutine on a thread.
@@ -327,20 +314,6 @@ private:
void toplevel(std::string name, callable_t callable);
struct CoroData;
static CoroData& get_CoroData(const std::string& caller);
- void saveException(const std::string& name, std::exception_ptr exc);
-
- struct ExceptionData
- {
- ExceptionData(const std::string& nm, std::exception_ptr exc):
- name(nm),
- exception(exc)
- {}
- // name of coroutine that originally threw this exception
- std::string name;
- // the thrown exception
- std::exception_ptr exception;
- };
- std::queue<ExceptionData> mExceptionQueue;
S32 mStackSize;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 973cdd53a0..689f21d29f 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1406,8 +1406,6 @@ bool LLAppViewer::doFrame()
LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df suspend");
// give listeners a chance to run
llcoro::suspend();
- // if one of our coroutines threw an uncaught exception, rethrow it now
- LLCoros::instance().rethrow();
}
}