Subject: bug#36128: Failed tests for sed 4.7 on Solaris 10 x86

From: Assaf Gordon <[email-masked]>
Date: Wed, 25 Sep 2019 11:57:13 -0600

Hello,

On 2019-09-24 6:15 a.m., Dagobert Michelsen wrote:
> 
> Am 07.06.2019 um 14:55 schrieb Dagobert Michelsen <[email-masked]>:
>> I noticed two failed tests on Solaris 10 x86, please see the attached test-suite.log:
>>
>> FAIL: testsuite/misc.pl
>> FAIL: testsuite/debug.pl
>>
>> Please let me know if you need further information or if I should test anything.
> 
> The problem still exists and I would really like to release an updated sed.
> Can someone please have a look?

 From a cursory check,
I think this is an issue in the interplay between the old perl (5.8.4)
and the old shell (/bin/sh) on solaris 10.

---

For example, the "space" test (which is the first failure in the log)
is defined like so:
       ['space', q('s/_\S/XX/g;s/\s/_/g'),
           {IN=>  "Hello World\t!\nSecond_line_ of tests\n" },
           {OUT=> "Hello_World_!\nSecondXXine__of_tests\n" }],

When I run it interactively on OpenCSW's unstable10x, it works as expected:

    > printf 'Hello World\t!\nSecond_line_ of tests\n' > space.in
    > ./sed/sed 's/_\S/XX/g;s/\s/_/g' space.in
    Hello_World_!
    SecondXXine__of_tests

The failure in the log can be reproduced interactively if the 
backslashes are removed from the sed script:

    > ./sed/sed 's/_S/XX/g;s/s/_/g' space.in
    Hello World     !
    Second_line_ of te_t_

I take it as a hint that the perl quoting of the string using q('')
then going through /bin/sh somehow "loses" these backslashes.

---

Another example:
If I rebuild sed and forces the shell to be /usr/bin/bash,
all tests pass:

     ./configure SHELL=/usr/bin/bash
     make
     make check

---

As such, I think these are false positives, and the sed-4.7 binary
should work fine on Solaris 10 x86.

It might be worth fixing the tests, or detecting problematic shell
and working around it, but I can't get to that in the near future
(patches are of course welcomed).

Hope this helps,
  - assaf