[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:1.9.2.9) 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 0.5.5.1 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.
Compare:
$ ksh -c 'ulimit -n 8; : <&-; exec 3<&0'; echo $?
0
$ bash -c 'ulimit -n 8; : <&-; exec 3<&0'; echo $?
bash: redirection error: cannot duplicate fd: Invalid argument
bash: 0: Bad file descriptor
1
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
signature.asc
Description: OpenPGP digital signature
Re: [Bug-tar] tar 1.24: OpenBSD testsuite failures, Joerg Schilling, 2010/10/28