tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: odd ATF failure for sh: ulimit_redirection_interaction failed



At Fri, 12 Mar 2021 15:49:37 +0700, Robert Elz <kre%munnari.OZ.AU@localhost> wrote:
Subject: Re: odd ATF failure for sh: ulimit_redirection_interaction failed
> 
> The -X should allow...
> 
>   | tc-se:stderr:
>   | tc-se:helper.sh: 1: Invalid argument
> 
> to reveal just what is producing that error message (what is invalid).

Thanks for the pointers!

From a few quick tests it looks like the problem is with the redirection
to what should be an already open file descriptor.

But it still doesn't really make sense from what I see in the source.
The attempted FD is #18, but the error just says "1", not "18":

tc-se:+ LIM=9
tc-se:+ ulimit -S -n 9
tc-se:+ '[' 9 -gt 16 ']'
tc-se:+ for FD=18
tc-se:+ echo '18 in 18 38 77 155 311 624 1249 2499 4999 9999' >&18
tc-se:helper.sh: 1: Invalid argument
tc-se:+ exit 1
tc-se:
tc-end: 1615574952.421302, ulimit_redirection_interaction, failed, atf-check failed; see the output of the test for details

On the other hand for EINVAL fcntl(2) does say:

                        The argument cmd is F_DUPFD and arg is negative or
                        greater than the maximum allowable number (see
                        getdtablesize(3)).

So I'm not so sure this test is valid in the first place, is it?
(I've been somewhat confused by the logic in this test and the logic in
the related code in sh....)

Indeed if I move the ulimit call to reset the limit back up to the
old limit of 2000 then it runs through the whole list without error
(well except for the stderr output caused by the "set -x" of course).

tc-so:Executing command [ /bin/sh helper.sh ]
tc-se:Fail: stderr not empty
tc-se:--- /dev/null     2021-03-13 02:13:32.737028821 +0000
tc-se:+++ /tmp/check.n8ejtt/stderr      2021-03-13 02:13:32.736999310 +0000
tc-se:@@ -0,0 +1,21 @@
tc-se:++ ulimit -S -n 2000
tc-se:++ for FD=18
tc-se:++ echo 18 in 18 38 77 155 311 624 1249 2499 4999 9999 >&18
tc-se:++ for FD=38
tc-se:++ echo 38 in 18 38 77 155 311 624 1249 2499 4999 9999 >&38
tc-se:++ for FD=77
tc-se:++ echo 77 in 18 38 77 155 311 624 1249 2499 4999 9999 >&77
tc-se:++ for FD=155
tc-se:++ echo 155 in 18 38 77 155 311 624 1249 2499 4999 9999 >&155
tc-se:++ for FD=311
tc-se:++ echo 311 in 18 38 77 155 311 624 1249 2499 4999 9999 >&311
tc-se:++ for FD=624
tc-se:++ echo 624 in 18 38 77 155 311 624 1249 2499 4999 9999 >&624
tc-se:++ for FD=1249
tc-se:++ echo 1249 in 18 38 77 155 311 624 1249 2499 4999 9999 >&1249
tc-se:++ for FD=2499
tc-se:++ echo 2499 in 18 38 77 155 311 624 1249 2499 4999 9999 >&2499
tc-se:++ for FD=4999
tc-se:++ echo 4999 in 18 38 77 155 311 624 1249 2499 4999 9999 >&4999
tc-se:++ for FD=9999
tc-se:++ echo 9999 in 18 38 77 155 311 624 1249 2499 4999 9999 >&9999
tc-end: 1615601612.771674, ulimit_redirection_interaction, failed, atf-check failed; see the output of the test for details


I want to add some debug printfs to the shell too, but I'm currently
stymied by another problem (I can't access the domU filesystem from the
dom0, and until I can get a complete rebuild to finish so I can do a
full reinstall of the domU, accessing the FS from the dom0 would be the
only easy way I have of injecting changes to the test system since it
has no networking).

-- 
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

Attachment: pgp_hbCBITk_s.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index