| Ticket UUID: | 3103656 | ||
| Title: | Case insensitive test result for test winFCmd-19.7 | ||
| Type: | Bug | Created on: | 2010-11-05 14:56:58 |
| Submitter: | decosterjos | Assigned to: | dgp |
| Subsystem: | 37. File System | Severity: | |
| Priority: | 5 Medium | Last modified: | 2010-11-12 21:20:38 |
| Status: | Open | Closed by: | |
| Resolution: | None | Closed on: | |
| Version: | obsolete: 8.5.9 | ||
| Description: | ||||
==== winFCmd-19.7 Windows extended path names FAILED
==== Contents of test case:
list [catch {
set f [open $tmpfile [list WRONLY CREAT]]
close $f
} res] $res [glob -directory $::env(TEMP) -tails tcl[pid].*]
---- Result was:
0 {} TCL7176.tmp
---- Result should have been (exact matching):
0 {} tcl7176.tmp
==== winFCmd-19.7 FAILED
| ||||
| User Comments: | ||||
nijtmans added on 2010-11-05 23:00:05:
What platform? (XP, Vista, Win7) Tcl version? (8.5.x, 8.6bx, HEAD) Why did I never see this problem in my environment? decosterjos added on 2010-11-05 23:11:44:
Vista, CVS HEAD decosterjos added on 2010-11-05 23:55:58:
> Why did I never see this problem in my environment? I'm using the Makefile.vc from a Dos-box, maybe you're using msys? nijtmans added on 2010-11-11 22:41:45:
On Windows XP, with a fresh HEAD compile (compiled with mingw, but tests run from a DOS box, so that should be EXACTLY the same as VC++ 6.0): ========================================================= C:\workspace\tcl8.6\tests>..\win\tcltest all.tcl -file winFCmd.test -match winFCmd-19.7 Tests running in interp: C:/workspace/tcl8.6/win/tcltest.exe Tests located in: C:/workspace/tcl8.6/tests Tests running in: C:/workspace/tcl8.6/tests Temporary files stored in C:/IBM/WCDE_ENT70/workspace/tcl8.6/tests Test files run in separate interpreters Running tests that match: winFCmd-19.7 Skipping test files that match: l.*.test Only running test files that match: winFCmd.test Tests began at Thu Nov 11 16:33:44 +0100 2010 winFCmd.test Tests ended at Thu Nov 11 16:33:44 +0100 2010 all.tcl:Total190Passed1Skipped189Failed0 Sourced 1 Test Files. ========================================================== dkf added on 2010-11-11 23:28:10:
Might depend on filesystem in use. Jos and Jan, can you compare notes on this? decosterjos added on 2010-11-12 00:40:14:
I'm using NTFS. Jos. decosterjos added on 2010-11-12 04:23:40:
This seems to be a problem with [file normalize], and it is not happening in every run. I printed tmpfile before and after the [file normalize] statement in test 19-7. Next shown 2 runs, one good one bad:
C:\tmp\tclhead\tcl\tcl\tests>..\win\Release_VC10\tclsh86t.exe all.tcl -file winF
Cmd.test -match winFCmd-19.7
Tests running in interp: C:/tmp/tclhead/tcl/tcl/win/Release_VC10/tclsh86t.exe
Tests located in: C:/tmp/tclhead/tcl/tcl/tests
Tests running in: C:/tmp/tclhead/tcl/tcl/tests
Temporary files stored in C:/tmp/tclhead/tcl/tcl/tests
Test files run in separate interpreters
Running tests that match: winFCmd-19.7
Skipping test files that match: l.*.test
Only running test files that match: winFCmd.test
Tests began at Thu Nov 11 22:14:53 +0100 2010
winFCmd.test
C:/Users/decoster/AppData/Local/Temp/tcl1540.tmp
C:/Users/decoster/AppData/Local/Temp/TCL1540.tmp
==== winFCmd-19.7 Windows extended path names FAILED
==== Contents of test case:
list [catch {
set f [open $tmpfile [list WRONLY CREAT]]
close $f
} res] $res [glob -directory $::env(TEMP) -tails tcl[pid].*]
---- Result was:
0 {} TCL1540.tmp
---- Result should have been (exact matching):
0 {} tcl1540.tmp
==== winFCmd-19.7 FAILED
Tests ended at Thu Nov 11 22:14:53 +0100 2010
all.tcl: Total 190 Passed 0 Skipped 189 Failed 1
Sourced 1 Test Files.
Files with failing tests: winFCmd.test
C:\tmp\tclhead\tcl\tcl\tests>..\win\Release_VC10\tclsh86t.exe all.tcl -file winF
Cmd.test -match winFCmd-19.7
Tests running in interp: C:/tmp/tclhead/tcl/tcl/win/Release_VC10/tclsh86t.exe
Tests located in: C:/tmp/tclhead/tcl/tcl/tests
Tests running in: C:/tmp/tclhead/tcl/tcl/tests
Temporary files stored in C:/tmp/tclhead/tcl/tcl/tests
Test files run in separate interpreters
Running tests that match: winFCmd-19.7
Skipping test files that match: l.*.test
Only running test files that match: winFCmd.test
Tests began at Thu Nov 11 22:14:53 +0100 2010
winFCmd.test
C:/Users/decoster/AppData/Local/Temp/tcl5720.tmp
C:/Users/decoster/AppData/Local/Temp/tcl5720.tmp
Tests ended at Thu Nov 11 22:14:53 +0100 2010
all.tcl: Total 190 Passed 1 Skipped 189 Failed 0
Sourced 1 Test Files.
nijtmans added on 2010-11-12 05:42:29:
I don't know if [file normalize] is allowed to uppercase
the directory, but if it is then the simplest solution is
the following patch. [filr normalize] behavior is
not the object of this test case, so I have no
problem doing that. (even though it is not a
real fix......)
Strange that test 19.8, which does almost exactly the
same, doesn't have this problem (or does it?). It
really looks like a strange Windows problem, which
has nothing to do with Tcl.......
I installed VC++ 10.0 on my Windows 7, and ran this
test many times, but I still never see the failure. ;-(
And I am using NTFS too.
===============================
diff -u -r1.46 winFCmd.test
--- tests/winFCmd.test10 Nov 2009 20:40:06 -00001.46
+++ tests/winFCmd.test11 Nov 2010 22:33:07 -0000
@@ -1493,16 +1493,16 @@
catch {file delete $tmpfile}
} -result [list 0 {}]
test winFCmd-19.7 {Windows extended path names} -constraints nt -setup {
- set tmpfile [file join $::env(TEMP) "tcl[pid].tmp "]
+ set tmpfile [file join $::env(TEMP) "TCL[pid].TMP "]
set tmpfile [file normalize $tmpfile]
} -body {
list [catch {
set f [open $tmpfile [list WRONLY CREAT]]
close $f
- } res] $res [glob -directory $::env(TEMP) -tails tcl[pid].*]
+ } res] $res [glob -directory $::env(TEMP) -tails TCL[pid].*]
} -cleanup {
catch {file delete $tmpfile}
-} -result [list 0 {} [list tcl[pid].tmp]]
+} -result [list 0 {} [list TCL[pid].TMP]]
test winFCmd-19.8 {Windows extended path names} -constraints nt -setup {
set tmpfile [file join $::env(TEMP) "tcl[pid].tmp "]
set tmpfile //?/[file normalize $tmpfile]
decosterjos added on 2010-11-12 15:23:36:
Hi,
Maybe we should change the object of this discussion to [file normalize], and not just test 19.7. This is my test setup:
In file 't.tcl':
set tmpfile [file join $::env(TEMP) "tcl[pid].tmp "]
set normfile [file normalize $tmpfile]
if {$tmpfile ne $normfile} {
puts "QWERTY: $tmpfile ne $normfile"
}
In file 'test.tcl':
while 1 {
puts [incr i]
set txt [exec ../win/release_vc10/tclsh86t.exe t.tcl]
foreach l [split $txt \n] {
if {[string match "QWERTY*" $l]} {
puts $txt
exit 1
}
}
}
And I run test.tcl until it reports an error. Sometime take > 100 iterations before it gives the error, sometimes only once. I'm trying to trace this issue in [file normalize].
Jos.
nijtmans added on 2010-11-12 18:54:52:
I suspect the function TclpObjNormalizePath (tclWinFile.c), which is doing some complicated things related to file normalization. decosterjos added on 2010-11-12 19:54:51:
Yes, I see FindFirstFileW being called once more in the failing case. nijtmans added on 2010-11-12 20:13:58:
That could be explained by the function NativeStat, which takes different routes. First it tries CreateFile, then GetFileAttributesEx, and if that fails too it uses FindFirstFileW as a final attempt to get a handle. I could imagine that file normalization is different for files that are accessable (those might have a DOS-compatible name as well) than files that are not accessable. When I run your example the first time, I got: QWERTY: C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/tcl128.tmp ne C:/Documents and Settings/Administrator/Local Settings/Temp/tcl128.tmp Manually changing the TEMP environment variable to the long form, I could run your example more than 50000 times without any failure. So, I suspect that your problem has to do with file accessability. Do you have something like a virus checker running which claims the temporary files just enough to make it temporary not accessable? That the direction I would search for. That would explain why no-one else saw this before.... nijtmans added on 2010-11-12 20:19:01:
B.T.W. Does Tcl 8.5 have the same problem? decosterjos added on 2010-11-12 20:29:18:
Same issue with Tcl8.5 and with virus scanner disabled (8.5 and 8.6). Changing env(TMP) to env(HOME) seems to fix the issue. When using env(TMP), adding some printf statements to the involved functions in the core seems to make the issue disappear too. nijtmans added on 2010-11-12 20:33:01:
Have a look at [Bug 2893771], I guess that with this patch your problem started, and that means that Tcl 8.5 is fine. Could you go back to a CVS version of Nov 23 and see if this versions is fine, while a version of Nov 25 gives this problem? =============================================== In the ChangeLog: 2009-11-24 Pat Thoyts <[email protected]> * tests/fCmd.test: [Bug 2893771]: Teach [file stat] to handle locked * win/tclWinFile.c: files so that [file exists] no longer lies. nijtmans added on 2010-11-12 20:37:14:
So, my hypothesis was wrong: if Tcl 8.5 has the same problem, then [Bug 2893771] is not the cause, simply because this patch was not backported (maybe it should.....)! nijtmans added on 2010-11-12 20:44:04:
If 8.5 has the same problem, probably already a long time, then I don't think this Issue should have high prio. I wouldn't block 8.6b2 for it. Changed Group to current: 8.5.9, so it is clear that 8.6 didn't introduce this! nijtmans added on 2010-11-12 21:16:14:
Finally, I saw it once. After 144443 runs, test number 144444 failed! decosterjos added on 2010-11-12 21:20:38:
Thanks for being so patient :-) | ||||
