Skip to content

Commit 84eb0de

Browse files
committed
fix(util): folly::exceptionStr() segfaults for exception_ptr on arm32
1 parent 0e6e327 commit 84eb0de

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/util.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,20 @@ std::string exception_str(std::exception const& e) {
407407
}
408408

409409
std::string exception_str(std::exception_ptr const& e) {
410+
#if defined(__linux__) && defined(__arm__)
411+
try {
412+
if (e) {
413+
std::rethrow_exception(e);
414+
}
415+
} catch (std::exception const& ex) {
416+
return folly::exceptionStr(ex).toStdString();
417+
} catch (...) {
418+
return "unknown exception";
419+
}
420+
return "no exception";
421+
#else
410422
return folly::exceptionStr(e).toStdString();
423+
#endif
411424
}
412425

413426
unsigned int hardware_concurrency() noexcept {

0 commit comments

Comments
 (0)