[oe-commits] [bitbake] branch 1.32 updated: bb.event: fix infinite loop on print_ui_queue

git at git.openembedded.org git at git.openembedded.org
Sat Oct 15 09:06:33 UTC 2016


rpurdie pushed a commit to branch 1.32
in repository bitbake.

The following commit(s) were added to refs/heads/1.32 by this push:
       new  46fecca   bb.event: fix infinite loop on print_ui_queue
46fecca is described below

commit 46fecca9d531a07788b5cac8b2dc6a8267d8b6d0
Author: Aníbal Limón <anibal.limon at linux.intel.com>
AuthorDate: Fri Oct 14 10:48:39 2016 -0500

    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
    
    Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/event.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bb/event.py b/lib/bb/event.py
index c5a5f94..6f1cb10 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -139,7 +139,7 @@ def print_ui_queue():
 
         # First check to see if we have any proper messages
         msgprint = False
-        for event in ui_queue:
+        for event in ui_queue[:]:
             if isinstance(event, logging.LogRecord):
                 if event.levelno > logging.DEBUG:
                     if event.levelno >= logging.WARNING:
@@ -153,7 +153,7 @@ def print_ui_queue():
 
         # Nope, so just print all of the messages we have (including debug messages)
         logger.addHandler(stdout)
-        for event in ui_queue:
+        for event in ui_queue[:]:
             if isinstance(event, logging.LogRecord):
                 logger.handle(event)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list