From e62bdc06801e43a9b06a36478758c72d7be66bcf Mon Sep 17 00:00:00 2001 From: Derek Bruening Date: Mon, 16 Apr 2018 15:58:18 -0400 Subject: [PATCH] i#2934: fix module re-walk lock order when logging (#2935) Fixes a regression from #2037 8471d5cc where the module re-walk hits a deadlock lock order violation if logging is enabled. Fixes #2934 --- core/unix/os.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/unix/os.c b/core/unix/os.c index 1661a39c910..f21280f37f7 100644 --- a/core/unix/os.c +++ b/core/unix/os.c @@ -9219,7 +9219,10 @@ os_walk_address_space(memquery_iter_t *iter, bool add_modules) /* now that we've walked memory print all modules */ LOG(GLOBAL, LOG_VMAREAS, 2, "Module list after memory walk\n"); - DOLOG(1, LOG_VMAREAS, { print_modules(GLOBAL, DUMP_NOT_XML); }); + DOLOG(1, LOG_VMAREAS, { + if (add_modules) + print_modules(GLOBAL, DUMP_NOT_XML); + }); return count; }