bug-coreutils
[Top][All Lists]
Advanced

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

Re: [coreutils] coreutils-7.0 expr exposes long-standing bug in matlab s


From: Martin Knapp-Cordes
Subject: Re: [coreutils] coreutils-7.0 expr exposes long-standing bug in matlab startup script
Date: Tue, 21 Oct 2008 10:31:42 -0400 (EDT)

Hello,

I would like to respond to any earlier claim made that
there is a "long-standing bug in matlab startup script".
We at the MathWorks disagree.

Please observe the following by reading carefully
the online documentation for the Open Group Standard,
UNIX Version 3, expr command. The POSIX standard is
subsumed under this standard. (IEEE Std 1003.1, 2004
edition)

http://www.unix.org/version3

You will have to sign in to look at the standard.

1. There are NO options allowed in the expr command.
2. A string argument is an argument that cannot be identified
   as an integer argument or as one of the expression
   operator symbols ...

In addition it was stated by one author:

"many scripts out there assume that "expr -1 + 1" evaluates to
zero."

This is NOT an assumption. It is the REQUIRED behavior in
order to be a STANDARD conforming shell script.

Most important, the version of software under consideration
is 'alpha' software. There is a bug in the software and it MUST
be fixed before it becomes live. A fix will return it to the CORRECT STANDARD behavior. This is NOT an issue of simply returning to
old behavior in order to not break existing scripts.

Here are the details of what we did to verify the bug
and experiment with one of the proposed fixes.

We downloaded and built on a 64-bit Linux machine
coreutils-7.0.tar.gz from alpha.gnu.org.

Using:  ./configure && make && make install

Here is the behavior:

% ./expr -3
-3
% ./expr 3a
3a
% ./expr +3a
+3a
% ./expr -3a
... syntax error

-3a is clearly a string and should return:

-3a

But it doesn't. This is a bug.

We modified the expr.c source and made the changes
suggested by Jim Meyering and those fixed this problem.

We ran the MATLAB script using that fixed version of expr
and the MATLAB script starts up fine as it should.

I want to thank Greg Wolodkin of the MathWorks for his
expert help with this problem.

Sincerely,
Martin Knapp-Cordes

[THREAD ID: 1-7QTC1H]

---------------------------------------------------------------
|  Martin Knapp-Cordes               address@hidden     |
|  The MathWorks, Inc.               http://www.mathworks.com |
|  3 Apple Hill Drive                Natick, MA  01760        |
|  Tel: (508) 647-7321               Fax: (508) 647-7015      |
---------------------------------------------------------------




reply via email to

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