pespin has submitted this change. ( 
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(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




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) {

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41984?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I13ed182688597c7da279a50bf057eff6d13f0867
Gerrit-Change-Number: 41984
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to