Bug 208

Summary: [matchbox] X window fails to start up with matchbox-panel/desktop segfault
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Jiajun Xu <jiajun.xu>
Component: meta-yoctoAssignee: Nitin Kamble <nitin.a.kamble>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: High CC: edwin.zhai, kevin.tian, poky.bs.watcher, poky.watcher, richard.purdie, sgw, susie.li
Version: 0.9   
Target Milestone: 0.9 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Program Management Documentation change: ---

Description Jiajun Xu 2010-08-13 07:22:46 UTC
Testing Env:    
Hardware: All
Images from weekly build (20100812) on autobuilder,
http://autobuilder.pokylinux.org/nightly/20100812-1.
poky commit info: 69ac39b90eec55831a9b601913a089838307b200 from poky master
tree

With latest weekly build, X window fails to start up with matchbox-panel/desktop segfault.

########
EXT3-fs (hda): warning: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT3-fs (hda): using internal journal
matchbox-panel[2479]: segfault at bf594ffc ip b6f30fd7 sp bf595000 error 6 in libstdc++.so.6.0.14[b6edc000+dd000]
matchbox-deskto[2478]: segfault at bf091ff0 ip b7009fd4 sp bf091ff0 error 6 in libstdc++.so.6.0.14[b6fb5000+dd000]
nm-applet[2416]: segfault at 0 ip b72b5849 sp bfc0fe30 error 4 in libglib-2.0.so.0.2400.1[b7290000+c1000]
########
Comment 1 Jiajun Xu 2010-08-16 19:54:51 UTC
Some update, I met the issue only with x86 image(qemux86, netbook, e-Menlow).
Comment 2 Edwin Zhai 2010-08-16 20:07:56 UTC
(In reply to comment #1)
> Some update, I met the issue only with x86 image(qemux86, netbook, e-Menlow).

Jiajun,
Do you mean qemuarm is okay?
Comment 3 Jiajun Xu 2010-08-16 20:10:47 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Some update, I met the issue only with x86 image(qemux86, netbook, e-Menlow).
> Jiajun,
> Do you mean qemuarm is okay?

Sorry, I make confusion here. qemuarm cannot boot up because of bug 212. Only qemumips can boot up with X window.(qemuppc has no graphics enabled.)
Comment 4 Richard Purdie 2010-08-17 02:38:07 UTC
I can confirm this is happening with recent builds from master too. Whats odd is that matchbox-desktop doesn't use C++ and shouldn't be linking to libstdc++...
Comment 5 Richard Purdie 2010-08-17 03:23:40 UTC
I did a quick check on the image and somehow, libstdc++ is being pulled in for gtk+ and others. We should not need libstdc++ for the graphics stack.

Grepping the target sysroot's .la files I see the following including libstdc++:
libavahi-ui.la
libdataserverui-12.la
libfm-gtk.la
libgcr.la
libglade-2.0.la
libowl.la
libpangocairo-1.0.la
librsvg-2.la
libvte.la

At a guess gtk+ is getting this from pangocairo which is getting it from rsvg? Regardless, we need to track down where this is coming from and fix it.
Comment 6 Richard Purdie 2010-08-17 03:40:44 UTC
Its not rsvg, smoking gun seems to point at pango. I'll leave this here for now but we need to figure out why pango is pulling in libstdc++...
Comment 7 Nitin Kamble 2010-08-17 10:11:22 UTC
Thanks to Edwin for providing this information:

Nitin,
After long time of fighting, I could finally reproduce this bug.  
Actually, the X server can start, and even some X apps like matchbox-terminal can works. The issues comes from other applications like contacts, tasks, which lead a segmentation fault in libstdc++.so.6. 
So the matchbox fail in initialization when trying load these applications.

I traced the segmentation fault, and found it comes from math_stubs_float.cc (@build/tmp/work/i586-poky-linux/gcc-runtime-4.5.0-r4/gcc-4.5.0/libstdc++-v3/src).

#ifndef _GLIBCXX_HAVE_FLOORF
  float
  floorf(float x)
  {
    return (float) floor(x);                 <<<======== This cause 
segmentation fault
  }
#endif

floor seems come from compatibility.cc
#ifdef _GLIBCXX_HAVE_FLOORL
_GLIBCXX_MATHL_WRAPPER1 (floor, GLIBCXX_3.4.3); #endif

I suspect some compatibility issue here to lead segmentation fault. Do you have any clues for it, regarding your update of gcc? Maybe you can continue my work, so we can fight in a 7x24 style to fix this high priority bug:)

Thanks,
edwin
Comment 8 Nitin Kamble 2010-08-17 10:12:31 UTC
Thanks to Richard for providing this information:

Just to follow up and keep email in sync with jabber, I've seen this problem before. If you look at the gcc-runtime build in a recent poky build in the file gcc*/build*/libstdc++/config.log, you will see "unrecognised option '-nostdlib++".

We patch gcc to add in this option with this patch in the 4.3.3 case:

http://git.pokylinux.org/cgit.cgi/poky/commit/?id=bb3e4dda5d85402fadcecc97589ea4e452c36c98

So I'm guessing its missing from 4.5.0 and if we add it, it will fix things.

Cheers,

Richard
Comment 9 Nitin Kamble 2010-08-17 14:55:54 UTC
http://git.pokylinux.org/cgit.cgi/poky/commit/?id=94f63fa5642f70d993efa0428f46851a2cddc213
This commit fixes this bug.
Comment 10 Edwin Zhai 2010-08-17 23:54:47 UTC
Have tested it. The bug fixed @ Nitin's changeset when build from scratch.
BTW, if only re-compile gcc-run and use new libstdc++.so, can't help. I doubt need re-compile some intermediate lib.
Comment 11 Nitin Kamble 2010-08-18 09:56:21 UTC
That is Right, this needs build from scratch. Just upgrading gcc does not change packages which are already built with previous gcc. 

Thanks,
Nitin
Comment 12 Jiajun Xu 2010-08-23 22:40:59 UTC
The issue with libstdc++ is fixed. Verified with 20100818 image.