Bug 1922

Summary: [LTP] 'ldd' case failed on all platforms with Yocto 1.2 M2 rc1
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Yi Zhao <yi.zhao>
Component: devtools / tool chainAssignee: Jiajun Xu <jiajun.xu>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jiajun.xu, liang.li2, meta.mr.watcher, meta.watcher, nitin.a.kamble, sgw, yi.zhao, yp.kernel.watcher, yp.watcher
Version: 1.2   
Target Milestone: 1.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Yi Zhao 2012-01-18 23:37:24 UTC
Tree/branch: poky/1.2_M2
Commit: 0f4d99d207b224bb9ce23de00a48f795ae20b3a0
Image location:
http://autobuilder.pokylinux.org/nightly/20120111-3/machines/

LTP version: 20110915

'ldd' case failed on all platforms. The error message is like below:
############
/usr/lib/gcc/arm-poky-linux-gnueabi/4.6.3/../../../crt1.o: In function `_start':
init.c:(.text+0x34): undefined reference to `main'
collect2: ld returned 1 exit status
  ASSERTION 1  
ldd: /tmp/ldd01-16044/a.out: No such file or directory
ASSERTION #1 FAIL
#############


Steps:
######
1. root@beagleboard:~# cd /opt/ltp/testcases/bin/
2. root@beagleboard:/opt/ltp/testcases/bin# ./ldd01 
######
Comment 1 Bruce Ashfield 2012-01-19 05:50:14 UTC
Doesn't look kernel related. Toolchain changes ?
Comment 2 Saul Wold 2012-01-19 09:09:46 UTC
Can you tell me which image exactly your using, some images are for development, please confirm the image name.
Comment 3 Nitin Kamble 2012-01-19 15:41:53 UTC
Does anybody know last when this has worked?
Comment 4 Yi Zhao 2012-01-19 17:38:05 UTC
(In reply to comment #2)
> Can you tell me which image exactly your using, some images are for
> development, please confirm the image name.

It's sato-sdk image. Image location is http://autobuilder.pokylinux.org/nightly/20120111-3/machines/
Comment 5 Yi Zhao 2012-01-19 17:40:50 UTC
(In reply to comment #3)
> Does anybody know last when this has worked?

It works with 1.2_M1. 
Tree/Branch: poky/1.2_M1
Poky Commit: b806f726b1db2cb605869c1022ef727c1110255b
Comment 6 Yi Zhao 2012-01-20 01:02:44 UTC
The ltp is pre-build binary in poky. The recipe is added by Jiajun in /meta/recipes-extended/ltp and included in sato-sdk image. When using it for testing, the 'ldd' case failed.   

When I build the ltp from scratch on the target, the case can pass. 
Steps:
#########
1. Download the ltp testsuite from http://sourceforge.net/projects/ltp/files/LTP%20Source/ltp-20110915/
2. Copy the tarball to the target and decompress it.
3. # cd ltp-full-20110915; ./configure; cd testcases/commands/ade/ldd;  make; ./ldd01
########

The case can pass:
####################
root@beagleboard:~/ltp-full-20110915/testcases/commands/ade/ldd# ./ldd01 
  ASSERTION 1  
        /tmp/ldd01-6429/lddfile1.obj.so (0x40152000)
        /tmp/ldd01-6429/lddfile2.obj.so (0x400c0000)
        /tmp/ldd01-6429/lddfile3.obj.so (0x40020000)
        /tmp/ldd01-6429/lddfile4.obj.so (0x40133000)
        /tmp/ldd01-6429/lddfile5.obj.so (0x40029000)
ASSERTION #1 PASS
 ASSERTION 2  
        /tmp/ldd01-6429/lddfile1.obj.so (0x40116000)
        /tmp/ldd01-6429/lddfile2.obj.so (0x40002000)
        /tmp/ldd01-6429/lddfile3.obj.so (0x40040000)
        /tmp/ldd01-6429/lddfile4.obj.so (0x400ae000)
        /tmp/ldd01-6429/lddfile5.obj.so (0x4005b000)
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
        /tmp/ldd01-6429/lddfile1.obj.so:
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
        /tmp/ldd01-6429/lddfile2.obj.so:
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
        /tmp/ldd01-6429/lddfile3.obj.so:
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
        /tmp/ldd01-6429/lddfile4.obj.so:
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
        /tmp/ldd01-6429/lddfile5.obj.so:
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
                ld-linux.so.3 (GLIBC_2.4) => /lib/ld-linux.so.3
                ld-linux.so.3 (GLIBC_PRIVATE) => /lib/ld-linux.so.3
ASSERTION #2 PASS
TEST PASSES
####################
Comment 7 Nitin Kamble 2012-01-20 08:45:50 UTC
so the issue is with building of ltp in the poky.
Comment 8 Nitin Kamble 2012-01-20 10:30:18 UTC
I find the binaries were getting stripped by our poky packaging code. And that was causing the failure: I disabled stripping of elf binaries for ltp recipe. Now the tests are passing in my local env, and also should pass in the image. 

Can you please test it and update the bugzilla?

Thanks,
Nitin
Comment 9 Jiajun Xu 2012-01-20 17:10:26 UTC
(In reply to comment #8)
> I find the binaries were getting stripped by our poky packaging code. And that
> was causing the failure: I disabled stripping of elf binaries for ltp recipe.
> Now the tests are passing in my local env, and also should pass in the image. 
> Can you please test it and update the bugzilla?
> Thanks,
> Nitin

Hi Nitin,
It's casued by the new ltp recipe introduced into poky. I will take the owner of the bug. Thanks a lot for your comments and try.
Comment 10 Nitin Kamble 2012-01-20 17:11:45 UTC
Jiajun,
  Thanks for jumping in. I think the issue is fixed, just need verification.
Thanks,
Nitin
Comment 11 Jiajun Xu 2012-01-20 19:15:01 UTC
(In reply to comment #10)
> Jiajun,
>   Thanks for jumping in. I think the issue is fixed, just need verification.
> Thanks,
> Nitin

Sorry, Nitin. Yes, the bug is root caused and we could mark the bug as fixed. I will open another new bug since poky will strip all binaries during do_package, which makes LTP cases fail.
Comment 12 Nitin Kamble 2012-01-20 19:17:08 UTC
Oh it's my bad, I did not post the link to the fix:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=nitin/misc

Here is a commit to fix the issue.

Nitin
Comment 14 Nitin Kamble 2012-01-20 19:18:30 UTC
Jiajun,
 Can you help with verification of the fix?

Thanks,
Nitin
Comment 15 Jiajun Xu 2012-01-20 20:01:05 UTC
(In reply to comment #13)
> This is the exact commit:
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=nitin/misc&id=ffc4c2baa9ed5116336b1d5c2d6110f7e4163c27

Really thanks, Nitin. :)
That's what we want. I have tested your patch and it could work.
Comment 16 Nitin Kamble 2012-01-25 14:45:22 UTC
commit 5c6aa87a9124815df768392cde715cbb8ce55104
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date:   Fri Jan 20 10:11:10 2012 -0800

    ltp: disable elf binary stripping
    
    Otherwise the ltp tests ldd01 & nm01 fail due to missing stripped
    information.
    
    This Fixes these bugs:
    [YOCTO #1922]
    [YOCTO #1923]
    
    (From OE-Core rev: 075266fa8bf12719c58a21c75a35fede5608dcdf)
    
    Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 17 Yi Zhao 2012-03-07 02:37:32 UTC
Verified with 1.2 M3 20120229 build

Tree/branch: poky/1.2_M3
Commit: 320558f494c618f53e0c773db3ea0109476e8359
Image location:
http://autobuilder.pokylinux.org/nightly/20120229-1/machines/qemu/qemuppc/

##########
tag=ldd stime=946714334
cmdline="export TCdat=$LTPROOT/testcases/bin; ldd01"
contacts=""
analysis=exit
<<<test_output>>>
  ASSERTION 1
    /tmp/ldd01-21544/lddfile1.obj.so (0x400dc000)
    /tmp/ldd01-21544/lddfile2.obj.so (0x40002000)
    /tmp/ldd01-21544/lddfile3.obj.so (0x400fd000)
    /tmp/ldd01-21544/lddfile4.obj.so (0x40116000)
    /tmp/ldd01-21544/lddfile5.obj.so (0x40040000)
ASSERTION #1 PASS
 ASSERTION 2
    /tmp/ldd01-21544/lddfile1.obj.so (0x4010d000)
    /tmp/ldd01-21544/lddfile2.obj.so (0x4002a000)
    /tmp/ldd01-21544/lddfile3.obj.so (0x40014000)
    /tmp/ldd01-21544/lddfile4.obj.so (0x40193000)
    /tmp/ldd01-21544/lddfile5.obj.so (0x40000000)
        libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
    /tmp/ldd01-21544/lddfile1.obj.so:
        libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
    /tmp/ldd01-21544/lddfile2.obj.so:
        libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
    /tmp/ldd01-21544/lddfile3.obj.so:
        libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
    /tmp/ldd01-21544/lddfile4.obj.so:
        libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
    /tmp/ldd01-21544/lddfile5.obj.so:
        libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
        ld-linux.so.3 (GLIBC_2.4) => /lib/ld-linux.so.3
        ld-linux.so.3 (GLIBC_PRIVATE) => /lib/ld-linux.so.3
ASSERTION #2 PASS
TEST PASSES
############