<?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>9761</bug_id>
          
          <creation_ts>2016-06-13 07:04:23 +0000</creation_ts>
          <short_desc>Failed to  extract rootfs by using runqemu-extract-sdk</short_desc>
          <delta_ts>2016-08-03 02:04:07 +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>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</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>2.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yi Zhao">yi.zhao</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>jose.perez.carranza</cc>
    
    <cc>ke.zou</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>seebs</cc>
    
    <cc>yi.zhao</cc>
          
          <qa_contact name="Yi Zhao">yi.zhao</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62912</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2016-06-13 07:04:23 +0000</bug_when>
    <thetext>Git rev: master/6c5d7f1fb276cbe0a461ece6c8f0ca17a478fa8c
Image location: https://autobuilder.yoctoproject.org/pub/nightly/20160605-1/

Steps:
1. Download kernel, rootfs tarball and toolchain from https://autobuilder.yoctoproject.org/pub/nightly/20160605-1/

2. Install toolchain and set the environment:

$ ./poky-glibc-x86_64-core-image-sato-armv5e-toolchain-2.1+snapshot.sh 
Poky (Yocto Project Reference Distro) SDK installer version 2.1+snapshot
========================================================================
Enter target directory for SDK (default: /opt/poky/2.1+snapshot): 
You are about to install the SDK to &quot;/opt/poky/2.1+snapshot&quot;. Proceed[Y/n]? 
Extracting SDK.........................................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
 $ . /opt/poky/2.1+snapshot/environment-setup-armv5e-poky-linux-gnueabi
$ . /opt/poky/2.1+snapshot/environment-setup-armv5e-poky-linux-gnueabi
$ which runqemu-extract-sdk 
/opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/runqemu-extract-sdk

3.  Extract the rootfs tarball:

$ runqemu-extract-sdk core-image-sato-sdk-qemuarm-20160605225219.rootfs.tar.bz2 rootfs
Creating directory /home/build/rootfs
Extracting rootfs tarball using pseudo...
/opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/pseudo -P /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr tar -C &quot;/home/build/rootfs&quot; --numeric-owner -xjf &quot;core-image-sato-sdk-qemuarm-20160605225219.rootfs.tar.bz2&quot;
tar: relocation error: /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/pseudo/lib64/../../../../lib/libpthread.so.0: symbol __libc_vfork, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
Warning: I don&apos;t see many files in /home/build/rootfs
Please double-check the extraction worked as intended

This issue happens on all hosts ( Ubuntu 14.04 x86_64, openSUSE x86_64 and Debian 8 i686)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63027</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-06-16 14:01:21 +0000</bug_when>
    <thetext>my findings so far:

1. It can be easily reproduced by running pseudo:
$ /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/pseudo -P /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr
/bin/bash: relocation error: /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/pseudo/lib64/../../../../lib/libpthread.so.0: symbol __libc_vfork, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

2. __libc_vfork exists in libc from the toolchain:
$ objdump -T /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/pseudo/lib64/../../../../lib/libc.so.6 | grep __libc_vfork
00000000000b7a70 g    DF .text  000000000000004b  GLIBC_PRIVATE __libc_vfork

3. __libc_vfork doesn&apos;t exist in the host libc:
$ objdump -T /lib64/libc.so.6 | grep __libc_vfork</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63039</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-06-16 15:10:46 +0000</bug_when>
    <thetext>There is a mismatch in linux loader versions:

$ ldd /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/pseudo
        linux-vdso.so.1 (0x00007ffd6aff8000)
        libpthread.so.0 =&gt; /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/../../lib/libpthread.so.0 (0x00007f9804fe7000)
        libdl.so.2 =&gt; /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/../../lib/libdl.so.2 (0x00007f9804de2000)
        libc.so.6 =&gt; /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/../../lib/libc.so.6 (0x00007f9804a40000)
        /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 =&gt; /lib64/ld-linux-x86-64.so.2 (0x00007f9805206000)

$ readlink /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2
ld-2.23.90.so

$ readlink /lib64/ld-linux-x86-64.so.2
ld-2.19.so

What i don&apos;t understand is why toolchain loader refers to the host one:
/opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 =&gt; /lib64/ld-linux-x86-64.so.2 (0x00007f9805206000)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63098</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-06-17 14:02:45 +0000</bug_when>
    <thetext>The problem here is there are two libc versions involved, the one in the SDK which is newer and the host system libc which is older. When you run something like &quot;pseudo bash&quot;, its loading both versions of libc and they have conflicting symbols, for example vfork() is an IFUNC in recent libc. This is where the mismatched syymbols come from. Ed found the problem was introduced by:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=01cbd46ac5b215bd8b8b1378881ef0bdf61ba177

which adds LDFLAGS. These include rpath entries in the nativesdk case. If we run &quot;chrpath -d libpseudo.so&quot; and remove the RPATH entry things then work as expected since it no longer finds two different libcs.

This is likely the best solution for now. The rpath entries are old and may not be needed with our modern libc/libdl approach so we could look at removing them as a future optimisation in M2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63099</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-06-17 14:05:43 +0000</bug_when>
    <thetext>Adding seebs so he&apos;s at least aware of the issues you can run into with pseudo here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63100</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-06-17 15:19:51 +0000</bug_when>
    <thetext>Sent patch for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-June/122971.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63138</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-06-20 08:50:50 +0000</bug_when>
    <thetext>The fix has been merged into poky master: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8f7f8f7cfa80dc2e1af721388946a28cfdaca1dc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64823</commentid>
    <comment_count>7</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2016-08-03 02:04:07 +0000</bug_when>
    <thetext>Verified with 2.2 M2 rc1 build
git rev: master/36feb38045b7a2af86ece147fec54b0db3bf491f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>