Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492724 - sys-apps/fakeroot: when using FEATURES=fakeroot, build sleeps for ever in src_install()
Summary: sys-apps/fakeroot: when using FEATURES=fakeroot, build sleeps for ever in src...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-27 19:45 UTC by Justin Lecher (RETIRED)
Modified: 2019-10-02 20:53 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2013-11-27 19:45:53 UTC
when running 

FEATURES="fakeroot" ebuild foo-1.2.3.ebuild clean install

the process gets stuck somewhere at the end of src_install.


strace shows this, which goes for ever

--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1180, si_status=0, si_utime=0, si_stime=0} ---
wait4(-1, 0x7fff68431598, WNOHANG, NULL) = -1 ECHILD (No child processes)
rt_sigreturn()                          = 0
rt_sigaction(SIGINT, {0x450030, [], SA_RESTORER, 0x2b29dfb33100}, {0x43a240, [], SA_RESTORER, 0x2b29dfb33100}, 8) = 0
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl(2, F_GETFD)                       = 0
fcntl(2, F_DUPFD, 10)                   = 10
fcntl(2, F_GETFD)                       = 0
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
dup2(3, 2)                              = 2
close(3)                                = 0
kill(27832, SIGTERM)                    = 0
dup2(10, 2)                             = 2
fcntl(10, F_GETFD)                      = 0x1 (flags FD_CLOEXEC)
close(10)                               = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], ~[HUP INT QUIT TRAP KILL USR1 CHLD STOP TSTP VTALRM WINCH SYS RTMIN RT_1 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT TRAP KILL USR1 CHLD STOP TSTP VTALRM WINCH SYS RTMIN RT_1 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], NULL, 8) = 0
stat("/usr/bin/sleep", {st_mode=S_IFREG|0755, st_size=28736, ...}) = 0
stat("/usr/bin/sleep", {st_mode=S_IFREG|0755, st_size=28736, ...}) = 0
geteuid()                               = 2069
getegid()                               = 2069
getuid()                                = 2069
getgid()                                = 2069
access("/usr/bin/sleep", X_OK)          = 0
stat("/usr/bin/sleep", {st_mode=S_IFREG|0755, st_size=28736, ...}) = 0
geteuid()                               = 2069
getegid()                               = 2069
getuid()                                = 2069
getgid()                                = 2069
access("/usr/bin/sleep", R_OK)          = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], ~[HUP INT QUIT TRAP KILL USR1 CHLD STOP TSTP VTALRM WINCH SYS RTMIN RT_1 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2b29df7ee550) = 1181
rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT TRAP KILL USR1 CHLD STOP TSTP VTALRM WINCH SYS RTMIN RT_1 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], ~[HUP INT QUIT TRAP KILL USR1 CHLD STOP TSTP VTALRM WINCH SYS RTMIN RT_1 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT TRAP KILL USR1 CHLD STOP TSTP VTALRM WINCH SYS RTMIN RT_1 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], ~[HUP INT QUIT TRAP KILL USR1 CHLD STOP TSTP VTALRM WINCH SYS RTMIN RT_1 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], 8) = 0
rt_sigaction(SIGINT, {0x43a240, [], SA_RESTORER, 0x2b29dfb33100}, {0x450030, [], SA_RESTORER, 0x2b29dfb33100}, 8) = 0





$ einfo
Portage 2.2.7 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.17, 3.12.0-lh-nvidia x86_64)
=================================================================
System uname: Linux-3.12.0-lh-nvidia-x86_64-Intel-R-_Core-TM-_i7-2600_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16344604 total,   7969844 free
KiB Swap:    3987452 total,   3987452 free
Timestamp of tree: Wed, 27 Nov 2013 19:30:01 +0000
ld GNU gold (GNU Binutils 2.23.2) 1.11
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.6.8-r3, 2.7.5-r4, 3.2.5-r3, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.1-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.12.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.4.7, 4.5.4, 4.6.4, 4.7.3-r1, 4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo sunrise bicatali betagarden dummy Neurogeek science Raspberry-Pi-Overlay last-hope g-ctan x11
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ftracer   -march=native -mtune=native -frecord-gcc-switches -g -Wimplicit-function-declaration"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/systemd/system /usr/share/eselect/ /usr/share/gnupg/qualified.txt /usr/share/nano/ /var/lib/hsqldb /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -ftracer   -march=native -mtune=native -frecord-gcc-switches -g -Wenum-compare"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS=" -vt --keep-going --autounmask-write --autounmask --quiet-build=n"
FCFLAGS="-O2 -pipe -ftracer   -march=native -mtune=native -frecord-gcc-switches -g"
FEATURES="assume-digests binpkg-logs buildsyspkg ccache cgroup collision-protect compressdebug distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news noinfo parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -ftracer   -march=native -mtune=native -frecord-gcc-switches -g"
GENTOO_MIRRORS=" /mnt/tmpfs/ http://gentoo.j-schmitz.net/mirror/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.tu-clausthal.de/pub/linux/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1,--hash-style=gnu,--sort-common"
MAKEOPTS="-j12 -l9"
PKGDIR="/var/cache/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-z -e -9 -v"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--omit-dir-times"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/local/overlays/sunrise-reviewed /local/overlays/bicatali /local/overlays/betagarden /local/overlays/dummy /local/overlays/neurogeek /local/overlays/sci /local/overlays/gen2pi /local/overlays/lh-overlay /local/overlays/g-ctan /local/overlays/x11"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 avx bash-completion berkdb branding bzip2 cairo caps cli cracklib crypt cxx dbus dri fortran gdbm gif gmp gnome gnome-keyring gstreamer gtk iconv icu ipv6 jpeg jpeg2k mmx mmxext modules mudflap multilib ncurses network-cron nls nptl nsplugin numa opengl openmp pam pcre pgo png pulseaudio qt3support raw readline session smp sse sse2 sse2_4way sse2check sse3 sse4 sse41 sse4_1 sse4_2 sse4a ssl ssse3 startup-notification systemd tcpd threads tiff truetype unicode vaapi vdpau xattr xinerama zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="plymouth" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer pdfimport scripting-javascript wiki-publisher nlpsolver" LINGUAS="en" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi stub_status" OFFICE_IMPLEMENTATION="libreoffice" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_6 python2_7 python3_2 python3_3 pypy2_0" QEMU_SOFTMMU_TARGETS="i386 x86_64 arm armeb" QEMU_USER_TARGETS="i386 x86_64 arm armeb" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.6 2.7 3.2 3.3 2.7-pypy-2.0"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2013-11-27 19:49:47 UTC
A SIGTERM is not enough for the process to end. It needs a SIGKILL.

And second this started to happen when switching to systemd.
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2013-11-27 19:52:18 UTC
And when killing the fakeroot process it leaves the faked process behind. It look like the faked process is also not under the same process tree
Comment 3 SpanKY gentoo-dev 2013-11-28 20:43:04 UTC
not sure anyone cares about fakeroot
Comment 4 Mike Gilbert gentoo-dev 2013-11-28 20:50:00 UTC
fakeroot works fine for me; it is nice to be able to test the install phase without root privs.
Comment 5 SpanKY gentoo-dev 2013-11-28 23:03:32 UTC
(In reply to Mike Gilbert from comment #4)

we should be able to do that w/out fakeroot
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2013-11-29 07:22:41 UTC
(In reply to SpanKY from comment #5)
> (In reply to Mike Gilbert from comment #4)
> 
> we should be able to do that w/out fakeroot

Sadly it doesn't. Or do I miss something?
Comment 7 SpanKY gentoo-dev 2013-11-29 14:13:43 UTC
(In reply to Justin Lecher from comment #6)

you can run `ebuild ... install` today as a non-root user.  i test the vast majority of packages that way.

as for `emerge`, i meant that we should investigate making it "just work" w/out needing fakeroot in the first place.  the majority of ebuilds don't need root, and the few that do could be handled in other ways.

having a program that does ELF interposition and ptracing (sandbox) run another program that does ELF interposition and ptracing (fakeroot) sounds pretty fragile to me.  we could add support to sandbox to have it do the same thing, but seems like the other route makes more sense -- force everyone to have src_install run as non-root.
Comment 8 Justin Lecher (RETIRED) gentoo-dev 2013-11-29 14:18:26 UTC
(In reply to SpanKY from comment #7)
> (In reply to Justin Lecher from comment #6)
> 
> you can run `ebuild ... install` today as a non-root user.  i test the vast
> majority of packages that way.

I could swear that for some long time "ebuild ... install" did bail out when used as normal user w/o fakeroot. That's why I am using it

I will disable it and see what happens.
Comment 9 Justin Lecher (RETIRED) gentoo-dev 2013-11-29 14:20:16 UTC
(In reply to Justin Lecher from comment #8)
> I will disable it and see what happens.

it is still that way.

>>> Install multitail-6.0 into /var/tmp/portage/app-text/multitail-6.0/image/ category app-text
/usr/bin/install: cannot change ownership of ‘/var/tmp/portage/app-text/multitail-6.0/image//usr/bin/multitail’: Operation not permitted
 * ERROR: app-text/multitail-6.0::gentoo failed (install phase):
 *   dobin failed
 * 
 * If you need support, post the output of `emerge --info '=app-text/multitail-6.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-text/multitail-6.0::gentoo'`.
 * The complete build log is located at '/var/log/portage/build/app-text/multitail-6.0:20131129-141942.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/app-text/multitail-6.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-text/multitail-6.0/temp/environment'.
 * Working directory: '/var/tmp/portage/app-text/multitail-6.0/work/multitail-6.0'
 * S: '/var/tmp/portage/app-text/multitail-6.0/work/multitail-6.0'
Comment 10 Mike Gilbert gentoo-dev 2013-11-29 16:07:49 UTC
Right, anything that calls chown(2) will cause problems.
Comment 11 SpanKY gentoo-dev 2013-11-30 04:38:03 UTC
(In reply to Justin Lecher from comment #9)

right, and my point is that we should change packages like that to stop doing the chown/install -g/etc...  i think the number of packages that do this is way less than the number that don't.

thinking a bit more, i suspect that the majority of packages that do do this do it via standard tools -- `chown` and `install`.  we're already wrapping `install` via $PATH for xattr reasons, so adding owner parsing would be easy.
Comment 12 Mike Gilbert gentoo-dev 2013-11-30 06:15:14 UTC
(In reply to SpanKY from comment #11)

It looks like dobin and dosbin have passed -o and -g to install for a long time; it predates the subversion history. I was hoping to find some commit message that would explain why that was implemented in the first place.
Comment 13 Joakim Tjernlund 2014-07-21 13:54:31 UTC
Have a look at:
https://bugs.gentoo.org/show_bug.cgi?id=489016