Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922652 - app-arch/cpio-2.15: emerge hangs on conftest when building cpio
Summary: app-arch/cpio-2.15: emerge hangs on conftest when building cpio
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-21 23:35 UTC by Robert Marmorstein
Modified: 2024-01-23 15:14 UTC (History)
3 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 Robert Marmorstein 2024-01-21 23:35:14 UTC
When doing an emerge -uDN @world, my build hangs on the cpio package.  A "ps" shows that it is doing ./conftest.  I gave it over 24 hours with no progress.  Killing the conftest progress results in a successful emerge (or at least, it did for me).  

Reproducible: Always

Steps to Reproduce:
1.  emerge app-arch/cpio
2.  Wait forever
Actual Results:  
1.  Emerge blocks.

Expected Results:  
1.  Emerge completes.

Portage 3.0.50_p3 (python 3.11.7-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.38-r9, 6.3.5-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-6.3.5-gentoo-x86_64-x86_64-Intel-R-_Pentium-R-_D_CPU_3.20GHz-with-glibc2.38
KiB Mem:     3293468 total,   1065992 free
KiB Swap:    2714972 total,   2522648 free
Timestamp of repository gentoo: Sun, 21 Jan 2024 00:33:20 +0000
Head commit of repository gentoo: 3028d58a5482704359475fdd28dfbca3d90ee18a

sh bash 5.2_p26
ld GNU ld (Gentoo 2.41 p4) 2.41.0
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.16.5-r1::gentoo
dev-build/cmake:           3.28.1-r1::gentoo
dev-build/libtool:         2.4.7-r1::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.3.1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1_p1::gentoo
dev-lang/rust-bin:         1.74.1::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/openrc:           0.52.1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.41-r3::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20231216::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-kernel/linux-headers:  6.7::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r9::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    volatile: False

Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64 ~x86"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -Os -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -Os -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=2 --load-average=1.8 --autounmask=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live clean-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo     http://mirrors.rit.edu/gentoo/     http://gentoo.osuosl.org/"
LANG="en_US.UTF8"
LC_ALL="en_US.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en_US"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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 --exclude=/.git"
PORTAGE_TMPDIR="/dev/shm"
SHELL="/bin/bash"
USE="X acl acpi alsa amd64 apache2 bash-completion bzip2 cgi cli crypt cupsddk curl dahdi dbus dri dv dvd elogind encode faac ffmpeg fortran freetds gdbm iconv ipv6 jpeg kdenlive kolab lame latex latex3 libinput libtirpc lzma mp3 mpeg mysql mysqli ncurses ogg opengl openmp pam pcre pgsql plasma png postproc pulseaudio readline seccomp split-usr ssl taglib test-rust theora threads truetype unicode usb vhosts vim-syntax xattr xv zlib" ABI_X86="32 64" ADA_TARGET="gnat_2021" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_core authn_anon authn_dbm authn_default authn_file authz_dbm authz_core authz_default cgi cgid authz_groupfile authz_host authz_owner authz_user autoindex cache 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 proxy_http proxy_connect proxy version dbd unixd socache_shmcb" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-3" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby26" SANE_BACKENDS="pixma net epson epson2 snapscan" VIDEO_CARDS="intel vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Robert Marmorstein 2024-01-21 23:35:44 UTC
Killing conftest seems to be a workaround for this -- but not a good one.
Comment 2 Robert Marmorstein 2024-01-22 00:11:22 UTC
When building this with:

ebuild cpio-2.16.ebuild compile

it seems to hang on:

checking whether getcwd handles long file names properly...
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-22 07:29:28 UTC
Could you try strace the test when it's stuck? I imagine this is the same as bug 447970.
Comment 4 Robert Marmorstein 2024-01-22 14:47:02 UTC
(In reply to Sam James from comment #3)
> Could you try strace the test when it's stuck? I imagine this is the same as
> bug 447970.

It does look similar (funny, I just found that bug myself and was comparing).  Here's the tail end of an strace:

epoll_ctl(3, EPOLL_CTL_ADD, 12, {events=EPOLLIN, data={u32=12, u64=140338056396812}}) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 10, 0x7ffd11ebb49c) = 0
read(10, "checking whether getcwd handles "..., 4096) = 60
write(11, "checking whether getcwd handles "..., 60checking whether getcwd handles long file names properly... ) = 60
write(13, "checking whether getcwd handles "..., 60) = 60
read(10, 0x565264a6d450, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_ADD, 10, {events=EPOLLIN, data={u32=10, u64=140338056396810}}) = 0
epoll_wait(3, [{events=EPOLLIN, data={u32=12, u64=140338056396812}}], 4, -1) = 1
epoll_wait(3, [{events=EPOLLIN, data={u32=12, u64=140338056396812}}], 4, 0) = 1
epoll_ctl(3, EPOLL_CTL_DEL, 12, 0x7ffd11ebb49c) = 0
read(12, "checking whether getcwd handles "..., 4096) = 60
write(14, "checking whether getcwd handles "..., 60) = 60
read(12, 0x565264a6d450, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_ADD, 12, {events=EPOLLIN, data={u32=12, u64=140338056396812}}) = 0
epoll_wait(3,
Comment 5 Robert Marmorstein 2024-01-22 14:55:06 UTC
If it is the same as #44790, the behavior is clearly worse for my case.  In 44790, the comments suggest the slowdown never takes more than a minute or two.  But I let this run for over 24 hours.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-22 14:55:52 UTC
I've asked Arsen to have a look, but I think in the meantime, we should set the cache var for it in profiles. This is a huge waste of CPU time.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-22 16:22:42 UTC
(In reply to Robert Marmorstein from comment #5)
> If it is the same as #44790, the behavior is clearly worse for my case.  In
> 44790, the comments suggest the slowdown never takes more than a minute or
> two.  But I let this run for over 24 hours.

To confirm if it's roughly the same, could you tell me if FEATURES="-sandbox -usersandbox" emerge -v1 cpio is fast or not (does it hang on that test)?

FWIW, the speed of the hangs reported in that bug vary a lot.
Comment 8 Robert Marmorstein 2024-01-22 23:06:50 UTC
> To confirm if it's roughly the same, could you tell me if FEATURES="-sandbox
> -usersandbox" emerge -v1 cpio is fast or not (does it hang on that test)?
> 

Tried this, but it still hangs.  So maybe not the same bug after all.
Comment 9 Robert Marmorstein 2024-01-23 02:14:56 UTC
I'm going to run this with the "time" command in a "screen" session to see if it ever finishes.  I'll give it a couple days and see what happens...
Comment 10 Larry the Git Cow gentoo-dev 2024-01-23 15:14:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39e7dae5ae53f438bb94c464b05aba169938d9fb

commit 39e7dae5ae53f438bb94c464b05aba169938d9fb
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-01-22 16:11:52 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-23 15:13:47 +0000

    profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max)
    
    Workaround for sandbox bug which causes this gnulib configure test to take
    many real hours on slower machines, and certainly a huge amount of CPU hours
    on others.
    
    Spoof the same result as configure gets on a modern glibc & musl system for now.
    
    Bug: https://bugs.gentoo.org/447970
    Closes: https://bugs.gentoo.org/922652
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/default/linux/make.defaults | 9 ++++++++-
 profiles/features/musl/make.defaults | 7 +++++++
 2 files changed, 15 insertions(+), 1 deletion(-)