[25458] in Athena Bugs
linux 9.2.25: /usr/athena/bin/gathrun
daemon@ATHENA.MIT.EDU (Chris Toepel)
Wed Jan 21 15:49:43 2004
Message-Id: <200401212049.i0LKnNUF016275@meeko.mit.edu>
To: bugs@mit.edu
Date: Wed, 21 Jan 2004 15:49:23 -0500
From: Chris Toepel <ctoepel@mit.edu>
Errors-To: bugs-bounces@mit.edu
System name: meeko.mit.edu
Type and version: i686 9.2.25 (with mkserv)
Display type: Matrox Graphics, Inc. MGA G400 AGP (rev 85)
Shell: /bin/athena/tcsh
Window manager: sawfish
What were you trying to do?
Invoke matlab with a parameter: "-ver 5.3.1"
athena% gathrun matlab -ver 5.3.1
But The fact that I was using matlab is irrelevant, as I found
bug(s) in gathrun.
What's wrong:
gathrun gives this error:
athena% gathrun matlab -ver 5.3.1
Error, values for height (1..25) & width (1..80)
What should have happened:
It should have worked as I intended (as the Usage claims)
OR had a different Usage description
OR given an appropriate error message
(I have more detailed what-should-have-happened below)
Please describe any relevant documentation references:
The Usage man page and in the no-argument invocation is...
Usage: gathrun locker [program] [args ...]
This implies that the program name can be omitted if it is the
same as the locker name and arguments can still be appended.
Looking at the script in /usr/athena/bin/gathrun, this is not
the behavior. The program run is always the second argument
whenever there are more than one argument. This means that
when invoked with "gathrun matlab -ver 5.3.1", $locker = "matlab" and
$program = "-ver", followed by argument "5.3.1".
Since attachandrun --check "$locker" "$program" "$@" fails,
gdialog is invoked like this:
gdialog --msgbox "$program is not...in the $locker locker..." 0 100
gdialog should never be called with a 0. Trying this alone creates
my original error:
athena% gdialog --msgbox "hello world" 0 100
Error, values for height (1..25) & width (1..80)
gdialog has peculiar behavior where any height and width >0 produces
the same box, but it should be >0 for sure.
In summary I have 3 points:
1) EITHER
The Usage should be changed in the script's case 0 and in the man
page to look like this:
Usage: gathrun locker [program [args ...]]
OR
The script should be improved to check for the the second argument
as a program name:
...
if attachandrun --check "$locker" "$program"; then
exec /bin/athena/attachandrun "$locker" "$program" "$program" "$@"
else
if attachandrun --check "$locker" "$locker"; then
exec /bin/athena/attachandrun "$locker" "$locker" "$locker" \
"$program" "$@"
else
gdialog ...
fi
fi
2) The call to gdialog should have size parameters >0, such as:
gdialog --msgbox "..." 1 1
3) Finally, the man page prose description makes no explanation of
argument handling, so this situation should be clarified there
whether or not the behavior is changed.