sed or gcc problem on Mac OS X

View: New views
5 Messages — Rating Filter:   Alert me  

sed or gcc problem on Mac OS X

by Jim Meyering :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I've traced a coreutils ls/abmon-align test failure
on powerpc Mac OS X (9.8.0 Darwin Kernel) to a failure of sed.

It's due to a problem with the installed /usr/local/bin/sed.
If I use /usr/bin/sed instead, it works fine.

Also, making this change to the coreutils test script,
tests/ls/abmon-align,

    -      LC_ALL=C sed '1d; s/.\{15\}\(.*\) ...ts$/\1/; s/ /./g' |
    +      LC_ALL=C sed 's/.\{15\}//;s/ ..\.ts$//;s/ /./g' |

that test succeeds even when using /usr/local/bin/sed.

Here's a pared-down test case:
The sed-4.2.1 used here was just built from upstream
source using "gcc version 4.3.0 20070817 (experimental)"
so maybe it was miscompiled by that 2+-year-old version of gcc.

    $ sed --version|sed 1q
    GNU sed version 4.2.1

This shows the malfunction with 4.2.1:

    $ printf 'd\303\251\n'|sed 's/\(.\).*/\1/'
    dé

It works with vendor sed:

    $ printf 'd\303\251\n'|/usr/bin/sed 's/\(.\).*/\1/'
    d

I also built sed on ppc/linux with a recent gcc, and there
it had no problem.



Re: sed or gcc problem on Mac OS X

by Paolo Bonzini-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> I also built sed on ppc/linux with a recent gcc, and there
> it had no problem.

Hi Jim,

you didn't say whether you used --with-included-regex, but I tried it on
i686-linux and didn't have the problem.  I'll dust up my PPC Mac; I
don't remember offhand what GCC version I have there.

Paolo



Re: sed or gcc problem on Mac OS X

by Jim Meyering :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paolo Bonzini wrote:
>> I also built sed on ppc/linux with a recent gcc, and there
>> it had no problem.
>
> Hi Jim,
>
> you didn't say whether you used --with-included-regex, but I tried it
> on i686-linux and didn't have the problem.  I'll dust up my PPC Mac; I
> don't remember offhand what GCC version I have there.

Hi Paolo,

I didn't specify that option, but it did compile and use lib/regex.o.



Re: sed or gcc problem on Mac OS X

by Paolo Bonzini-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/17/2009 10:37 AM, Jim Meyering wrote:
> I didn't specify that option, but it did compile and use lib/regex.o.

I meant on Linux. :-)

Paolo



Re: sed or gcc problem on Mac OS X

by Jim Meyering :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paolo Bonzini wrote:
> On 10/17/2009 10:37 AM, Jim Meyering wrote:
>> I didn't specify that option, but it did compile and use lib/regex.o.
>
> I meant on Linux. :-)

I've confirmed that there is no problem on ppc/linux
also when configured/built --with-included-regex.