Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-10-06
05:10 • Ticket [1109294fff] Tcl_OpenFileChannel doesn't say that argv must end in NU... artifact: 0640f9294e user: andreas_kupries
05:10 • Ticket [1109294fff]: 4 changes artifact: 9b25afd7c0 user: andreas_kupries
05:10 • Closed ticket [1109294fff]. artifact: 19bd175ac3 user: andreas_kupries
2005-02-01
17:14 • Ticket [1109294fff]: 5 changes artifact: 24c24cb9be user: dkf
2005-01-28
06:20 • Ticket [1109294fff]: 4 changes artifact: a036670056 user: davidw
2005-01-26
21:50 • Ticket [1109294fff]: 4 changes artifact: e5c0cbc2b6 user: dgp
06:15 • Ticket [1109294fff]: 4 changes artifact: c27cfe679a user: davidw
06:15 • Ticket [1109294fff]: 4 changes artifact: 7d359aeaf8 user: davidw
06:15 • Add attachment 1109294.diff to ticket [1109294fff] artifact: 15604ce19f user: davidw
02:02 • Ticket [1109294fff] Tcl_OpenFileChannel doesn't say that argv must end in NU... artifact: 54599f27db user: andreas_kupries
2005-01-25
18:50 • New ticket [1109294fff]. artifact: a57052887d user: davidw

Tcl_OpenFileChannel doesn't say that argv must end in NULL

Closed / Fixed1109294fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2005-01-25 18:50:40
The comments for 

int
TclCreatePipeline(interp, argc, argv, pidArrayPtr,
inPipePtr,
outPipePtr, errFilePtr)

say that:

    CONST char **argv;/* Array of strings describing
commands in
 * pipeline plus I/O redirection with <,
 * <<,  >, etc.  Argv[argc] must be NULL. */

But the documentation for Tcl_OpenFileChannel makes no
mention of this!  Either the documentation should be
changed, or the command should dispense with the final
NULL requirement (it has an argc, so why does it need a
final NULL, too?).
andreas_kupriesplain2005-01-26 02:02:04
Logged In: YES 
user_id=75003

Note: David had a mem corruption issue and crash because of
this. The easy fix, updating the docs, might not be the
right fix.

This needs a deeper look.
davidwplain2005-01-26 06:15:41
Logged In: YES 
user_id=240

I whipped up the following patch, which eliminates the
requirement for argv[argc] to exist and be NULL.  It works
for me, and seems to pass the relevant tests.  I've got a
nasty case of the flu, so my addled brain may have missed
something:-)
davidwplain2005-01-26 06:15:42
File Added - 117153: 1109294.diff
dgpplain2005-01-26 21:50:43
Logged In: YES 
user_id=80530

Note that pre-patch, the
TclCreatePipeline routine
ignores the value of its
argc argument.  Note also
the comment that the
routine is directly called
by BLT.  Would be wise to
check whether BLT relies on
the argc value getting ignored.
davidwplain2005-01-28 06:20:57
Logged In: YES 
user_id=240

I couldn't find TclCreatePipeline in the version of BLT that
ships with Debian: 2.4z
dkfplain2005-02-01 17:14:16
Logged In: YES 
user_id=79902

OK, in that case (BLT no longer using it) just fix it so
that argv[argc] is never referred to.
andreas_kupries Closed ticket [1109294fff]. [History diff]2005-10-06 05:10:10
andreas_kupriesplain2005-10-06 05:10:11
Logged In: YES 
user_id=75003

Accepted the patch and applied to both 8.4 and cvs head.
andreas_kupries Ticket [1109294fff]: 2 changes [History diff]2005-10-06 05:10:13
Log in (anonymous is fine) to add a comment.

Attachments: