Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579550 - >=app-emulation/ganeti-2.15.2 fails to build because cannot preload libsandbox.so when sedding man/ganeti-os-interface.html.in
Summary: >=app-emulation/ganeti-2.15.2 fails to build because cannot preload libsandbo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-10 21:16 UTC by Daniel Kuehn (RETIRED)
Modified: 2016-05-25 10:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log ganeti-2.15.2-r4 (file_579550.txt,368.70 KB, text/plain)
2016-04-10 21:16 UTC, Daniel Kuehn (RETIRED)
Details
emerge --info (file_579550.txt,15.42 KB, text/plain)
2016-04-10 21:17 UTC, Daniel Kuehn (RETIRED)
Details
Remove invertor of the last statement in check-man-warnings (file_579550.txt,422 bytes, patch)
2016-05-22 12:54 UTC, Daniel Kuehn (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Kuehn (RETIRED) gentoo-dev 2016-04-10 21:16:54 UTC
Created attachment 430072 [details]
build.log ganeti-2.15.2-r4

I get an error when trying to emerge >=ganeti-2.15.2. It says it cannot preload libsandbox.so but all I've been able to find is that that error message is supposed to be just cosmetic and actually not be an fatal error, but the merge takes it as fatal.

I've tried using FEATURES="-sandbox" and FEATURES="user-sandbox" with same results, it errors out on this step:

trap 'echo auto-removing man/ganeti-os-interface.7.in; rm man/ganeti-os-interface.7.in' EXIT; \
/usr/bin/pandoc -s -f rst -t man man/ganeti-os-interface.gen man/footer.rst | \
  sed -e 's/\\@/@/g' > man/ganeti-os-interface.7.in; \
if test -n "1"; then LC_ALL=en_US.UTF-8 ./autotools/check-man-warnings man/ganeti-os-interface.7.in; fi; \
./autotools/check-man-dashes man/ganeti-os-interface.7.in; \
trap - EXIT
set -o pipefail ; \
/usr/bin/pandoc --toc -s -f rst -t html man/ganeti-os-interface.gen man/footer.rst | \
  sed -e 's/\\@/@/g' > man/ganeti-os-interface.html.in
sed -f autotools/replace_vars.sed < man/ganeti-os-interface.html.in > man/ganeti-os-interface.html
ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
auto-removing man/ganeti-os-interface.7.in

Going into the build folder in /var/tmp/portage and executing that command manually, works like it should.

This is on a hardened system, but grsec RBAC is turned off and it doesn't use SELinux.
Comment 1 Daniel Kuehn (RETIRED) gentoo-dev 2016-04-10 21:17:51 UTC
Created attachment 430074 [details]
emerge --info
Comment 2 Daniel Kuehn (RETIRED) gentoo-dev 2016-04-10 21:21:34 UTC
I got the same error when trying on a vanilla system (I cloned the machine, as its a VM, and migrated it to vanilla gentoo and tried the same thing, with same result)
Comment 3 Patrick McLean gentoo-dev 2016-05-12 23:44:06 UTC
What if you use a sandboxshell to go in to that folder and run that command?

+hardened
I have never seen this on non-hardened, since this is a hardened system, I am going to refer to hardened.
Comment 4 Daniel Kuehn (RETIRED) gentoo-dev 2016-05-20 08:20:32 UTC
Yeah, I've spent a lot of time with Zorry to deep-dive into this issue and it definitively is hardened and sandbox related.

If I do features="-usersandbox" now, I can get it to compile, but this is after adding append-ldflags -Wl,-z,lazy to the sandbox ebuild, as per Zorry's recommendation.

I'm going to test with the sandboxshell and see if I can reproduce it there, probably heck a lot easier to debug that, then the whole emerge process (I tried to strace it, both with -ff and without, with -ff it created ~6k files and without it created a 185k row file...)
Comment 5 Daniel Kuehn (RETIRED) gentoo-dev 2016-05-20 08:35:31 UTC
I just tried with a sandboxshell and got the exact same error, and it is a lot easier to debug this way, so I'll see what I can find out.
Comment 6 Daniel Kuehn (RETIRED) gentoo-dev 2016-05-22 12:54:12 UTC
Created attachment 434958 [details, diff]
Remove invertor of the last statement in check-man-warnings

I managed to zero in to what is the actual cause for tripping this and found that it was a interaction between set -o pipefail -e and autotools/check-man-warnings returning 1 if success, due to the ! at the beginning of the last statement.

I added this as a user patch and tried to compile ganeti, which worked. Will try and ask upstream of what the logic behind this was before, the check-man-warnings script was before a script called check-man that incorporated both check-man-warnings and check-man-dashes.
Comment 7 Patrick McLean gentoo-dev 2016-05-25 04:07:07 UTC
Fixed

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a9df6a22b2fed43184421965c86a2c207841ae4

Thanks for the patch, strange it only seemed to break on hardened
Comment 8 Daniel Kuehn (RETIRED) gentoo-dev 2016-05-25 10:22:19 UTC
Yeah, I couldn't really wrap my head around why it was just hardened it affected, but logically it should affect vanilla too, if you enforce the user sandbox feature, but I didn't check.

An idea that Zorry had was that it is that we enforce the sandbox/usersandbox in hardened and maybe the hardening in the sandbox, from the toolchain, makes it more picky.