Bug 106

Summary: Some icons broken with qemumips images
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Jiajun Xu <jiajun.xu>
Component: meta-yoctoAssignee: Kevin Tian <kevin.tian>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: david.c.stewart, josh, kevin.tian, poky.bs.watcher, poky.watcher, sgw, yongkang.you
Version: unspecified   
Target Milestone: ---   
Hardware: x86   
OS: mips   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Program Management Documentation change: ---
Attachments:
Description Flags
Some icons broken in qemumips images
none
coredump of ld-2.9.so
none
coredump
none
fix none

Description Jiajun Xu 2010-07-13 05:52:08 UTC
Created attachment 15 [details]
Some icons broken in qemumips images

Testing Env:    
Host: Ubuntu 10.04 LTS
Kernel: 2.6.32-21-generic-pae
Poky gitinfo(used to build qemu-native):
aa416b6133bd55b5ba4d2fb6f5faef274ba511a0 (git.pokylinux.org:poky-wr
+yocto-kernel-clean)
Qemuarm images (both sato & sdk) from M1 build on autobuilder,
http://autobuilder.pokylinux.org/milestone/20100710-1/.

There are some icons broken with qemumips images after X startup. Pls. see attached snapshot.
Comment 1 Richard Purdie 2010-07-13 13:19:42 UTC
When the system boots there is a segmentation fault and also the localedef goes OOM. The segmentation fault is the dbus system message bus failing to start which would account for the icon issues. To reproduce the failure, open a terminal and run:

# /etc/init.d/dbus start
Starting system message bus: Segmentation fault

I've not looked into this further yet.
Comment 2 Kevin Tian 2010-07-13 21:35:42 UTC
Richard, I'm looking at this one now. Saul has assigned it to me.
Comment 3 Kevin Tian 2010-07-13 22:02:36 UTC
some more information available:

the segmentation fault actually happens in /lib/ld.so.1 (_dl_cache_libcmp):

    c144:       00628021        addu    s0,v1,v0
    *c148:       96110000        lhu     s1,0(s0)
    c14c:       8fd90070        lw      t9,112(s8)

the exact faulting IP is 0xc148 and s0 is 0x5755b87e atm which is not a canonical address and triggers the seg fault here.

One interesting thing is that no page fault information from dmesg! 

Still need more time to analyze it. Attach core dump and objdump for ld-2.9.so here
Comment 4 Kevin Tian 2010-07-13 22:04:53 UTC
Created attachment 16 [details]
coredump of ld-2.9.so
Comment 5 Kevin Tian 2010-07-13 22:07:14 UTC
Created attachment 17 [details]
coredump
Comment 6 Richard Purdie 2010-07-14 01:12:40 UTC
The master branch has a much more recent version of dbus in it. It may be worth testing a recent build from master to see if it has the same problems or not.
Comment 7 Kevin Tian 2010-07-14 07:57:34 UTC
I backported dbus-1.2.24. Due to limited time today, I just built dbus itself and copied its output to mips rootfs. However same segfault still happens. I'm inclined to think this is not a direct bug within dbus (perhaps just triggers some other one, or a cross-compile issue), since the error happens in ld.so.1 which is before dbus code gets executed.

Now I'm running a full poky build with wr-branch/dbus-1.2.24 and another build with poky master. Fortunately I can check them tomorrow morning. :/
Comment 8 Richard Purdie 2010-07-14 08:06:52 UTC
I had a fresh build from master and confirmed its present there too :(. For reference anyone wishing to use the WR kernel and master can use the poky-contrib rpurdie/kernel branch
Comment 9 Kevin Tian 2010-07-14 08:17:19 UTC
(In reply to comment #8)
> I had a fresh build from master and confirmed its present there too :(. For
> reference anyone wishing to use the WR kernel and master can use the
> poky-contrib rpurdie/kernel branch

thanks for info. That means I have to trace down the exact reason tomorrow. It's possible that it's a long existing issue which just hasn't been exposed on mips before
Comment 10 Kevin Tian 2010-07-14 23:36:51 UTC
This segfault is actually caused by -fPIE, which has trouble on mips so far. When it's enabled, dbus uses dynamic relocation for executables, and its reloc table however has some issues:

    relocation 154 has invalid symbol index 0
    relocation 155 has invalid symbol index 0

Actually their indexes are invalid (0xffffff03), and it's 0xffffff to cause ld.so.1 finally faulting into segmentation fault.

I tried disabling PIE for dbus, then it just works!

However this is only the last means I want to take as the fix. There's some hint in the web how this may be fixed from mips binutils. I'll give a spin on that.
Comment 11 Kevin Tian 2010-07-15 01:21:29 UTC
Created attachment 18 [details]
fix
Comment 12 Kevin Tian 2010-07-15 01:26:19 UTC
OK, now the reason is root caused, which is actually one bug in binutils which generates bad relocation table for "-fPIE" executables. Backport upstream fix as the attachment.

I don't know which tree I should target (wr's or rp's). Currently I'm testing against RP's tree. So I just attach patch here instead of sending out pull request.

To ensure it doesn't broken other things, I'm doing a full sato rebuild.

BTW, after the fix, the icon theme looks normal now
Comment 13 Richard Purdie 2010-07-15 02:24:38 UTC
I've merged the fix into master so its ready for the test round of testing, thanks.
Comment 14 Kevin Tian 2010-07-15 20:08:25 UTC
(In reply to comment #13)
> I've merged the fix into master so its ready for the test round of testing,
> thanks.

thanks. I also tested in a local fresh build image, the icon issue has gone.
Comment 15 Jiajun Xu 2010-07-27 05:50:50 UTC
Verified with M2 build, http://yoctobuild01.jf.intel.com/milestone/20100725-1/. The issue has gone.