Poudriere "bad file descriptor"

From: Andrea Venturoli <ml_at_netfence.it>
Date: Mon, 24 Apr 2023 10:20:18 UTC
Hello.

I run Poudriere on an amd64 server (8 cores Ryzen 7 with 32GiB of RAM 
and ZFS RAID5 on enterprise SSDs) which has always worked fine.

Since I upgraded to 13.2, my bulk runs often err on some port.
I looked in the logs of the failed port and always find the cause to be 
a "Bad file descrptor"  message.

Partial example from devel/pyside2 (but it's not always the same port):
> ...
> ===>   py39-pyside2-5.15.2_2 depends on shared library: libQt5TextToSpeech.so - not found
> ===>   Installing existing package /packages/All/qt5-speech-5.15.8p1.pkg
> [132amd64-default-job-06] Installing qt5-speech-5.15.8p1...
> [132amd64-default-job-06] `-- Installing speech-dispatcher-0.11.2_1...
> [132amd64-default-job-06] |   `-- Installing dotconf-1.3_1...
> [132amd64-default-job-06] |   `-- Extracting dotconf-1.3_1: ...... done
> [132amd64-default-job-06] |   `-- Installing espeak-ng-1.51.1_3...
> [132amd64-default-job-06] |   | `-- Installing pcaudiolib-1.2...
> [132amd64-default-job-06] |   | `-- Extracting pcaudiolib-1.2: ..... done
> [132amd64-default-job-06] |   `-- Extracting espeak-ng-1.51.1_3: .......... done
> [132amd64-default-job-06] |   `-- Installing libltdl-2.4.7...
> [132amd64-default-job-06] |   `-- Extracting libltdl-2.4.7: ......... done
> [132amd64-default-job-06] |   `-- Installing libsndfile-1.2.0...
> [132amd64-default-job-06] |   | `-- Installing flac-1.4.2...
> [132amd64-default-job-06] |   |   `-- Installing libogg-1.3.5,4...
> [132amd64-default-job-06] |   |   `-- Extracting libogg-1.3.5,4: ......... done
> [132amd64-default-job-06] |   | `-- Extracting flac-1.4.2: .......... done
> [132amd64-default-job-06] |   | `-- Installing lame-3.100_4...
> [132amd64-default-job-06] |   | `-- Extracting lame-3.100_4: .......... done
> [132amd64-default-job-06] |   | `-- Installing libvorbis-1.3.7_2,3...
> [132amd64-default-job-06] |   | `-- Extracting libvorbis-1.3.7_2,3: .......... done
> [132amd64-default-job-06] |   | `-- Installing mpg123-1.31.3...
> [132amd64-default-job-06] |   | `-- Extracting mpg123-1.31.3: .......... done
> [132amd64-default-job-06] |   | `-- Installing opus-1.3.1...
> [132amd64-default-job-06] |   | `-- Extracting opus-1.3.1: .......... done
> [132amd64-default-job-06] |   `-- Extracting libsndfile-1.2.0: .......... done
> [132amd64-default-job-06] `-- Extracting speech-dispatcher-0.11.2_1: .......
> pkg-static: Fail to chown /locale/pt_PT/symbols.dic:Bad file descriptor
> [132amd64-default-job-06] `-- Extracting speech-dispatcher-0.11.2_1... done
> ...

Then the bulk continues, obviously skipping all dependent ports, but 
still building some hundred.
Then, if I start the bulk again, ti usually works properly.

I thought perhaps memory was at stake, so I looked into the logs to see 
if any process was killed out of swap space, but it wasn't.

Anyone else seeing this?
Any hint?

  bye & Thanks
	av.