Artifacts Associated With Ticket 578159ffffffffffffffffffffffffffffffffff
Ticket change [64419d78cb] (rid 92728) by kennykb on 2002-07-06 17:50:13:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The 'exec-18.1' test fails under Windows NT 4.0SP6 in the latest HEAD: ==== exec-18.1 exec cat deals with weird file names FAILED ==== Contents of test case: set f "foo\[\{blah" set path(fooblah) [makeFile {} $f] set fout [open $path(fooblah) w] puts $fout "contents" close $fout set res [list [catch {exec cat $path(fooblah)} msg] $msg] removeFile $f set res ---- Result was: 1 {/usr/bin/cat: D:/SourceForge/tcl/win/foo[\: No such file or directory} ---- Result should have been (exact matching): 0 contents ==== exec-18.1 FAILED - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "kennykb"
- subsystem initialized to: "27. Channel Types"
- title initialized to: "exec-18.1 fails under WinNT"
- type initialized to: "Bug"
Ticket change [07a9c1b2d7] (rid 89443) by kennykb on 2002-07-07 01:02:36:
- foundin changed to: "obsolete: 8.4b1"
Ticket change [2655a9dd86] (rid 88326) by nobody on 2002-07-08 15:44:33:
- icomment:
Logged In: NO Given this worked a week ago, I think it is due to the various tcltest and test suite changes that this has now broken, and is not a channel problem at all.
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [01746a90b5] (rid 119487) by vincentdarley on 2002-07-08 19:24:06:
- icomment:
Logged In: YES user_id=32170 The previous version of test 18.1: test exec-18.1 { exec cat deals with weird file names} {execCommandExists} { set f "foo\[\{blah" set fout [open $f w] puts $fout "contents" close $fout set res [list [catch {exec cat $f} msg] $msg] file delete $f set res } {0 contents} works fine, so the problem is in the makeFile etc changes introduced three days ago by Andreas (or in the actual functions 'tcltest::makeFile' etc themselves) - login: "vincentdarley"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- subsystem changed to: "34. tcltest Package"
- username: "vincentdarley"
- icomment:
Ticket change [d39ef9d149] (rid 123321) by andreas_kupries on 2002-07-09 03:33:25:
- assignee changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=75003 Sorry Vince. The difference the between the old and new testcase is whether 'exec cat' is given a relative path (old), or an absolute path (new). I added some debug output to winPipe, to get a look at the actual command executed (in BuildCommandLine, just before the conversion to TChar*). The old test runs: C:\cygwin\bin\cat.exe foo[\{blah and the new test calls C:\cygwin\bin\cat.exe C:/cygwin/home/Administrator/84/b/foo[\{blah In the second case something cuts the path off after the '[\', just before the brace. Adding a [file nativename] around the absolute path does not help. The command now run is C:\cygwin\bin\cat.exe C:\cygwin\home\Administrator\84 \b\foo[\{blah and is cut off as before. To me this looks like a quoting issue in exec, and not as a problem of the testcase. Except that the testcase uncovers the problem now. Handing over. - login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
Ticket change [64de456c71] (rid 92845) by davygrvy on 2002-07-09 09:38:10:
- icomment:
Logged In: YES user_id=7549 >To me this looks like a quoting issue in exec, and not as a >problem of the testcase. Except that the testcase uncovers >the problem now. If what BuildCommandline is outputing correctly, but the result of what's launched is wrong, then the quoting rules used for concatenating argv into a string aren't proper for CreateProcess(). There's some funny stuff with how CreateProcess() expects it's commandline and doesn't seem to be documented well. Esentially, it goes from array->string->array through the system and the last array goes out wrong. I've seen this before, but don't have a good hold on why.
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [5af67be396] (rid 118236) by davygrvy on 2002-07-09 10:00:10:
- icomment:
Logged In: YES user_id=7549 see 528669 as well. SetArgv() from tclAppInit.c should equal BuildCommandLine() but in reverse. At least, that's the concept and might be an msvcrt bug...
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [e56ef8b28c] (rid 104120) by vincentdarley on 2002-07-09 16:03:33:
- assignee changed to: "davygrvy"
- icomment:
Logged In: YES user_id=32170 'fraid this isn't my area of expertise at all. All I know is that this used not to work, then it was fixed recently, but now this new failure seems to indicate that it was only a partial fix, which worked for a simple relative path, but not for an absolute one.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Ticket change [a93d4881d0] (rid 99121) by davygrvy on 2002-07-09 18:02:51:
- icomment:
Logged In: YES user_id=7549 [exec] itself seems OK from this: % set f "foo\[\{blah" foo[{blah % exec cmd.exe /c echo $f foo[{blah % --still testing-- - login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [72d0a42666] (rid 104928) by vincentdarley on 2002-07-09 19:16:43:
- icomment:
Logged In: YES user_id=32170 It would seem to be a bug in cat? % exec cat /c/foo\[\{blah contents % exec cat c:/foo\[\{blah /usr/bin/cat: c:/foo[\: No such file or directory % exec cat foo\[\{blah contents % - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [3e106bc7da] (rid 121199) by nobody on 2002-07-09 22:42:57:
- icomment:
Logged In: NO Since it looks as if 'exec' is working, and just 'cat' is broken, perhaps this test can be marked 'knownBug' (on Windows anyway) with a comment to the effect that it is a problem in cat, and a new test can be added which does a 'cd $tempDirectory' and only uses the file tail of the [{ path. Then we can close this bug (but perhaps someone should report the problem to whoever maintains cygwin's 'cat'). That's if my understanding of the situation is right... - login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [3023ec2eeb] (rid 93198) by kennykb on 2002-07-09 23:50:07:
- icomment:
Logged In: YES user_id=99768 Perhaps we could use some Tcl script in place of 'cat'? Or use a Windows-supplied command in place of it? (Why an extra dependency on cygwin, anyway?)
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [01b60692d9] (rid 119531) by andreas_kupries on 2002-07-10 00:22:09:
- icomment:
Logged In: YES user_id=75003 Please note that all the failing commands are completely ok when cat is run from the cygwin bash shell. To me this indicates that there is no error in 'cat', but in the way exec provides the arguments to it. The only way to be sure is to get hold of the sources of cat and modify it to display the arguments it gets. Speculation: Given that the filename is cutoff immediately after the last \, used to quote the brace: cat might get the full filename, i.e. no error in exec, but interpret the \{ as path-separator + brace, and report a missing directory. The original bug report which prompted this new testcase was http://sourceforge.net/tracker/index.php? func=detail&aid=554068&group_id=10894&atid=110894 As this is about [exec] an external application is required. Wht we could do is to execute a small test script which simply reports the arguments it got, instead of 'cat'. - login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [c20dc03622] (rid 111434) by davygrvy on 2002-07-10 02:12:12:
- icomment:
Logged In: YES user_id=7549 >To me this >indicates that there is no error in 'cat', but in the way exec >provides the arguments to it. There might be some "funny stuff" in the way cat.exe parses GetCommandLine() [the string] into it's argv array that might be a bit different than the "accepted way". That's the shyly documented part of CreateProcess() and seems to be left to the C run-time. Having the invoker [bash] launch the child [cat], there's a very good chance the parsing rules are a pure pass-through with a possibly different parsing rule set that this test happens to be exercising now. I can't say for sure if `cmd.exe /c echo` is a good test either for testing argv parsing. Can we assume the "accepted way" is the algorithm in msvcrt's setargc.c for parse_cmdline()?
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [235c36ef03] (rid 130913) by davygrvy on 2002-07-10 07:44:29:
- icomment:
Logged In: YES user_id=7549 >Can we assume the "accepted way" is the algorithm in >msvcrt's setargc.c for parse_cmdline()? Whoops, I meant msvcrt's parse_cmdline() found in crt/src/stdargv.c
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [375bb3ee1f] (rid 107256) by davygrvy on 2002-07-10 09:22:01:
- icomment:
Logged In: YES user_id=7549 Should I put together a command in tclTest.c for asserting cases for tclWinPipe.c's BuildCommandLine() vs. msvcrt's parse_cmdline() ? I did something like this for Expect and it looked like this: // Test the full pass-thru // int TestPassThruCmd (int objc, struct Tcl_Obj * CONST objv[]) { char **argvIn = new char * [objc-1]; int i, argc; char *line, **argv; Tcl_Obj **oobjv; // Take the array and turn it into a string. for (i = objc-1; i > 0; i--) argvIn[i-1] = Tcl_GetString (objv[i]); line = BuildCommandLine(objc-1, argvIn); // Now take the string and turn it back into an array. SetArgv(line, &argc, &argv); delete [] line; oobjv = new Tcl_Obj * [argc]; for (i = 0; i < argc; i++) oobjv[i] = Tcl_NewStringObj (argv[i], -1); Tcl_SetObjResult(interp, Tcl_NewListObj(argc, oobjv)); return TCL_OK; } - login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [f9a2221aa8] (rid 91739) by andreas_kupries on 2002-07-10 10:13:26:
- icomment:
Logged In: YES user_id=75003 A good idea. Yes, please.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [bc3b85bba8] (rid 129638) by hobbs on 2002-08-08 14:14:55:
- priority changed to: "6"
Ticket change [39133d8fb6] (rid 112325) by dgp on 2003-01-07 06:16:26:
- subsystem changed to: "27. Channel Types"
Ticket change [ffb5196143] (rid 108800) by hobbs on 2003-11-11 04:24:05:
- closedate changed to: "2003-11-10T21:24:05"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 No test failure in pre-8.4.5 cvs.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "hobbs"