pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41984?usp=email )
Change subject: Fix 'logging: Avoid infinite loop logging inside logging path' ......................................................................
Fix 'logging: Avoid infinite loop logging inside logging path'
I didn't see the early return of log_cache_check(), which should leave the logging_active variable as true forever.
Fixes: bc400626b28c85fe0f52ce25947a90650b0d06b5 Change-Id: I13ed182688597c7da279a50bf057eff6d13f0867 --- M src/core/logging.c 1 file changed, 7 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/41984/1
diff --git a/src/core/logging.c b/src/core/logging.c index 3e60597..60634af 100644 --- a/src/core/logging.c +++ b/src/core/logging.c @@ -743,14 +743,6 @@ { struct log_target *tar;
- if (OSMO_UNLIKELY(log_thread_state.logging_active)) { - /* Avoid re-entrant logging: If logging to log target generates - * extra logging (eg. an error log line due to some wqueue being full), - * we may end up in an infinite loop. */ - return; - } - log_thread_state.logging_active = true; - subsys = map_subsys(subsys);
#if !defined(EMBEDDED) @@ -758,6 +750,13 @@ return; #endif
+ if (OSMO_UNLIKELY(log_thread_state.logging_active)) { + /* Avoid re-entrant logging: If logging to log target generates + * extra logging (eg. an error log line due to some wqueue being full), + * we may end up in an infinite loop. */ + return; + } + log_thread_state.logging_active = true; log_tgt_mutex_lock();
llist_for_each_entry(tar, &osmo_log_target_list, entry) {