exec fails if external program outputs on stderr.
Closed / Fixed218167ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:54:03
OriginalBugID: 2252 Bug
Version: 8.0.4
SubmitDate: '1999-06-16'
LastModified: '1999-12-03'
Severity: SER
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: HP-UX
OSVersion: B.10.20 A 9000/782 2007715559
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-12-03'
Name: Thomas Joergensen
ReproducibleScript:
$ cat booh
#! /bin/ksh
print "Hello World."
print -u2 "Booh!"
$ cat catchbooh
#! /usr/local/bin/tclsh
puts [catch {exec ./booh} out]
$ ./catchbooh
1
Booh!
$
ObservedBehavior:
exec fails if the external program writes anything to stderr. This is
not
a wrong behavior of a program and should not in itself not throw an
exeption.
The Korn shell script exits normally with an exitcode of zero. If it
prints
to stdout (print "...") instead, it does not make exec throw an
exeption.
I take this to be a bug, since it is not described in either the
exec(3t) man
page nor in the "Tcl and the TK Toolkit" by John K. Ousterhout
DesiredBehavior:
An external program terminating with an exitcode of zero should not make
exec throw an exeption.
In the docs for exec for Tcl, it states:
If any of the commands writes to its standard error file and that standard error isn't redirected, then exec will return an error; the error message will include the pipeline's standard output, followed by messages about abnormal terminations (if any), followed by the standard error output.
-- 12/03/1999 hobbs
welch Closed ticket [218167ffff].
[History diff]2000-10-26 08:15:57
dgp Ticket [218167ffff]: 3 changes
[History diff]2001-04-05 08:20:14
Log in (anonymous is fine) to add a comment.