grep-devel
[Top][All Lists]
Advanced

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

grep-3.3.42-088f problem with NetBSD 8.1-xxx sh


From: Paul Eggert
Subject: grep-3.3.42-088f problem with NetBSD 8.1-xxx sh
Date: Sat, 28 Dec 2019 09:55:59 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

[Robert, I'm cc'ing you on this, as a GNU grep test failure seems to be related
to recent changes to NetBSD /bin/sh. For relevant emails on this thread, see:

https://lists.gnu.org/r/grep-devel/2019-12/msg00006.html
https://lists.gnu.org/r/grep-devel/2019-12/msg00018.html
https://lists.gnu.org/r/grep-devel/2019-12/msg00039.html

]

On 12/26/19 7:06 PM, Jim Meyering wrote:
>> NetBSD-8.1:
>>    FAIL: reversed-range-endpoints
>>    FAIL: sjis-mb
>>    FAIL: surrogate-pair
>>    FAIL: warn-char-classes
> These NetBSD failures appear to be due to the use of a shell that
> emits this spurious output:
> 
>   using redirections: 2>/dev/null do

I cannot reproduce this bug on NetBSD 8.1 original, so perhaps the problem is
related to patches applied since 8.1. I see several '-x'-related changes to the
NetBSD sh source since 8.1, and suspect one or more of them to be the issue:

https://github.com/NetBSD/src/commit/c72089af4558b5b98523aef0a4d39a88b66425a0#diff-c21df479359bd696c461d2da728f1eb0
https://github.com/NetBSD/src/commit/0a5c234492cdf60854117c9c5d200855e81fa0d6#diff-c21df479359bd696c461d2da728f1eb0
https://github.com/NetBSD/src/commit/592f0b490283bbde4865e453c29007432cccf5ae#diff-c21df479359bd696c461d2da728f1eb0
https://github.com/NetBSD/src/commit/af9cce694ac7d47399975389f90bfafcd31a6feb#diff-c21df479359bd696c461d2da728f1eb0
https://github.com/NetBSD/src/commit/add389a76b895f0bf28222b9eaa728e0be39db2b#diff-c21df479359bd696c461d2da728f1eb0

Now, the following part of grep/tests/init.sh is supposed to be dealing with sh
problems in this area:

  if test "$VERBOSE" = yes; then
    test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9
  fi

but apparently this bit is not properly detecting the NetBSD sh problem. Perhaps
these init.sh lines will work better if we add a further indirection prompting
the problem. That is, perhaps we could change them to something like this:

  if test "$VERBOSE" = yes; then
    test -n "$( (exec 3>&1; set -x; P=1 true 2>&3 3>&-) 2> /dev/null)" && 
score_=9
  fi

but Assaf (or someone with access to the problematic NetBSD installation) would
have to verify this and if it doesn't work then fiddle with init.sh further
(say, by inserting "4> /dev/null" before the "2>&3" rather than "3>&-" after the
"2>&3").

Interestingly enough, the abovementioned NetBSD sh patches in part add a new
'set -X' flag that is related to this issue. I wonder why it was added? I'll cc
the patches' author Robert Elz to see if he has any advice. (Of course we cannot
blindly use 'set -X' in a portable script.)



reply via email to

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