aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-07-29 17:03:21 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-07-30 22:51:56 +0000
commit5b761d0186c102c655ede0c7f400ac71c1a5de5f (patch)
treec3a1f4f722b848c3c501a0950640d8015c1910f1
parentepee: guard against exceptions in RPC handlers (diff)
downloadmonero-5b761d0186c102c655ede0c7f400ac71c1a5de5f.tar.xz
easylogging++: fix crash with reentrant logging
-rw-r--r--external/easylogging++/easylogging++.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/external/easylogging++/easylogging++.cc b/external/easylogging++/easylogging++.cc
index 0d748c225..bf877c018 100644
--- a/external/easylogging++/easylogging++.cc
+++ b/external/easylogging++/easylogging++.cc
@@ -2968,6 +2968,16 @@ void Writer::initializeLogger(Logger *logger, bool needLock) {
}
void Writer::processDispatch() {
+ static std::atomic_flag in_dispatch;
+ if (in_dispatch.test_and_set())
+ {
+ if (m_proceed && m_logger != NULL)
+ {
+ m_logger->stream().str(ELPP_LITERAL(""));
+ m_logger->releaseLock();
+ }
+ return;
+ }
#if ELPP_LOGGING_ENABLED
if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) {
bool firstDispatched = false;
@@ -3006,6 +3016,7 @@ void Writer::processDispatch() {
m_logger->releaseLock();
}
#endif // ELPP_LOGGING_ENABLED
+ in_dispatch.clear();
}
void Writer::triggerDispatch(void) {