bug-tar
[Top][All Lists]
Advanced

[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 17:11:28 -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 06:35 AM, Christian Weisgerber wrote:
> Paul Eggert:
> 
>> The relevant shell source code (in testsuite) is:
>>
>> # Tar should work when there are few, but enough, file descriptors.
>> ((ulimit -n 10 &&
>>   tar -cf archive3.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
>>   tar -xf archive3.tar -C dest3 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
>>  ) &&
>>  diff -r a dest3/a >/dev/null 2>&1
>> ) || { diff -r a dest3/a; exit 1; }
>> )"
> 
> Yes.  And I've set up the test directories manually and run the
> above from the command line--where it works fine for a limit of 8
> or more descriptors.
> 
> It only fails when called from the testsuite.
> 
> It succeeds from the testuite with -n 13 or more.

Using -n 13 is not helpful, since we can't guarantee that fd 10, 11, and
12 were not inherited into the shell running the test, but cannot
portably close them in shell.

On the dash mailing list, it was suggested that you try using exec
rather than redirection to close the fds.  That is:

( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && ulimit -n &&
   tar -cf archive3.tar a &&
   tar -xf archive3.tar -C dest3 a
  ) &&
  diff -r a dest3/a >/dev/null 2>&1
) || { diff -r a dest3/a; exit 1; }
)

That way, you don't have the shell getting in the way by trying to dup()
fds to 10 in the first place.  Does that help matters any?

-- 
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]