The issue was easily reproducible on INVARIANTS enabled vanilla FreeBSD
10-STABLE too:
1) download the latest snapshot build from 10-STABLE from freebsd's ftp site
2) install them with enabled src distset
3) echo 'WITH_TESTS=' >> /etc/src.conf
4) echo 'options INVARIANTS' >> /usr/src/sys/amd64/conf/GENERIC
5) echo 'options INVARIANT_SUPPORT' >> /usr/src/sys/amd64/conf/GENERIC
6) cd /usr/src; make buildworld kernel installworld
7) reboot
8) pkg install kyua perl
9) cd /usr/tests/lib/libc/sys/
10) repeat 10 kyua test setrlimit_test # even with normal or root user
11) wait ~10 sec to get the panic
After I applied this patch - which added 3 missing backported patch to
10-STABLE from mjg, I retested with the following commands, and
working fine:
repeat 100 kyua test setrlimit_test
additionally retested with the full libc test suite 10 times.