summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-10-14 10:48:39 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-08 23:47:14 +0000
commitf0f6acac039e75171b8f4c89eff7d1c2d3ddba5b (patch)
tree198adcbb0561fe97a43230c5aea0d10ad1eb1d12
parentbae35b3e5f3f388027cee30dbfc2df8f5a707aba (diff)
downloadpoky-f0f6acac039e75171b8f4c89eff7d1c2d3ddba5b.tar.gz
bitbake: bb.event: fix infinite loop on print_ui_queue
If bitbake ends before _uiready and bb.event.LogHandler was add to the bitbake logger it causes an infinite loop when logging something. The scenario is print_ui_queue is called at exit and executes the log handlers [2] one of them is bb.event.LogHandler this handler appends the same entry to ui_queue causing the inifine loop [3]. In order to fix a new copy of the ui_queue list is created when iterate ui_queue. [YOCTO #10399] [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=10399#c0 [2] http://git.openembedded.org/bitbake/tree/lib/bb/event.py?id=41d9cd41d40b04746c82b4a940dca47df02514fc#n156 [3] http://git.openembedded.org/bitbake/tree/lib/bb/event.py?id=41d9cd41d40b04746c82b4a940dca47df02514fc#n164 (Bitbake rev: bb56a8957255999b9ffd1408d249cc5b715b5a3a) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/event.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 4b133a7c12..e71a8f27aa 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -125,7 +125,7 @@ def print_ui_queue():
125 125
126 # First check to see if we have any proper messages 126 # First check to see if we have any proper messages
127 msgprint = False 127 msgprint = False
128 for event in ui_queue: 128 for event in ui_queue[:]:
129 if isinstance(event, logging.LogRecord): 129 if isinstance(event, logging.LogRecord):
130 if event.levelno > logging.DEBUG: 130 if event.levelno > logging.DEBUG:
131 if event.levelno >= logging.WARNING: 131 if event.levelno >= logging.WARNING:
@@ -139,7 +139,7 @@ def print_ui_queue():
139 139
140 # Nope, so just print all of the messages we have (including debug messages) 140 # Nope, so just print all of the messages we have (including debug messages)
141 logger.addHandler(stdout) 141 logger.addHandler(stdout)
142 for event in ui_queue: 142 for event in ui_queue[:]:
143 if isinstance(event, logging.LogRecord): 143 if isinstance(event, logging.LogRecord):
144 logger.handle(event) 144 logger.handle(event)
145 145