Commit 05a686a7 authored by Benjamin Reesman's avatar Benjamin Reesman Committed by Facebook Github Bot

do not crash process by default when ExceptionTracer fails to reflect over cxxabi

Summary: It is possible in certain cirucmstances for the cxxabi reflection code in `ExceptionTracer` to fail to cope with exceptions that we've seen in production and it currently aborts the process in that case. This diff switches this to `DFATAL`/`DCHECK`.

Reviewed By: yfeldblum

Differential Revision: D5431445

fbshipit-source-id: c3d68372c2fadbb518f78fe99e817db611953d22
parent e1fb97e7
...@@ -162,16 +162,25 @@ std::vector<ExceptionInfo> getCurrentExceptions() { ...@@ -162,16 +162,25 @@ std::vector<ExceptionInfo> getCurrentExceptions() {
isAbiCppException(currentException) ? isAbiCppException(currentException) ?
currentException->exceptionType : currentException->exceptionType :
nullptr; nullptr;
if (traceStack) { if (traceStack) {
CHECK(trace) << "Invalid trace stack!"; LOG_IF(DFATAL, !trace)
info.frames.assign(trace->addresses, << "Invalid trace stack for exception of type: "
trace->addresses + trace->frameCount); << (info.type ? folly::demangle(*info.type) : "null");
if (!trace) {
return {};
}
info.frames.assign(
trace->addresses, trace->addresses + trace->frameCount);
trace = traceStack->next(trace); trace = traceStack->next(trace);
} }
currentException = currentException->nextException; currentException = currentException->nextException;
exceptions.push_back(std::move(info)); exceptions.push_back(std::move(info));
} }
CHECK(!trace) << "Invalid trace stack!";
LOG_IF(DFATAL, trace) << "Invalid trace stack!";
return exceptions; return exceptions;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment