<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>6017</bug_id>
          
          <creation_ts>2014-03-20 14:21:11 +0000</creation_ts>
          <short_desc>IMAGE_BASENAME in base image causes causes crash for custom image</short_desc>
          <delta_ts>2014-04-08 07:54:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Hob</product>
          <component>hob</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.6</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Omar Pighi">pighi</reporter>
          <assigned_to name="Marius Avram">marius.avram</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>valentin.popa</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41529</commentid>
    <comment_count>0</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-20 14:21:11 +0000</bug_when>
    <thetext>First of all this is my first bug... so I&apos;m sorry if i do it wrong.

I&apos;m tring to use hob to build the images fsl-image-test with nitrogen6x as machine, i added openssh and fsl-gstreamer-full tothe original configuration then what happen:

it hang in several different ways:

1) sometime during buildidng packets phase there is no more &quot;running&quot; task (green with cirle arrows) but nothing more happen.

2) maybe i rerun, building packets suucceeds then pass to the second phase building image, usually it stuck at 99%.
i think it finished its job (the image is actually present in the deploy/images dir), but nothing more happen (I wopuld like to save this modify image as new image)...

in both cases nothing can stop or close it i have to &quot;kill -9&quot; the process by a shell.



Omar</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41542</commentid>
    <comment_count>1</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-20 15:03:20 +0000</bug_when>
    <thetext>I have some more info, maybe they can help.
in the shell from i launced HOB, i have several (and continuing coming out) of the following errors:

(bitbake:12689): GLib-GObject-CRITICAL **: g_object_set_qdata: assertion `G_IS_OBJECT (object)&apos; failed

(bitbake:12689): GLib-GObject-CRITICAL **: g_object_set_qdata: assertion `G_IS_OBJECT (object)&apos; failed

(bitbake:12689): GLib-GObject-CRITICAL **: g_object_set_qdata: assertion `G_IS_OBJECT (object)&apos; failed


in one case when HOB hang at the end of the build image process the hob windows became all grey and in the shell i had :

Traceback (most recent call last):
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 1031, in handler_build_succeeded_cb
    self.build_succeeded()
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 987, in build_succeeded
    self.switch_page(self.IMAGE_GENERATED)
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 679, in switch_page
    self.image_details_page.show_page(next_step)
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/imagedetailspage.py&quot;, line 312, in show_page
    vallist.append(image_name.split(&apos;.&apos;)[0])
UnboundLocalError: local variable &apos;image_name&apos; referenced before assignment


hope this is helpfull.

Thanks
Omar</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41550</commentid>
    <comment_count>2</comment_count>
    <who name="Marius Avram">marius.avram</who>
    <bug_when>2014-03-20 16:34:56 +0000</bug_when>
    <thetext>Do you have the same problem with other images and machines ? 

Did you tried to build on a clean build directory ? It&apos;s important to know you don&apos;t have this problem because you have done some manual configuration of the configuration file. In case you did please add info with them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41560</commentid>
    <comment_count>3</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-21 08:43:58 +0000</bug_when>
    <thetext>I tried from a clean directory. no change in the config files (just tried some bitbake from command line).

I have some more info:
no when i launch a build of an image it never hangs until the end. i don&apos;t really know the reason, but sometimes it is very very very slow , so it is just matter of wait....
But the errors that i have signaled at the end remain so it stuck with a grey windows (with nothing on) and the errors in the shell:

Traceback (most recent call last):
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 1031, in handler_build_succeeded_cb
    self.build_succeeded()
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 987, in build_succeeded
    self.switch_page(self.IMAGE_GENERATED)
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 679, in switch_page
    self.image_details_page.show_page(next_step)
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/imagedetailspage.py&quot;, line 312, in show_page
    vallist.append(image_name.split(&apos;.&apos;)[0])
UnboundLocalError: local variable &apos;image_name&apos; referenced before assignment

and at that point no matter how much i wait but nothing happen any more.

by the way could be good to add also the sdcard file as a selection of the format produced.

Omar</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41562</commentid>
    <comment_count>4</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-21 09:40:04 +0000</bug_when>
    <thetext>I tried with different machine (sabresd) the same:
it stuck at the end with grey windows and the same error. Now i try with different image</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41572</commentid>
    <comment_count>5</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-21 13:31:22 +0000</bug_when>
    <thetext>More results of more tests

the error:
(bitbake:12689): GLib-GObject-CRITICAL **: g_object_set_qdata: assertion `G_IS_OBJECT (object)&apos; failed

disappear after updating gtk package.

(now I have updated everything in my opensuse12.3).

but the other error remain, hob stop just at the end of the image generation (ext3 present and fine), but it stuck with a grey window and the reported error in the shell.

Omar</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41576</commentid>
    <comment_count>6</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-21 14:09:42 +0000</bug_when>
    <thetext>i tried with a different image &quot;core-image-base&quot; with machine=imx6qsabresd. and it doesn&apos;t give the error...
maybe because is smaller then fsl-image-test?
i will try with another image but bigger...

Omar</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41662</commentid>
    <comment_count>7</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-25 07:22:08 +0000</bug_when>
    <thetext>I still have the error &quot;UnboundLocalError: local variable &apos;image_name&apos; referenced before assignment&quot; with some images.... did you find anything?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41714</commentid>
    <comment_count>8</comment_count>
    <who name="Marius Avram">marius.avram</who>
    <bug_when>2014-03-25 16:38:37 +0000</bug_when>
    <thetext>I tested by building a core-image-minimal using the machine imx6qsabresd and it ended successfully. I will try to build one for nitrogen6x next.

I can&apos;t seem to find any machine called simply &apos;sabresd&apos; in the layer meta-fsl-arm or meta-fsl-arm-extra. I suppose this are the layers you used in your case. I can&apos;t find &apos;fsl-image-test&apos; either. There is an image called &apos;fsl-image-mfgtool-initramfs&apos; though. Is this the one you used ?

Also what is the latest commit of your local poky git repository ? For example in my case I tested using 41ed4123a687f77a2042cf50d89652639075f869 . Additional information which might prove useful is the latest commit of the local layer clones (e.g. meta-fsl-arm).

Maybe this problem is related only to images defined in the used layers ?

Do you get the crash during the building process for the image (&quot;Building image...&quot; on screen), on the final screen (&quot;Image details&quot; on screen) or when you try to deploy the image ? From what you said until now it seems to be the first, but I need your confirmation.

The GLib-GObject-CRITICAL are not relevant for the bug as they usually do not influence the building process in any way. Also in case there is no error in the terminal the building process is running. You might not see the processing circles because they are not always at the bottom of the list on the &quot;Building packages...&quot; page. And they seem to take forever because some packages take a lot of time to build (depends on your computer specifications). 

From what I notice it seems to be blocked at 99% because it&apos;s trying to fetch some kernel code from git://git.freescale.com/imx/linux-2.6-imx.git;branch=master which is big and it works really slow (at least on my connection).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41736</commentid>
    <comment_count>9</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-26 07:50:50 +0000</bug_when>
    <thetext>I&apos;m sorry the MACHINE is imx6qsabresd and also imx6qsabrelite, both do the same error with fsl-image-test (this image is in meta-fsl-demos).
And the problem come out only in some images i&apos;m testing differnet fsl-image-..... (all present in meta-fsl-demos), and all o them has the problem.
Other images such as core-image-.... didn&apos;t.
the hang is just at the end of the building image process, infact reading the output in the consolle:

Traceback (most recent call last):
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 1031, in handler_build_succeeded_cb
    self.build_succeeded()
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 987, in build_succeeded
    self.switch_page(self.IMAGE_GENERATED)
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/builder.py&quot;, line 679, in switch_page
    self.image_details_page.show_page(next_step)
  File &quot;/home/yocto/IMX6_yocto/fsl-community-bsp/sources/poky/bitbake/lib/bb/ui/crumbs/imagedetailspage.py&quot;, line 312, in show_page
    vallist.append(image_name.split(&apos;.&apos;)[0])
UnboundLocalError: local variable &apos;image_name&apos; referenced before assignment


you can see that the error is at the &quot;building succeeded&quot; phase. -&gt; switch_page-&gt; show_page here there is the problem about image_name...

Today I will add some detailed debug to the show_page in builder.py, to understand what is going wrong... I will be bak to you with some new info (i hope)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41783</commentid>
    <comment_count>10</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-26 17:08:26 +0000</bug_when>
    <thetext>it seems that this is void:

image_names = self.builder.parameters.image_names

in &quot;imagedetailspage.py&quot;, in show_page

buth only for those images fsl-image-test ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41785</commentid>
    <comment_count>11</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-26 17:17:52 +0000</bug_when>
    <thetext>and i void probably because here in the bulider.py (line 980)

in the 

def build_succeeded(self):



...

                for real_image_type in real_types:
                    linkpath = self.parameters.image_addr + &apos;/&apos; + linkname + &apos;.&apos; + real_image_type
                    if os.path.exists(linkpath):
                        self.parameters.image_names.append(os.readlink(linkpath))

...
something is missing so nothing is appended to self.parameters.image_names</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41786</commentid>
    <comment_count>12</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-26 17:20:48 +0000</bug_when>
    <thetext>linkpath wrong for some reasons... i will add a print there...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41817</commentid>
    <comment_count>13</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-27 09:57:27 +0000</bug_when>
    <thetext>Ok I find it, when it creates linkpath and check if it exist the linkpath become (as example):

build/tmp/deploy/images/imx6qsabrelite/fsl-image-test-edited-20140327-101110-imx6qsabrelite.ext3

but in that direcotory is not present such file but :
build/tmp/deploy/images/imx6qsabrelite/fsl-image-test-imx6qsabrelite-20140327091107.rootfs.ext3

Instead if i try to build the core-image-base (it end succesfully) the
build/tmp/deploy/images/imx6qsabrelite/core-image-base-edited-20140327-104712-imx6qsabrelite.ext3

exists so everything goes fine.
so it is something misconfigured in the fsl-image-test....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41821</commentid>
    <comment_count>14</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-27 10:40:17 +0000</bug_when>
    <thetext>goin back I can say that in the 

build/tmp/work/imx6qsabrelite-poky-linux-gnueabi/
directory the name for the image is correct:
fsl-image-test-edited-20140327-111710

so the problem come out when the created images are copied to the deploy directory...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41850</commentid>
    <comment_count>15</comment_count>
    <who name="Marius Avram">marius.avram</who>
    <bug_when>2014-03-27 14:45:25 +0000</bug_when>
    <thetext>I managed to reproduce it so I&apos;ll come with a solution as soon as possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41853</commentid>
    <comment_count>16</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-27 14:53:50 +0000</bug_when>
    <thetext>I&apos;m working to it me too. if I have news i will report them to you.
thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41865</commentid>
    <comment_count>17</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-27 15:37:41 +0000</bug_when>
    <thetext>could be related to:

SDCARD_ROOTFS ?= &quot;${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3&quot;

present in the imx-base.inc file?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41868</commentid>
    <comment_count>18</comment_count>
    <who name="Omar Pighi">pighi</who>
    <bug_when>2014-03-27 16:02:39 +0000</bug_when>
    <thetext>I think here in builder.py line 980

                for real_image_type in real_types:
                    linkpath = self.parameters.image_addr + &apos;/&apos; + linkname + &apos;.&apos; + real_image_type
                    if os.path.exists(linkpath):
                        self.parameters.image_names.append(os.readlink(linkpath))

the case with &quot;.rootfs.&quot; in the name is missing... so it is not appended anithing to image_names.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42023</commentid>
    <comment_count>19</comment_count>
    <who name="Marius Avram">marius.avram</who>
    <bug_when>2014-04-01 11:00:06 +0000</bug_when>
    <thetext>After investigating the problem it looks like there is a problem when you are trying do a custom image from a image recipe which has the variable IMAGE_BASENAME defined in it, with a different value from the default.

When a custom image is created hob will usually try to create a image name called &lt;original_name&gt;-edited-timestamp-&lt;original_machine&gt;.rootfs.* but IMAGE_BASENAME will usually overload this functionality and will cause this crash. 

I found a solution to this problem by overwriting IMAGE_BASENAME in the custom image recipe to its default value, which is ${PN}. I will send a patch with it and it should be merged soon.

Here is a temporary branch: http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=mavram/B6017&amp;id=be355f41b6a847a2b8b5b014332ac259b0da5b29</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>