Patchwork [bitbake-devel] bitbake: hob/builder: Hob crashes because of bad init

login
register
mail settings
Submitter Cristian Iorga
Date Oct. 25, 2012, 3:37 p.m.
Message ID <1351179450-17508-1-git-send-email-cristian.iorga@intel.com>
Download mbox | patch
Permalink /patch/38573/
State New
Headers show

Comments

Cristian Iorga - Oct. 25, 2012, 3:37 p.m.
Image selection is not properly initialized to none,
and it used before having a chance to have a value.
Due to dynamic nature of Python, variable is used before
it exists, in this case. This causes a crash.
Bug introduced during the fix of [YOCTO #3228]

Fixes [YOCTO #3334]

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |    1 +
 1 file changed, 1 insertion(+)
Richard Purdie - Oct. 27, 2012, 8:56 a.m.
On Thu, 2012-10-25 at 18:37 +0300, Cristian Iorga wrote:
> Image selection is not properly initialized to none,
> and it used before having a chance to have a value.
> Due to dynamic nature of Python, variable is used before
> it exists, in this case. This causes a crash.
> Bug introduced during the fix of [YOCTO #3228]
> 
> Fixes [YOCTO #3334]
> 
> Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
> ---
>  bitbake/lib/bb/ui/crumbs/builder.py |    1 +
>  1 file changed, 1 insertion(+)

Merged to master, thanks.

Richard

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 2fc4a29..3c3d303 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -89,6 +89,7 @@  class Configuration:
 
     def __init__(self):
         self.curr_mach = ""
+        self.selected_image = None
         # settings
         self.curr_distro = ""
         self.dldir = self.sstatedir = self.sstatemirror = ""