Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4011 invalid pathname caching?

obsolete: 8.6a0
closed-fixed
Don Porter
9
2008-06-23
2008-05-26
miguel sofer
No

Bytecompiling [uplevel]ed scripts (see uplevel.patch below) causes filesystem-1.11 to fail.

This seems to be due to improper spoiling of some intrep when the value is stored as a literal? It looks similar to [Bug #1972867], but filesystem-1.11 test is not so easy to run in isolation (it relies on some previous tests having been run?).

Discussion

  • miguel sofer
    miguel sofer
    2008-05-26

     
    Attachments
  • Don Porter
    Don Porter
    2008-05-27

    Logged In: YES
    user_id=80530
    Originator: NO

    Any relation to 953284?

     
  • miguel sofer
    miguel sofer
    2008-06-09

    Logged In: YES
    user_id=148712
    Originator: YES

    That patch has been committed to HEAD now

     
  • miguel sofer
    miguel sofer
    2008-06-09

    Logged In: YES
    user_id=148712
    Originator: YES

    That patch has been committed to HEAD now

     
  • Pat Thoyts
    Pat Thoyts
    2008-06-09

    Logged In: YES
    user_id=202636
    Originator: NO

    Possibly the following from Windows XP are relevant:
    ==== filesystem-1.3 link normalisation FAILED
    ==== Contents of test case:

    testPathEqual [file normalize [file join dir.dir foo]] [file normalize [file join dir.link foo]]

    ---- Result was:
    not equal: C:/opt/tcl/src/kitgen/8.6/tcl/win/dir.dir/foo C:/opt/tcl/src/kitgen/8.6/tcl/win/dir.link/foo
    ---- Result should have been (exact matching):
    1
    ==== filesystem-1.3 FAILED

    ==== filesystem-1.4 link normalisation FAILED
    ==== Contents of test case:

    testPathEqual [file normalize [file join dir.dir inside.file]] [file normalize [file join dir.link inside.file]]

    ---- Result was:
    not equal: C:/opt/tcl/src/kitgen/8.6/tcl/win/dir.dir/inside.file C:/opt/tcl/src/kitgen/8.6/tcl/win/dir.link/inside.file
    ---- Result should have been (exact matching):
    1
    ==== filesystem-1.4 FAILED

     
  • Don Porter
    Don Porter
    2008-06-16

    • priority: 5 --> 9
    • assigned_to: vincentdarley --> dgp
     
  • Don Porter
    Don Porter
    2008-06-20

    Logged In: YES
    user_id=80530
    Originator: NO

    dgp the difference is whether or not [file link] is compiled
    dgp why that difference makes a difference is.... mysterious
    dgp drilling down, using [eval] on just the [file join .. dir2.link] part is enough.
    dgp Ick. filesystem-1.11 depends on filesystem-1.10 ?
    dgp This is probably an actual bug
    dgp cd ~
    aku Seeing that I remember that one time somewhere I had to replace a [file join x y] with x/y, because the join command gave bogus results, and x/y didn't. Maybe because the latter forced everything through the string rep. Could of course be an unrelated problem in the path intrep. ... Found it
    aku 2007-08-08 Andreas Kupries <andreask@activestate.com>

    * inplace.test: Fixed failures of some tests on Windows.

    * fileutil.tcl: Working around a possible bug in the handling of
    path intreps by the core, on Windows. See commentary in
    'fullnormalize', and 'find.setup' (f_setupcircle).

     
  • Don Porter
    Don Porter
    2008-06-22

    Logged In: YES
    user_id=80530
    Originator: NO

    dgp confirmed that forcing a shimmer of the value {..} is sufficient to make test filesystem-1.11 pass again.
    dgp so I bet the shared literal of that relative pathname is getting a full path cached in it
    dgp ...and since [pwd] hasn't changed, that's getting used in an improper way
    dgp I fear this is wrapped up in an old debate about how [file link] is supposed to treat relative pathnames in the target value

     
  • Don Porter
    Don Porter
    2008-06-22

    Logged In: YES
    user_id=80530
    Originator: NO

    line 940, tclUnixFile.c

     
  • Don Porter
    Don Porter
    2008-06-23

     
    Attachments
  • Don Porter
    Don Porter
    2008-06-23

    Logged In: YES
    user_id=80530
    Originator: NO

    here's the patch.
    File Added: 1972879.patch

     
  • Don Porter
    Don Porter
    2008-06-23

    Logged In: YES
    user_id=80530
    Originator: NO

    Distributors of browsers that crash
    deserve death.

    I had a lengthy comment to accompany
    that patch. All lost when my attempt
    to upload the patch file brought the
    browser down. I'm in no mood to duplicate
    it now.

    This fix is a hack to correct a bug
    in Tcl_FSGetTranslatedPath. It's not
    elegant, but I think forcing us through
    string reps at least gives us something
    we know will work, without requiring me
    to reverse engineer the whole "path"
    Tcl_ObjType.

    The code getting replaced by this
    patch was simply wrong wrong wrong.
    It forced a complete normalization of
    the path, and the whole "point" of a
    translated path is that it is an
    expansion of ~ **without** forcing a
    full normalization. In particular,
    a relative path was being coerced into
    absolute form.

    Others are welcome to contribute better
    fix(es).

     
  • Don Porter
    Don Porter
    2008-06-23

    Logged In: YES
    user_id=80530
    Originator: NO

    committed to HEAD for 8.6a1.
    needs backport.

     
  • Don Porter
    Don Porter
    2008-06-23

    • status: open --> open-fixed
     
  • Don Porter
    Don Porter
    2008-06-23

    Logged In: YES
    user_id=80530
    Originator: NO

    Sleep is good. Better fix committed to HEAD.

     
  • Don Porter
    Don Porter
    2008-06-23

    • status: open-fixed --> closed-fixed
     
  • Don Porter
    Don Porter
    2008-06-23

    Logged In: YES
    user_id=80530
    Originator: NO

    backporting complete.