Bug 526 - LD_PRELOAD missing libpseudo.so
Summary: LD_PRELOAD missing libpseudo.so
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 1.0
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.0 M3
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 507
  Show dependency tree
 
Reported: 2010-11-09 11:07 UTC by Gary Thomas
Modified: 2011-11-02 06:36 UTC (History)
10 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Thomas 2010-11-09 11:07:34 UTC
Using master d9ff2f897aa271e6b2d7e4dcaf8b8d19de513b50

If you build a completely new tree with SSTATE_MIRRORS set to a valid staging tree, most of the initial steps produce this error:

ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded: ignored.

I think this is because the LD_PRELOAD variable is always present, pointing into the sysroots tree, even before that tree has been created.  From meta/conf/meta.conf:
  LD_PRELOAD=libpseudo.so LD_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE}/pseudo/lib64:${STAGING_LIBDIR_NATIVE}/pseudo/lib

This is trivial to reproduce.  Just build a tree from scratch, without using SSTATE_MIRRORS.  Then build another, again from scratch, with SSTATE_MIRRORS pointing to the sstate-cache tree produced by the first build.  The preload 
error will occur as early as step 2.

Meta-template to reproduce:
  % cd <<POKY-SRC-TREE>>
  % mkdir <<BUILD-TREE1>>
  % . poky-init-build-env <<BUILD-TREE1>>
  -- Adjust conf/local.conf, etc, as necessary
  % bitbake poky-image-minimal

When this finishes
  % cd <<POKY-SRC-TREE>>
  % mkdir <<BUILD-TREE2>>
  % . poky-init-build-env <<BUILD-TREE2>>
  -- Adjust conf/local.conf, etc, as necessary
  -- Set SSTATE_MIRRORS to point to <<BUILD-TREE1>>/sstate-cache/
  % bitbake poky-image-minimal
Comment 1 Paul Eggleton 2010-12-15 07:48:27 UTC
This is still happening, and on my build machine I'm fairly confident it is what's causing the build to fail at a later stage (e.g. building the kernel). I have found if you bitbake pseudo-native explicitly so it is finished as early as possible, then build the image it works fine. I'm guessing when building from sstate with many threads running, a lot more packages get built before pseudo-native because individually they take less time.
Comment 2 Richard Purdie 2010-12-15 08:23:02 UTC
With the planned switch back from exec to fork in bitbake and the need to handle pseudo as a special case, this problem should thankfully go away when that happens.
Comment 3 Richard Purdie 2010-12-20 14:49:57 UTC
This should be fixed in master with the exec() to fork() changes and the new way we call pseudo.
Comment 4 wenhua.fan 2011-10-31 18:52:00 UTC
With commit id 269172... for poky tree, this issue reproduce when building nightly-x86/x86-64/arm/mips/ppc on autobuilder, it cause sanity test failed. 

Part of log as below:

########
| NOTE: Run ssh test in scenario sanity
| /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/scripts/runqemu
| Copying rootfs /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/deploy/images/core-image-sato-qemux86-20111027213425.rootfs.ext3 to /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/qemux86-poky-linux/core-image-sato-1.0-r0/qemuimagetest/tmp/core-image-sato-qemux86-test.ext3
| Running xterm -display localhost:1 -e 'OE_TMPDIR=/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/scripts/runqemu /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/deploy/images/bzImage-qemux86.bin /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/qemux86-poky-linux/core-image-sato-1.0-r0/qemuimagetest/tmp/core-image-sato-qemux86-test.ext3 && /bin/sleep 60' &
| 	Test_Info: There is no Qemu process
| 	Test_Info: Wait for qemu up...
| ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded: ignored.
| 	Test_Info: There is at least one Qemu process running
| 	Test_Info: Begin to check if qemu network is up
| ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded: ignored.
########

Detail information could be found at:

http://autobuilder.yoctoproject.org:8010/builders/nightly-x86/builds/202/steps/shell_20/logs/stdio
or
http://autobuilder.yoctoproject.org:8010/builders/nightly-mips/builds/123/steps/shell_20/logs/stdio
Comment 5 Richard Purdie 2011-11-01 11:38:36 UTC
This message occurs whenever sudo is used since it would be a security issue to honor LD_PRELOAD when raising privileges. Are you 100% sure this is the reason for the sanity test failures?
Comment 6 wenhua.fan 2011-11-01 23:03:21 UTC
Sorry for this operation, I didn't know this issue was caused by security issue. Then I don't very sure this is the reason for the sanity test failures.
Comment 7 Jiajun Xu 2011-11-02 06:36:42 UTC
(In reply to comment #5)
> This message occurs whenever sudo is used since it would be a security issue to
> honor LD_PRELOAD when raising privileges. Are you 100% sure this is the reason
> for the sanity test failures?

Sorry, Richard.
The sanity failure is caused by bug 1699 - connman could not start due to dbus file missing.
Mark the bug to RESOLVED FIXED again due to wrong operation.