thom311 / libnl

Netlink Library Suite
GNU Lesser General Public License v2.1
423 stars 311 forks source link

Test failure with 3.6.0 (nl-test-util.c:69:S:Core:cache_and_clone:0: Assertion 'f' failed) #308

Closed thesamesam closed 2 years ago

thesamesam commented 2 years ago

Noticed when packaging 3.6.0 for Gentoo. Not hitting #306 anymore as expected, but a new one!

test-suite.log:

===================================
   libnl 3.6.0: ./test-suite.log
===================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/check-all
=====================

Running suite(s): main
 Abstract addresses
 Netlink attributes
 Clone ematch tree
 netns
90%: Checks: 11, Failures: 1, Errors: 0
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c:69:S:Core:cache_and_clone:0: Assertion 'f' failed
FAIL tests/check-all (exit status: 1)

System information:

Portage 3.0.30 (python 3.10.4-final-0, default/linux/amd64/17.1/hardened, gcc-11.2.1, glibc-2.35-r2, 5.15.34-gentoo-dist-hardened x86_64)
=================================================================
System uname: Linux-5.15.34-gentoo-dist-hardened-x86_64-AMD_Ryzen_9_3950X_16-Core_Processor-with-glibc2.35
KiB Mem:    65830320 total,  21308240 free
KiB Swap:   25067512 total,  25067512 free
Timestamp of repository gentoo: Sat, 16 Apr 2022 00:35:04 +0000
Head commit of repository gentoo: ac450fcad2bd337614917dd0edcfe6f0110c7a9c

Timestamp of repository kde: Fri, 15 Apr 2022 22:49:46 +0000
Head commit of repository kde: 23c4d80d4dd6a254cac108605182e9bc63d2646d

Timestamp of repository qt: Fri, 15 Apr 2022 12:19:40 +0000
Head commit of repository qt: 94bd1952996bade333941be20dca33b60c3f48a8

Timestamp of repository sam_c: Fri, 15 Apr 2022 12:19:54 +0000
Head commit of repository sam_c: dce8902550901f857f19d0e43f01c4fde8173605

Timestamp of repository steam-overlay: Fri, 15 Apr 2022 12:19:42 +0000
Head commit of repository steam-overlay: 6a9df80cc23bab51f7d84e701ebfb2bddc8103cd

sh bash 5.2_beta
ld GNU ld (Gentoo 2.38 p3) 2.38
ccache version 4.6 [disabled]
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.2_beta::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1::gentoo
dev-lang/python:           2.7.18_p15::gentoo, 3.8.13::gentoo, 3.9.12::gentoo, 3.10.4::gentoo
dev-lang/rust-bin:         1.60.0::gentoo
dev-util/ccache:           4.6-r1::gentoo
dev-util/cmake:            3.23.1::gentoo
dev-util/meson:            0.61.4-r2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          250.4-r1::gentoo
sys-devel/autoconf:        2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r1::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           13.0.1::gentoo, 14.0.1::gentoo
sys-devel/gcc:             9.4.0::gentoo, 10.3.1_p20211126::gentoo, 11.2.1_p20220326::sam_c
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.1::gentoo
sys-devel/llvm:            13.0.1::gentoo, 14.0.1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.17::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes
    sync-git-clone-extra-opts: -b stable -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo

kde
    location: /var/db/repos/kde
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/kde.git
    masters: gentoo

qt
    location: /var/db/repos/qt
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/qt.git
    masters: gentoo

sam_c
    location: /var/db/repos/sam_c
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/sam_c.git
    masters: gentoo

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo

test
    location: /var/db/repos/test
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches"
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="-O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --with-bdeps=y --complete-graph --deep --dynamic-deps=n --changed-deps=n --usepkg-exclude sys-fs/zfs --usepkg-exclude sys-fs/zfs-kmod --usepkg=y --implicit-system-deps=n --jobs=2 --load-average 32"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live cgroup clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox mount-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches"
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/ http://www.mirrorservice.org/sites/distfiles.gentoo.org/ http://mirrors.soeasyto.com/distfiles.gentoo.org/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0"
LINGUAS="en en_GB"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BZIP2_COMMAND="lbzip2"
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="/var/tmp"
SHELL="/bin/bash"
USE="PIC X a52 aac acl acpi activities aes alsa amd64 avx avx2 bash-completion bluetooth branding bzip2 cairo caps cdda cdr clang crypt dbus declarative dist-kernel dri dts dvd dvdr emacs encode exif f16c filecaps firewalld flac fma3 freetype gif gmp gpm graphite gtk gui hardened harfbuzz hunspell iconv icu ipv6 jit jpeg kde kdesu kwallet lcms libglvnd libnotify libtirpc llvm-libunwind mad mmx mmxext mng mp3 mp4 mpeg multilib ncurses nftables nls nptl ogg opengl openmp pam pango pclmul pcre pdf pgo pie pipewire plasma png policykit popcnt ppds pulseaudio qml qt5 rdrand readline screencast sdl seccomp semantic-desktop sha spell split-usr sse sse2 sse3 sse4_1 sse4_2 sse4a ssl ssp ssse3 startup-notification svg system-av1 system-binutils system-boost system-bootstrap system-cairo system-clang system-digest system-ffmpeg system-harfbuzz system-heimdal system-icu system-jpeg system-leveldb system-libevent system-libs system-libvpx system-libyaml system-lz4 system-mitkrb5 system-sqlite system-ssl system-tbb system-uulib system-webp system-zlib systemd threads tiff truetype udev udisks unicode upower usb verify-sig vorbis vulkan wayland widgets x264 xattr xcb xml xtpax xv xvid zfs zlib zsh-completion" ABI_X86="32 64" ADA_TARGET="gnat_2020" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AArch64 AMDGPU ARM AVR BPF Hexagon Lanai MSP430 Mips NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9 pypy3 python3_10 python3_8" QEMU_USER_TARGETS="aarch64 hppa ppc64le sparc64" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat 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, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

Full build.log: build.log

Let me know if I can get some more information out of this.

thom311 commented 2 years ago

hm. The test creates a new user-namespace, and then want to write something to /proc/self/uid_map. That seems not to work on your system. I don't know why.

If that cannot be made work, then we need a patch to skip the test in that case. If that can be made to work, we should better fix it and run the unit tests.

thom311 commented 2 years ago

i'd add some

what gives this patch:

diff --git i/tests/nl-test-util.c w/tests/nl-test-util.c
index 68bbb0489767..ffaacc3cebe3 100644
--- i/tests/nl-test-util.c
+++ w/tests/nl-test-util.c
@@ -66,7 +66,8 @@ static void unshare_user(void)

    /* Map current UID to root in NS to be created. */
    f = fopen("/proc/self/uid_map", "we");
-   ck_assert(f);
+   system("ls -la /proc/self/");
+   _nltst_assert_errno(f);
    fprintf(f, "0 %d 1", uid);
    fclose(f);

and make tests/check-all && CK_FORK=no ./tests/check-all?

bdubbs commented 2 years ago

I have a similar, but not identical, test failure. Using a simple ./configure && make && make check, I get:

Testsuite summary for libnl 3.6.0

TOTAL: 2 PASS: 1 SKIP: 0 XFAIL: 0 FAIL: 1 XPASS: 0 ERROR: 0

FAIL: tests/check-all

Running suite(s): main Abstract addresses Netlink attributes Clone ematch tree netns 90%: Checks: 11, Failures: 1, Errors: 0 tests/nl-test-util.c:57:S:Core:cache_and_clone:0: assert(r == 0) failed (errno=22, Invalid argument) FAIL tests/check-all (exit status: 1)

bdubbs commented 2 years ago

I figured out why tests/nl-test-util.c:57 failed. I needed a kernel configuration: CONFIG_IPC_NS=y

But now I have a new error that I cannot figure out: tests/nl-test-util.c:227:F:Core:cache_and_clone:0: Assertion 'r == 0' failed: r == -10, 0 == 0 FAIL tests/check-all (exit status: 1)

thesamesam commented 2 years ago

i'd add some

what gives this patch:

diff --git i/tests/nl-test-util.c w/tests/nl-test-util.c
index 68bbb0489767..ffaacc3cebe3 100644
--- i/tests/nl-test-util.c
+++ w/tests/nl-test-util.c
@@ -66,7 +66,8 @@ static void unshare_user(void)

  /* Map current UID to root in NS to be created. */
  f = fopen("/proc/self/uid_map", "we");
- ck_assert(f);
+ system("ls -la /proc/self/");
+ _nltst_assert_errno(f);
  fprintf(f, "0 %d 1", uid);
  fclose(f);

FWIW, Gentoo does normally run things in sandboxes for tests, but this seems to happen even when I turn all of them off (including our pid ns sandbox).

All output below is with all sandboxes disabled: FEATURES="-pid-sandbox -sandbox -usersandbox -network-sandbox -ipc-sandbox" (although we want to be able to run them with it on).

Normal 'emake check':

===================================
   libnl 3.6.0: ./test-suite.log
===================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/check-all
=====================

Running suite(s): main
 Abstract addresses
 Netlink attributes
 Clone ematch tree
 netns
total 0
dr-xr-xr-x   9 nobody nobody 0 Apr 16 19:24 .
dr-xr-xr-x 722 nobody nobody 0 Apr 16 19:23 ..
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 arch_status
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:24 attr
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 autogroup
-r--------   1 nobody nobody 0 Apr 16 19:24 auxv
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 cgroup
--w-------   1 nobody nobody 0 Apr 16 19:24 clear_refs
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 cmdline
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 comm
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 coredump_filter
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 cpu_resctrl_groups
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 cpuset
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:24 cwd -> /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86
-r--------   1 nobody nobody 0 Apr 16 19:24 environ
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:24 exe -> /bin/ls
dr-x------   2 nobody nobody 0 Apr 16 19:24 fd
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:24 fdinfo
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 gid_map
-r--------   1 nobody nobody 0 Apr 16 19:24 io
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 limits
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 loginuid
dr-x------   2 nobody nobody 0 Apr 16 19:24 map_files
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 maps
-rw-------   1 nobody nobody 0 Apr 16 19:24 mem
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 mountinfo
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 mounts
-r--------   1 nobody nobody 0 Apr 16 19:24 mountstats
dr-xr-xr-x  56 nobody nobody 0 Apr 16 19:24 net
dr-x--x--x   2 nobody nobody 0 Apr 16 19:24 ns
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 numa_maps
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 oom_adj
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 oom_score
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 oom_score_adj
-r--------   1 nobody nobody 0 Apr 16 19:24 pagemap
-r--------   1 nobody nobody 0 Apr 16 19:24 personality
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 projid_map
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:24 root -> /
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 schedstat
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 sessionid
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 setgroups
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 smaps
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 smaps_rollup
-r--------   1 nobody nobody 0 Apr 16 19:24 stack
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 stack_depth
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 stat
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 statm
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 status
-r--------   1 nobody nobody 0 Apr 16 19:24 syscall
dr-xr-xr-x   3 nobody nobody 0 Apr 16 19:24 task
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 timens_offsets
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 timers
-rw-rw-rw-   1 nobody nobody 0 Apr 16 19:24 timerslack_ns
-rw-r--r--   1 nobody nobody 0 Apr 16 19:24 uid_map
-r--r--r--   1 nobody nobody 0 Apr 16 19:24 wchan
90%: Checks: 11, Failures: 1, Errors: 0
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c:70:S:Core:cache_and_clone:0: assert(f) failed (errno=13, Permission denied)
FAIL tests/check-all (exit status: 1)

and make tests/check-all && CK_FORK=no ./tests/check-all?

Running suite(s): main
 Abstract addresses
 Netlink attributes
 Clone ematch tree
 netns
total 0
dr-xr-xr-x   9 nobody nobody 0 Apr 16 19:26 .
dr-xr-xr-x 730 nobody nobody 0 Apr 16 19:26 ..
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 arch_status
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:26 attr
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 autogroup
-r--------   1 nobody nobody 0 Apr 16 19:26 auxv
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 cgroup
--w-------   1 nobody nobody 0 Apr 16 19:26 clear_refs
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 cmdline
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 comm
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 coredump_filter
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 cpu_resctrl_groups
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 cpuset
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:26 cwd -> /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86
-r--------   1 nobody nobody 0 Apr 16 19:26 environ
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:26 exe -> /bin/ls
dr-x------   2 nobody nobody 0 Apr 16 19:26 fd
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:26 fdinfo
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 gid_map
-r--------   1 nobody nobody 0 Apr 16 19:26 io
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 limits
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 loginuid
dr-x------   2 nobody nobody 0 Apr 16 19:26 map_files
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 maps
-rw-------   1 nobody nobody 0 Apr 16 19:26 mem
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 mountinfo
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 mounts
-r--------   1 nobody nobody 0 Apr 16 19:26 mountstats
dr-xr-xr-x  56 nobody nobody 0 Apr 16 19:26 net
dr-x--x--x   2 nobody nobody 0 Apr 16 19:26 ns
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 numa_maps
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 oom_adj
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 oom_score
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 oom_score_adj
-r--------   1 nobody nobody 0 Apr 16 19:26 pagemap
-r--------   1 nobody nobody 0 Apr 16 19:26 personality
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 projid_map
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:26 root -> /
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 schedstat
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 sessionid
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 setgroups
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 smaps
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 smaps_rollup
-r--------   1 nobody nobody 0 Apr 16 19:26 stack
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 stack_depth
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 stat
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 statm
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 status
-r--------   1 nobody nobody 0 Apr 16 19:26 syscall
dr-xr-xr-x   3 nobody nobody 0 Apr 16 19:26 task
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 timens_offsets
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 timers
-rw-rw-rw-   1 nobody nobody 0 Apr 16 19:26 timerslack_ns
-rw-r--r--   1 nobody nobody 0 Apr 16 19:26 uid_map
-r--r--r--   1 nobody nobody 0 Apr 16 19:26 wchan
90%: Checks: 11, Failures: 1, Errors: 0
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c:70:S:Core:checked_setup:0: assert(f) failed (errno=13, Permission denied)
 * ERROR: dev-libs/libnl-3.6.0::gentoo failed (test phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  122:  Called src_test
 *   environment, line 4136:  Called multilib-minimal_src_test
 *   environment, line 3050:  Called multilib_foreach_abi 'multilib-minimal_abi_src_test'
 *   environment, line 3258:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_test'
 *   environment, line 2940:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_test'
 *   environment, line 2938:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_test'
 *   environment, line  815:  Called multilib-minimal_abi_src_test
 *   environment, line 3044:  Called multilib_src_test
 *   environment, line 3500:  Called die
 * The specific snippet of code:
 *       CK_FORK=no ./tests/check-all || die
thesamesam commented 2 years ago

... and with sandboxes on (default):

First command:

===================================
   libnl 3.6.0: ./test-suite.log
===================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/check-all
=====================

Running suite(s): main
 Abstract addresses
 Netlink attributes
 Clone ematch tree
 netns
total 0
dr-xr-xr-x   9 nobody nobody 0 Apr 16 19:28 .
dr-xr-xr-x 737 nobody nobody 0 Apr 16 19:28 ..
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 arch_status
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:28 attr
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 autogroup
-r--------   1 nobody nobody 0 Apr 16 19:28 auxv
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 cgroup
--w-------   1 nobody nobody 0 Apr 16 19:28 clear_refs
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 cmdline
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 comm
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 coredump_filter
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 cpu_resctrl_groups
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 cpuset
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:28 cwd -> /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86
-r--------   1 nobody nobody 0 Apr 16 19:28 environ
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:28 exe -> /bin/ls
dr-x------   2 nobody nobody 0 Apr 16 19:28 fd
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:28 fdinfo
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 gid_map
-r--------   1 nobody nobody 0 Apr 16 19:28 io
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 limits
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 loginuid
dr-x------   2 nobody nobody 0 Apr 16 19:28 map_files
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 maps
-rw-------   1 nobody nobody 0 Apr 16 19:28 mem
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 mountinfo
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 mounts
-r--------   1 nobody nobody 0 Apr 16 19:28 mountstats
dr-xr-xr-x  56 nobody nobody 0 Apr 16 19:28 net
dr-x--x--x   2 nobody nobody 0 Apr 16 19:28 ns
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 numa_maps
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 oom_adj
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 oom_score
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 oom_score_adj
-r--------   1 nobody nobody 0 Apr 16 19:28 pagemap
-r--------   1 nobody nobody 0 Apr 16 19:28 personality
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 projid_map
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:28 root -> /
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 schedstat
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 sessionid
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 setgroups
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 smaps
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 smaps_rollup
-r--------   1 nobody nobody 0 Apr 16 19:28 stack
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 stack_depth
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 stat
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 statm
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 status
-r--------   1 nobody nobody 0 Apr 16 19:28 syscall
dr-xr-xr-x   3 nobody nobody 0 Apr 16 19:28 task
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 timens_offsets
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 timers
-rw-rw-rw-   1 nobody nobody 0 Apr 16 19:28 timerslack_ns
-rw-r--r--   1 nobody nobody 0 Apr 16 19:28 uid_map
-r--r--r--   1 nobody nobody 0 Apr 16 19:28 wchan
90%: Checks: 11, Failures: 1, Errors: 0
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c:70:S:Core:cache_and_clone:0: assert(f) failed (errno=13, Permission denied)
FAIL tests/check-all (exit status: 1)

Second command:

Running suite(s): main
 Abstract addresses
 Netlink attributes
 Clone ematch tree
 netns
total 0
dr-xr-xr-x   9 nobody nobody 0 Apr 16 19:27 .
dr-xr-xr-x 737 nobody nobody 0 Apr 16 19:27 ..
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 arch_status
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:27 attr
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 autogroup
-r--------   1 nobody nobody 0 Apr 16 19:27 auxv
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 cgroup
--w-------   1 nobody nobody 0 Apr 16 19:27 clear_refs
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 cmdline
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 comm
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 coredump_filter
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 cpu_resctrl_groups
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 cpuset
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:27 cwd -> /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86
-r--------   1 nobody nobody 0 Apr 16 19:27 environ
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:27 exe -> /bin/ls
dr-x------   2 nobody nobody 0 Apr 16 19:27 fd
dr-xr-xr-x   2 nobody nobody 0 Apr 16 19:27 fdinfo
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 gid_map
-r--------   1 nobody nobody 0 Apr 16 19:27 io
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 limits
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 loginuid
dr-x------   2 nobody nobody 0 Apr 16 19:27 map_files
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 maps
-rw-------   1 nobody nobody 0 Apr 16 19:27 mem
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 mountinfo
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 mounts
-r--------   1 nobody nobody 0 Apr 16 19:27 mountstats
dr-xr-xr-x  56 nobody nobody 0 Apr 16 19:27 net
dr-x--x--x   2 nobody nobody 0 Apr 16 19:27 ns
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 numa_maps
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 oom_adj
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 oom_score
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 oom_score_adj
-r--------   1 nobody nobody 0 Apr 16 19:27 pagemap
-r--------   1 nobody nobody 0 Apr 16 19:27 personality
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 projid_map
lrwxrwxrwx   1 nobody nobody 0 Apr 16 19:27 root -> /
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 schedstat
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 sessionid
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 setgroups
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 smaps
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 smaps_rollup
-r--------   1 nobody nobody 0 Apr 16 19:27 stack
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 stack_depth
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 stat
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 statm
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 status
-r--------   1 nobody nobody 0 Apr 16 19:27 syscall
dr-xr-xr-x   3 nobody nobody 0 Apr 16 19:27 task
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 timens_offsets
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 timers
-rw-rw-rw-   1 nobody nobody 0 Apr 16 19:27 timerslack_ns
-rw-r--r--   1 nobody nobody 0 Apr 16 19:27 uid_map
-r--r--r--   1 nobody nobody 0 Apr 16 19:27 wchan
90%: Checks: 11, Failures: 1, Errors: 0
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c:70:S:Core:checked_setup:0: assert(f) failed (errno=13, Permission denied)
 * ERROR: dev-libs/libnl-3.6.0::gentoo failed (test phase):
 *   (no error message)
thom311 commented 2 years ago

I don't know, why it fails with permission-denied.

What gives strace? CK_FORK=no strace -s 10000 ./tests/check-all ?

thesamesam commented 2 years ago
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 12398
rt_sigaction(SIGINT, {sa_handler=0xf7dab080, sa_mask=[], sa_flags=0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12398, si_uid=65534, si_status=0, si_utime=0, si_stime=0} ---
write(3, "\0\0\0\2\0\0\0K/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c\0\0\0F", 87) = 87
write(3, "\0\0\0\1\0\0\0.assert(f) failed (errno=13, Permission denied)", 54) = 54
_llseek(3, 0, [0], SEEK_SET)            = 0
read(3, "\0\0\0\0\0\0\0\1\0\0\0\2\0\0\0K/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c\0\0\0\"\0\0\0\2\0\0\0K/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c\0\0\0W\0\0\0\2\0\0\0K/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c\0\0\0F\0\0\0\1\0\0\0.assert(f) failed (errno=13, Permission denied)", 8192) = 323
read(3, "", 4096)                       = 0
close(3)                                = 0
mmap2(NULL, 8200, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7a46000
mmap2(NULL, 8200, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7a43000
readlink("/var", 0xffca2690, 1023)      = -1 EINVAL (Invalid argument)
readlink("/var/tmp", 0xffca2690, 1023)  = -1 EINVAL (Invalid argument)
readlink("/var/tmp/portage", 0xffca2690, 1023) = -1 EINVAL (Invalid argument)
readlink("/var/tmp/portage/dev-libs", 0xffca2690, 1023) = -1 EINVAL (Invalid argument)
readlink("/var/tmp/portage/dev-libs/libnl-3.6.0", 0xffca2690, 1023) = -1 EINVAL (Invalid argument)
readlink("/var/tmp/portage/dev-libs/libnl-3.6.0/temp", 0xffca2690, 1023) = -1 EINVAL (Invalid argument)
readlink("/var/tmp/portage/dev-libs/libnl-3.6.0/temp/check_XXXXXX", 0xffca2690, 1023) = -1 ENOENT (No such file or directory)
mmap2(NULL, 4104, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7a41000
statx(AT_FDCWD, "/var", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, {stx_mask=STATX_TYPE|STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_CTIME|STATX_INO|STATX_SIZE|STATX_BLOCKS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=16, ...}) = 0
statx(AT_FDCWD, "/var/tmp", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, {stx_mask=STATX_TYPE|STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_CTIME|STATX_INO|STATX_SIZE|STATX_BLOCKS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|S_ISVTX|0777, stx_size=13324, ...}) = 0
statx(AT_FDCWD, "/var/tmp/portage", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=STATX_ATTR_MOUNT_ROOT, stx_mode=S_IFDIR|0775, stx_size=4096, ...}) = 0
statx(AT_FDCWD, "/var/tmp/portage/dev-libs", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0775, stx_size=4096, ...}) = 0
statx(AT_FDCWD, "/var/tmp/portage/dev-libs/libnl-3.6.0", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0770, stx_size=4096, ...}) = 0
statx(AT_FDCWD, "/var/tmp/portage/dev-libs/libnl-3.6.0/temp", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0
statx(AT_FDCWD, "/var/tmp/portage/dev-libs/libnl-3.6.0/temp/check_XXXXXX", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, 0xffca2c0c) = -1 ENOENT (No such file or directory)
munmap(0xf7a43000, 8200)                = 0
munmap(0xf7a46000, 8200)                = 0
munmap(0xf7a41000, 4104)                = 0
openat(AT_FDCWD, "/var/tmp/portage/dev-libs/libnl-3.6.0/temp/check_KwdZXu", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
mmap2(NULL, 8200, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7a46000
munmap(0xf7a46000, 8200)                = 0
unlink("/var/tmp/portage/dev-libs/libnl-3.6.0/temp/check_KwdZXu") = 0
write(1, "90%: Checks: 11, Failures: 1, Errors: 0\n/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c:70:S:Core:checked_setup:0: assert(f) failed (errno=13, Permission denied)\n", 19090%: Checks: 11, Failures: 1, Errors: 0
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c:70:S:Core:checked_setup:0: assert(f) failed (errno=13, Permission denied)
) = 190
close(3)                                = 0
rt_sigaction(SIGALRM, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, NULL, 8) = 0
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, NULL, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, NULL, 8) = 0
exit_group(1)                           = ?
+++ exited with 1 +++
 * ERROR: dev-libs/libnl-3.6.0::gentoo failed (test phase):
 *   (no error message)

So, the main lines are:

write(3, "\0\0\0\2\0\0\0K/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/nl-test-util.c\0\0\0F", 87) = 87
write(3, "\0\0\0\1\0\0\0.assert(f) failed (errno=13, Permission denied)", 54) = 54

But this isn't the actual failure, it's just it telling us it failed.

thesamesam commented 2 years ago

If I run as the 'portage' user manually, it passes. Same as root. I'm confused by what's special about running it from within Portage because I've disabled all the sandboxes.

thom311 commented 2 years ago

this strace doesn't show the actual failure, which I think would be at openat(AT_FDCWD, "/proc/self/uid_map"....

Did you run as CK_FORK=no strace -s 10000 ./tests/check-all, to avoid forking?

thesamesam commented 2 years ago

Oh, duh. @floppym pointed out I was doing something silly.

I think reading /proc/self/uid_map gets denied within our sandbox then it bails.

thom311 commented 2 years ago

could you test branch th/netns-test-issue308 ?

thesamesam commented 2 years ago

On it.

thesamesam commented 2 years ago

Works great, thank you!

thom311 commented 2 years ago

@thesamesam thanks for testing!!

I think this should be fixed by 4d12b635e671e21d992b83e27280f841bda07899. Closing.

If not, please open a new issue (or for any other issues). Thanks!!