fix(util): folly::exceptionStr() segfaults for exception_ptr on arm32

This commit is contained in:
Marcus Holland-Moritz 2025-07-27 23:43:36 +02:00
parent 5027c12f78
commit 64fd359605

View File

@ -394,7 +394,20 @@ std::string exception_str(std::exception const& e) {
} }
std::string exception_str(std::exception_ptr const& e) { std::string exception_str(std::exception_ptr const& e) {
#if defined(__linux__) && defined(__arm__)
try {
if (e) {
std::rethrow_exception(e);
}
} catch (std::exception const& ex) {
return folly::exceptionStr(ex).toStdString();
} catch (...) {
return "unknown exception";
}
return "no exception";
#else
return folly::exceptionStr(e).toStdString(); return folly::exceptionStr(e).toStdString();
#endif
} }
unsigned int hardware_concurrency() noexcept { unsigned int hardware_concurrency() noexcept {