[Top][All Lists]

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

Re: [Bug-tar] tar 1.24: OpenBSD testsuite failures

From: Eric Blake
Subject: Re: [Bug-tar] tar 1.24: OpenBSD testsuite failures
Date: Wed, 27 Oct 2010 16:07:58 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4

On 10/27/2010 03:30 PM, Eric Blake wrote:
>> I just tested on OpenBSD 4.7, FreeBSD 8.1, and MirBSD 10; that reports
>> failure for all three of those distros.  However, it also reports
>> failure for dash and latest dash.git, as well as pdksh.  So the
>> bug is pretty much inherited by all ash derivatives.
>> It passes on bash, zsh, Solaris /bin/sh, and ksh93.
> Actually, bash 4.1 behaves oddly:
> $ bash -c 'ulimit -n 11; : <&-'; echo $?
> 0
> $ bash -c 'ulimit -n 10; : <&-'; echo $?
> bash: redirection error: cannot duplicate fd: Invalid argument
> 0

In fact, bash is *silently* losing stdin for all subsequent commands.

$ ksh -c 'ulimit -n 8; : <&-; exec 3<&0'; echo $?
$ bash -c 'ulimit -n 8; : <&-; exec 3<&0'; echo $?
bash: redirection error: cannot duplicate fd: Invalid argument
bash: 0: Bad file descriptor

I know exactly WHY bash and other shells are trying to dup() to 10 or
greater - they MUST preserve the shell's std fds for commands after the
temporary redirection done by ': <&-'.  ksh93 is calling
fcntl(fd,F_DUPFD,3) while bash and BSD sh are using fcntl(fd,F_DUPFD,10).

At this point, I think that tar should fix its testsuite to use a larger
ulimit -n setting; 10 is just too small for most shells out there,
whether or not you also consider this a shell bug.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]