profile
viewpoint

Ask questionstest-mountpoint-util fails when run in a mount/pid namepace

systemd version the issue has been seen with 240

Used distribution Gentoo https://bugs.gentoo.org/674458

Summary Gentoo's Portage package manager runs builds in a separate pid namespace. It also creates a separate mount namespace to allow /proc to be over-mounted with a new proc instance.

When run in such an environment, test-mountpoint-util fails as below.

--- command ---
SYSTEMD_KBD_MODEL_MAP='/x/portage/sys-apps/systemd-240-r2/work/systemd-240/src/locale/kbd-model-map' SYSTEMD_LANGUAGE_FALLBACK_MAP='/x/portage/sys-apps/systemd-240-r2/work/systemd-240/src/locale/language-fallback-map' PATH='/x/portage/sys-apps/systemd-240-r2/work/systemd-240-abi_x86_64.amd64:/x/portage/sys-apps/systemd-240-r2/temp/python3.7/bin:/usr/lib/ccache/bin:/home/floppym/src/portage/bin/ebuild-helpers/xattr:/home/floppym/src/portage/bin/ebuild-helpers:/usr/lib/llvm/7/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin' /x/portage/sys-apps/systemd-240-r2/work/systemd-240-abi_x86_64.amd64/test-mountpoint-util
--- stderr ---
Found container virtualization none.
/* test_mount_propagation_flags(shared) */
/* test_mount_propagation_flags(slave) */
/* test_mount_propagation_flags(private) */
/* test_mount_propagation_flags((null)) */
/* test_mount_propagation_flags() */
/* test_mount_propagation_flags(xxxx) */
/* test_mount_propagation_flags( ) */
/* test_mnt_id */
mountinfo: / → 464
mountinfo: /sys → 465
mountinfo: /sys/fs/cgroup → 466
mountinfo: /sys/fs/cgroup/unified → 467
mountinfo: /sys/fs/cgroup/systemd → 468
mountinfo: /sys/fs/cgroup/perf_event → 469
mountinfo: /sys/fs/cgroup/pids → 470
mountinfo: /sys/fs/cgroup/cpu,cpuacct → 471
mountinfo: /sys/fs/cgroup/net_cls,net_prio → 472
mountinfo: /sys/fs/cgroup/cpuset → 473
mountinfo: /sys/fs/cgroup/blkio → 474
mountinfo: /sys/fs/cgroup/memory → 475
mountinfo: /sys/fs/cgroup/devices → 476
mountinfo: /sys/fs/cgroup/freezer → 477
mountinfo: /sys/fs/cgroup/hugetlb → 478
mountinfo: /sys/fs/bpf → 479
mountinfo: /sys/kernel/debug → 480
mountinfo: /sys/fs/fuse/connections → 481
mountinfo: /dev → 482
mountinfo: /dev/shm → 483
mountinfo: /dev/pts → 484
mountinfo: /dev/mqueue → 485
mountinfo: /dev/hugepages → 486
mountinfo: /run → 487
mountinfo: /run/user/10000 → 488
mountinfo: /run/user/0 → 489
mountinfo: /proc → 490
mountinfo: /proc/sys/fs/binfmt_misc → 491
mountinfo: /proc/sys/fs/binfmt_misc → 492
mountinfo: /tmp → 493
mountinfo: /x → 494
mountinfo: /mnt/data1 → 495
mountinfo: /var/cache/distfiles → 496
mountinfo: /home → 497
mountinfo: /home/floppym/tmp → 498
mountinfo: /var/cache/packages → 499
mountinfo: /boot → 500
mountinfo: /proc → 503
mnt ids of /run are 487, 487
mnt ids of /var/cache/packages are 499, 499
mnt ids of /boot are 500, 500
mnt ids of /sys/fs/cgroup/cpuset are 473, 473
mnt ids of /dev/shm are 483, 483
mnt ids of /run/user/0 are 489, 489
mnt ids of /proc/sys/fs/binfmt_misc are 491, 503
the other path for mnt id 503 is /proc
Assertion 'path_equal(p, t)' failed at ../systemd-240/src/test/test-mountpoint-util.c:86, function test_mnt_id(). Aborting.
systemd/systemd

Answer questions robert-scheck

Same issue here with systemd v244 when trying to build systemd on CentOS 8.1 in mock:

The output from the failed tests:

340/543 test-mountpoint-util                    FAIL     0.51 s (killed by signal 6 SIGABRT)

--- command ---
SYSTEMD_KBD_MODEL_MAP='/builddir/build/BUILD/systemd-stable-244.1/src/locale/kbd-model-map' PATH='/builddir/build/BUILD/systemd-stable-244.1/x86_64-redhat-linux-gnu:/builddir/.local/bin:/builddir/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin' SYSTEMD_LANGUAGE_FALLBACK_MAP='/builddir/build/BUILD/systemd-stable-244.1/src/locale/language-fallback-map' /builddir/build/BUILD/systemd-stable-244.1/x86_64-redhat-linux-gnu/test-mountpoint-util
--- stderr ---
Found container virtualization systemd-nspawn.
/* test_mount_propagation_flags(shared) */
/* test_mount_propagation_flags(slave) */
/* test_mount_propagation_flags(private) */
/* test_mount_propagation_flags((null)) */
/* test_mount_propagation_flags() */
/* test_mount_propagation_flags(xxxx) */
/* test_mount_propagation_flags( ) */
/* test_mnt_id */
mountinfo: / → 452
mountinfo: /var/cache/dnf → 453
mountinfo: /proc/filesystems → 454
mountinfo: /tmp → 455
mountinfo: /sys → 456
mountinfo: /sys/fs/selinux → 457
mountinfo: /dev → 458
mountinfo: /dev/shm → 459
mountinfo: /dev/pts → 460
mountinfo: /dev/console → 461
mountinfo: /run → 462
mountinfo: /run/systemd/nspawn/incoming → 463
mountinfo: /etc/resolv.conf → 464
mountinfo: /proc → 287
mountinfo: /proc/sys → 288
mountinfo: /proc/kallsyms → 289
mountinfo: /proc/kcore → 290
mountinfo: /proc/keys → 291
mountinfo: /proc/sysrq-trigger → 292
mountinfo: /proc/timer_list → 293
mountinfo: /proc/acpi → 294
mountinfo: /proc/asound → 295
mountinfo: /proc/bus → 296
mountinfo: /proc/fs → 297
mountinfo: /proc/irq → 298
mountinfo: /proc/scsi → 299
mountinfo: /sys/fs/cgroup → 300
mountinfo: /sys/fs/cgroup/pids → 302
mountinfo: /sys/fs/cgroup/blkio → 303
mountinfo: /sys/fs/cgroup/rdma → 304
mountinfo: /sys/fs/cgroup/hugetlb → 305
mountinfo: /sys/fs/cgroup/freezer → 310
mountinfo: /sys/fs/cgroup/devices → 311
mountinfo: /sys/fs/cgroup/cpu,cpuacct → 312
mountinfo: /sys/fs/cgroup/memory → 313
mountinfo: /sys/fs/cgroup/cpuset → 314
mountinfo: /sys/fs/cgroup/perf_event → 315
mountinfo: /sys/fs/cgroup/net_cls,net_prio → 316
mountinfo: /sys/fs/cgroup/systemd → 317
mountinfo: /proc/sys/kernel/random/boot_id → 318
mountinfo: /proc/sys/kernel/random/boot_id → 319
mountinfo: /proc/kmsg → 401
mnt ids of /sys/fs/cgroup/net_cls,net_prio is 316
mnt ids of /proc/filesystems are 454, 287
the other path for mnt id 287 is /proc
Assertion 'path_equal(p, t)' failed at src/test/test-mountpoint-util.c:94, function test_mnt_id(). Aborting.
useful!

Related questions

"A stop job is running for User Manager for UID 1000" hot 3
"Failed to bump fs.file-max, ignoring: Invalid argument" after kernel upgraded from 5.1.9 to 5.1.10 hot 2
Misleading error message when ReadWritePaths doesn't exist hot 1
systemd-gpt-auto-generator: Failed to dissect: Input/output error (boot/rpmb context) hot 1
udevd: Could not generate persistent MAC address for $name: No such file or directory hot 1
"Failed to acquire RNG protocol: Not Found" on boot hot 1
Failed to send hostname reply: Invalid argument hot 1
redis-server fails with systemd emitting 'Too many levels of symbolic links' hot 1
systemd-networkd-wait-online seems to fail for no reason hot 1
log.h:220:27: error: ‘%s’ directive argument is null [-Werror=format-overflow=] hot 1
systemd-gpt-auto-generator: Failed to dissect: Input/output error (boot/rpmb context) hot 1
resolve call failed: DNSSEC validation failed: failed-auxiliary hot 1
freeze after "Starting Flush Journal to Persistent Storage" hot 1
eth network stuck at routable (configuring) hot 1
"Failed to acquire RNG protocol: Not Found" on boot hot 1
source:https://uonfu.com/
Github User Rank List