Re: Fairly Modern poudriere-devel on fairly modern main gets "mount_nullfs: /usr/local/poudriere/data/.m/NAME/ref/packages: Resource deadlock avoided" when operated in a chroot context.
Date: Thu, 13 Feb 2025 05:58:33 UTC
[I've now tried my UFS context as well.]
On Feb 12, 2025, at 18:24, Mark Millard <marklmi@yahoo.com> wrote:
> I use pkg and poudriere-devel in areas that I've chroot'ed into. (This
> may be unusual and so is noted just in case it turns out to be involved.
> I've been doing that for years. Also, when I tried the same without being
> chroot'd things behaved normally and worked fine.)
>
> The context does use:
>
> USE_TMPFS=all
> TMPFS_BLACKLIST=. . .
> TMPFS_BLACKLIST_TMPDIR=${BASEFS}/data/cache/tmp
>
>
> As of my attempt to update to modern pkg and poudrere after having update
> the FreeBSD main vintage, all my attempts fail with the likes of:
>
> [00:00:02] [01] [00:00:00] Builder starting
> [00:00:02] [01] [00:00:00] Builder started
> [00:00:02] [01] [00:00:00] Building ports-mgmt/pkg | pkg-2.0.6
> [00:00:39] [01] [00:00:37] Finished ports-mgmt/pkg | pkg-2.0.6: Success ending TMPFS: 3.70 GiB
> [00:00:39] [02] [00:00:00] Builder starting
> [00:00:39] [01] [00:00:00] Building misc/freebsd-release-manifests | freebsd-release-manifests-20250207
> [00:00:40] [02] [00:00:01] Builder started
> [00:00:40] [02] [00:00:00] Building devel/bsddialog | bsddialog-1.0.1
> [00:00:40] [01] [00:00:01] Finished misc/freebsd-release-manifests | freebsd-release-manifests-20250207: Success ending TMPFS: 2.88 GiB
> [00:00:42] [02] [00:00:02] Finished devel/bsddialog | bsddialog-1.0.1: Success ending TMPFS: 2.89 GiB
> [00:00:42] [01] [00:00:00] Building ports-mgmt/portconfig | portconfig-0.6.1_1
> [00:00:43] [01] [00:00:01] Finished ports-mgmt/portconfig | portconfig-0.6.1_1: Success ending TMPFS: 2.88 GiB
> [00:00:43] [01] [00:00:00] Building ports-mgmt/poudriere-devel | poudriere-devel-3.4.99.20250209
> [00:00:46] [01] [00:00:03] Finished ports-mgmt/poudriere-devel | poudriere-devel-3.4.99.20250209: Success ending TMPFS: 2.96 GiB
> [00:00:47] Stopping 5 builders
> [00:00:47] Creating pkg repository
> mount_nullfs: /usr/local/poudriere/data/.m/main-ZNV4-default/ref/packages: Resource deadlock avoided
I also see the just-above and just-below like messages in
my UFS context.
> [00:00:47] Error: /usr/local/share/poudriere/bulk.sh:mount_packages:7:Failed to mount the packages directory
>
> It later reports:
>
> [00:00:47] Unmounting file systems
> Error: (50608) rm:rm:1: /usr/local/poudriere/data/.m/main-ZNV4-default: Device busy
I also see the just-above like message in my UFS context.
> After that the df -m output includes the likes of:
>
> tmpfs 144265 0 144265 0% /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-ZNV4-default
>
> which is the /usr/local/poudriere/data/.m/main-ZNV4-default involved.
>
> I reduced the context down to having the chroot based on
> just (showing df -m output from in the chroot session
> after the failure, showing just what was put in the chroot
> area, other than poudriere's run generates the tmpfs shown):
>
> zoptb/DESTDIRs/main-ZNV4-chroot-ports-local 759185 9745 749439 1% /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local
> devfs 0 0 0 0% /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/dev
> /usr/local/etc/poudriere.conf 752193 2753 749439 0% /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/etc/poudriere.conf
> tmpfs 148322 0 148322 0% /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default
> /usr/obj/DESTDIRs/main-ZNV4-poud 751882 2442 749439 0% /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/obj/DESTDIRs/main-ZNV4-poud
> /usr/ports 759648 10208 749439 1% /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/ports
>
> Note the name main-mmjnk-default for this simpler context that is
> otherwise similar.
>
> So the rest is local to /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local
> instead of being mount points referencing places outside that.
>
> I then added some echos into poudriere's common.sh and include/fs.sh and saw:
>
> [00:00:02] Stopping 4 builders
> About to: findmounts /usr/local/poudriere/data/.m/main-mmjnk-default/04 1
> About to: findmounts /usr/local/poudriere/data/.m/main-mmjnk-default/02 1
> About to: findmounts /usr/local/poudriere/data/.m/main-mmjnk-default/03 1
> About to: findmounts /usr/local/poudriere/data/.m/main-mmjnk-default/01 1
> findmounts result:
> findmounts result:
> findmounts result:
> findmounts result: /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/var/db/ports /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/usr/tests /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/usr/src /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/usr/share /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/usr/ports /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/usr/lib32 /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/rescue /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/proc /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/packages /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/distfiles /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/dev/fd /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/dev /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/compat/linux/proc /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/usr/local/poudriere/data/.m/main-mmjnk-default/01/.p
> [00:00:02] Creating pkg repository
> About to: umountfs /usr/local/poudriere/data/.m/main-mmjnk-default/ref/packages
> About to: findmounts /usr/local/poudriere/data/.m/main-mmjnk-default/ref/packages 0
> findmounts result:
> About to: /sbin/mount -t nullfs -o rw /usr/local/poudriere/data/packages/main-mmjnk-default/.building /usr/local/poudriere/data/.m/main-mmjnk-default/ref/packages
> mount_nullfs: /usr/local/poudriere/data/.m/main-mmjnk-default/ref/packages: Resource deadlock avoided
>
> I'll note that /usr/local/poudriere/data/.m/main-mmjnk-default in the
> chroot area is reported to be tmpfs, like the mroe complicated
> main-ZNV4-default example.
>
> Nothing else in that area is listed as being tmpfs after the problem.
>
>
> (That looks to me like it is possibly hitting a new system constraint,
> appearently associated with at least chroot contexts.)
>
> I'll note that the example happens to be based on a GPT partition with a
> ZFS file system, in ase that somehow matters. (ZFS classically used just
> for bectl usage, not other typical reasons.)
>
>
> The jail creation had been via:
>
> # poudriere jail -c -jmain-mmjnk -m null -M /usr/obj/DESTDIRs/main-ZNV4-poud -S /usr/main-src -v 15.0-CURRENT
> [00:00:00] Recording filesystem state for clean... done
> [00:00:00] Jail main-mmjnk 15.0-CURRENT amd64 is ready to be used
>
> I'll note:
>
> # poudriere ports -l
> PORTSTREE METHOD TIMESTAMP PATH
> default null 2021-04-18 02:05:47 /usr/ports
>
> Entering the chroot had been via:
>
> # chroot /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/
> #
>
> The starting environment in the chroot had:
>
> # pkg -v
> 1.21.3
>
> # poudriere version
> poudriere-git-3.4.99.20250115
>
> from prior activity.
>
>
> The content of:
>
> /usr/obj/DESTDIRs/main-ZNV4-chroot-ports-local/
>
> is a personal world build that was installed there. (The system boots
> to an official PkgBase installed world.) So this is not just official
> materials involved in the activity, unfortunately.
===
Mark Millard
marklmi at yahoo.com