Skip to content
Tcl Source Code History Of Ticket bcd1004104
Login

History Of Ticket bcd1004104

Artifacts Associated With Ticket bcd1004104

  1. Ticket change [de6df813f6] (rid 175954) by pooryorick on 2019-10-22 14:27:51:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      The ext file system has no concept of "encoding":  It names a file exactly the
      sequence of octets it is handed.  In the following script, iso8859-1 is used to
      create a file, and then that same sequence of octets is obtained using
      <code>glob</code>.  Then an FsPath object created under a different system
      encoding is created and cached.  Later on that FsPath object is used under the
      original system encoding when it shouldn't be.
      
      <code><verbatim>
      set name  登鸛鵲樓
      
      encoding system iso8859-1
      
      # create an iso8859-1-compatible sequence of octets to name the file by.
      # They happen to be a string encoded in utf-8, but that's irrelevant.
      set utf8 [encoding convertto utf-8 $name]
      
      set chan [open $utf8 w]
      puts $chan hello
      close $chan
      
      #
      lassign [glob -directory [pwd] *$utf8*] fname
      
      # A file named by that sequence of octets exists. 
      puts [list iso8859-1 [file exists $fname]] ;#-> 1
      
      
      encoding system utf-8
      
      # The sequence of octets is now itself converted to utf-8. Such a file does not
      # exist, and a FsPath object has been cached.  So far so good.
      puts [list utf-8 [file exists $fname]] ;#-> 0
      encoding system iso8859-1
      
      # Here the answer here should be 1, but the FsPath object created under a
      # previous system encoding is used when it shouldn't be.
      puts [list iso8859-1 [file exists $fname]]  ;# -> 0
      
      # Discard the cached FsPath object, causing a new FsPath to be created using
      # the (currently correct) system encoding.
      puts [list iso8859-1 {string range} [file exists [string range $fname 0 end]]]  ;# -> 1
      </verbatim></code>
      
    5. is_private initialized to: "0"
    6. login: "pooryorick"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Important"
    10. status initialized to: "Open"
    11. submitter initialized to: "pooryorick"
    12. subsystem initialized to: "37. File System"
    13. title initialized to:
      A change to the system encoding, a stale cached file FsPath object, and an incorrect result
      
    14. type initialized to: "Bug"
  2. Ticket change [a145253983] (rid 175969) by pooryorick on 2019-10-22 18:10:35:

    1. comment changed to:
      The ext file system has no concept of "encoding":  It names a file exactly the
      sequence of octets it is handed.  In the following script, iso8859-1 is used to
      create a file, and then that same sequence of octets is obtained using
      <code>glob</code>.  Then an FsPath object created under a different system
      encoding is created and cached.  Later on that FsPath object is used under the
      original system encoding when it shouldn't be.
      
      <code><verbatim>
      set name  登鸛鵲樓
      
      encoding system iso8859-1
      
      # create an iso8859-1-compatible sequence of octets to name the file by.
      # They happen to be a string encoded in utf-8, but that's irrelevant.
      set utf8 [encoding convertto utf-8 $name]
      
      set chan [open $utf8 w]
      puts $chan hello
      close $chan
      
      #
      lassign [glob -directory [pwd] *$utf8*] fname
      
      
      
      encoding system utf-8
      
      # The sequence of octets is now itself converted to utf-8. Such a file does not
      # exist, and a FsPath object has been cached.  So far so good.
      puts [list utf-8 [file exists $fname]] ;#-> 0
      encoding system iso8859-1
      
      # Here the answer here should be 1, but the FsPath object created under a
      # previous system encoding is used when it shouldn't be.
      puts [list iso8859-1 [file exists $fname]]  ;# -> 0
      
      # Discard the cached FsPath object, causing a new FsPath to be created using
      # the (currently correct) system encoding.
      puts [list iso8859-1 {string range} [file exists [string range $fname 0 end]]]  ;# -> 1
      </verbatim></code>
      
    2. login: "pooryorick"
    3. mimetype: "text/plain"
  3. Ticket change [e82c4981ce] (rid 175987) by jan.nijtmans on 2019-10-22 22:11:24:

    1. assignee changed to: "pooryorick"
    2. icomment:
      Starting with [0f2870649c804dd8]: 
      <pre>
      encoding.test
      
      
      ==== encoding-2.2 Tcl_FreeEncoding: refcount != 0 FAILED
      ==== Contents of test case:
      
          encoding system shiftjis		;# incr ref count
          encoding dirs [list [pwd]]
          set x [encoding convertto shiftjis \u4e4e]	;# old one found
          encoding system iso8859-1
          llength shiftjis		;# Shimmer away any cache of Tcl_Encoding
          lappend x [catch {encoding convertto shiftjis \u4e4e} msg] $msg
      
      ---- Result was:
      ŒÁ 0 ŒÁ
      ---- Result should have been (exact matching):
      ŒÁ 1 {unknown encoding "shiftjis"}
      ==== encoding-2.2 FAILED
      </pre>
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  4. Ticket change [523cc39fb0] (rid 176083) by jan.nijtmans on 2019-10-24 08:29:22:

    1. icomment:
       Since Travis already fails for 2 days, I put the work on this ticket in a separate [bug-bcd1004104] branch. Please have a look: Something still wrong with the code, or should the test-case be revised?
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [686740113b] (rid 176143) by pooryorick on 2019-10-24 20:33:51:

    1. icomment:
      The failue of encoding-2.2 was fixed by adding a corresponding <code>Tcl_FreeEncoding</code> for the newly-added <code>Tcl_GetEncoding</code>.
      
      There's more work to be done on this issue though.  There might be undesired interactions between <code>FsPath.nativePathPtr</code> and <code>FsPath.filesystemEpoch</code>.  These are older issues, not something introduced by the current changes.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [da7e31e160] (rid 176155) by jan.nijtmans on 2019-10-24 21:04:02:

    1. icomment:
      Hm ...  Added the Tcl_FreeEncoding() now, it doesn't seem to work ...
      
      Anyway, I'll leave the branch to you, in case you want to work on it further. Please, next time, don't merge it to core-8-branch as long as you are not reasonable confident that all test-cases work.
      
      Thanks!
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  7. Ticket change [b1d5c06111] (rid 176156) by pooryorick on 2019-10-24 21:19:03:

    1. icomment:
      The initially-provided example behaves as described in core-8-6-branch, but in core-8-branch only behaves as described prior to commit [165586b224f85f10], "	TIP #430 implementation", 2018-09-12.  This is because even when built with <code>--disable-zipfs</code>, in core-8-branch there are calls to <code>ZipFSPathInFilesystemProc</code> from <code>Tcl_FSGetFileSystemForPath</code>, and <code>ZipFSPathInFilesystemProc</code> uses <code>Tcl_GetString(pathPtr)</code> instead of working with the <code>fsPathType</code> internal representation.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [49eca8a361] (rid 176157) by bll on 2019-10-24 23:01:10:

    1. icomment: "Unable to reproduce with tcl 8.6.9 on Linux."
    2. login: "bll"
    3. mimetype: "text/plain"
  9. Ticket change [7e11d2e608] (rid 176158) by bll on 2019-10-24 23:05:35:

    1. icomment:
      Unable to reproduce:
        8.6.9 on MX Linux 19
        8.6.5 on Ubuntu 16.04
      
    2. login: "bll"
    3. mimetype: "text/plain"
  10. Ticket change [ca1d22b259] (rid 176159) by bll on 2019-10-25 00:43:34:

    1. icomment: "Ok, reproduced."
    2. login: "bll"
    3. mimetype: "text/plain"
  11. Ticket change [f94e3082a9] (rid 176209) by pooryorick on 2019-10-26 15:42:06:

    1. icomment:
      Fixed in [440efbd556ce7041] for core-8-6-branch.  In contrast with the proposed fix for the core-8-branch, this is a one-line fix.  It should probably also be applied to core-8-branch, and additional work done there to refine the record keeping when system encoding changes.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  12. Ticket change [13c5511d64] (rid 176263) by jan.nijtmans on 2019-10-28 08:25:03:

    1. icomment:
      On UNIX, it appears to work, but all travis Windows builds are failing:
      
      <pre>
      ==== filesystemEncoding-1.0 issue bcd100410465 FAILED
      ==== Contents of test case:
      	set dir [tcltests::tempdir]
      	set saved [encoding system]
      	encoding system iso8859-1
      	set fname1a $dir/$fname1
      	set utf8name [encoding convertto utf-8 $fname1a]
      	makeFile {} $utf8name
      	set globbed [lindex [glob -directory $dir *] 0]
      	encoding system utf-8
      	lappend res [file exists $globbed]
      	encoding system iso8859-1 
      	lappend res [file exists $globbed]
      	return $res
          
      ---- Result was:
      1 1
      ---- Result should have been (exact matching):
      0 1
      ==== filesystemEncoding-1.0 FAILED
      </pre>
      
      This way Donald Porter cannot make his RC, so please have a look at this!
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  13. Ticket change [2acd81af3a] (rid 176264) by jan.nijtmans on 2019-10-28 08:25:16:

    1. login: "jan.nijtmans"
    2. mimetype: "text/plain"
    3. severity changed to: "Critical"
  14. Ticket change [b735aabba7] (rid 176272) by jan.nijtmans on 2019-10-28 08:58:50:

    1. icomment:
      I just removed the filesystemEncoding test-case now, knowing that this bug is still not solved for Windows. That means, it's not critical any more now.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
    4. severity changed to: "Important"
  15. Ticket change [5dc84be961] (rid 176309) by pooryorick on 2019-10-28 16:08:06:

    1. icomment:
      Maybe I'm wrong, but because NTFS has a native encoding whereas common *NIX filsystems do not, this test can not be adapted for NTFS.  Therefore it could be constrained to *NIX systems rather than removed.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  16. Ticket change [8c992d4309] (rid 176320) by pooryorick on 2019-10-28 16:11:46:

    1. icomment:
      The bug can not be reproduced on NTFS filesystems in the first place.  That's why with an NTFS filesystem the first result of filesystemEncoding-1.0 is <code>1</code> rather than <code>0</code>.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  17. Ticket change [5e0cc0d2fb] (rid 176321) by jan.nijtmans on 2019-10-28 16:21:10:

    1. icomment:
      Or ... just change the expected test result for UNIX ...
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  18. Ticket change [c7f42ad369] (rid 176325) by jan.nijtmans on 2019-10-28 16:25:29:

    1. icomment:
      > Or ... just change the expected test result for UNIX ...
      
      Of course, I meant Windows here ....
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  19. Ticket change [a97e4a452f] (rid 176330) by jan.nijtmans on 2019-10-28 16:41:56:

    1. icomment:
      Well, I put back the test, so is this one fixed now?
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"
  20. Ticket change [5f828e2f8a] (rid 176344) by pooryorick on 2019-10-28 19:26:14:

    1. closedate changed to: "2458785.30988954"
    2. closer changed to: "pooryorick"
    3. login: "pooryorick"
    4. mimetype: "text/plain"
    5. status changed to: "Closed"