Skip to content
Tcl Source Code History Of Ticket 417111ffffffffff
Login

History Of Ticket 417111ffffffffff

Artifacts Associated With Ticket 417111ffffffffff

  1. Ticket change [75f0361953] (rid 105480) by hemanglavana on 2001-04-18 17:03:16:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      On solaris2.6 platform, if a directory contains a
      softlink that refers
      to a non-existant file, then the above glob command
      results in
      error/abort:
      
      hlavana-u5:6> ls -l
      total 16
      -rw-r--r--   1 hlavana  eng8           0 Apr 18 10:00
      junk
      lrwxrwxrwx   1 hlavana  eng8           4 Apr 18 09:06
      link -> junk
      hlavana-u5:7> ~/sw/bin/tclsh8.3
      % info patch
      8.3.3
      % glob -type r *
      link junk
      % file delete junk
      % glob -type r *
      stat failed on known file
      Abort
      hlavana-u5:8> 
      
      Hemang.
      
    4. foundin initialized to: "obsolete: 8.3.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "hemanglavana"
    9. subsystem initialized to: "37. File System"
    10. title initialized to: "error in "glob -type r *""
    11. type initialized to: "Bug"
  2. Ticket change [f693835675] (rid 130325) by dgp on 2001-04-19 01:18:12:

    1. subsystem changed to: "36. Pathname Management"
    2. title changed to: "error in "glob -type r *""
  3. Ticket change [1aa35632eb] (rid 123013) by hobbs on 2001-08-07 07:25:19:

    1. assignee changed to: "vincentdarley"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      Verified on Linux.  The stat should be caught somehow 
      internally.
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. title changed to: "error in "glob -type r *""
    6. username: "hobbs"
  4. Add attachment "panic.diff" [07fd699c9b] (rid 89492) by vincentdarley on 2001-08-09 00:33:13.

  5. Ticket change [a86e62bc4a] (rid 98991) by vincentdarley on 2001-08-09 00:33:13:

    1. icomment:
      
      
      File Added - 9378: panic.diff
      
      Logged In: YES 
      user_id=32170
      
      This behaviour is clearly determined here in tclUnixFile.c:
      
          if (TclpStat(fname, &buf) != 0) {
      panic("stat failed on known file");
          }
      
      Perhaps a better solution to this would be that in the 
      attached patch (which I should point out I have no way of 
      testing at all).
      
      
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. title changed to: "error in "glob -type r *""
    5. username: "vincentdarley"
  6. Ticket change [ab8f3d7bc3] (rid 101137) by dkf on 2001-08-10 15:18:54:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      The patch looks OK to me, though it is still possible for
      the panic() to be invoked in an unfortunate way if a file
      gets deleted between the readdir() and the TclpLstat(),
      which could happen (for example) if the OS decided to switch
      to another process when the stat() was performed.
      
      All this leads me to ask whether panic() is really the right
      behaviour here, or whether it would be better to just fail
      that directory entry silently, pretending that it was never
      there in the first place.  What is certain is that panic()
      is not an appropriate response to a bad link!
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. title changed to: "error in "glob -type r *""
    5. username: "dkf"
  7. Ticket change [1e79c92843] (rid 90985) by hemanglavana on 2001-08-13 20:44:54:

    1. icomment:
      Logged In: YES 
      user_id=81875
      
      I have verified the patch on solaris platform. It does not
      abort anymore for the specific example I had submitted
      earlier.  However, it does not return the name of link file.
      This means that I cannot use "glob -type r *" command to
      find and delete all files of tye link. Also, "file exists
      link" returns 0 even though the link name exists - I think
      it should return 1.
      
      lavana@zodiac: [5] ls -l
      total 8
      -rw-r--r--   1 lavana   cbltesters      0 Aug 11 12:13 abc
      lrwxrwxrwx   1 lavana   cbltesters      4 Aug 11 12:06 link
      -> junk
      lavana@zodiac: [6] tclsh8.4
      % glob -type r *
      abc
      % glob *
      link abc
      % file exists link
      0
      % exit
      lavana@zodiac: [7] 
      
      
      
      
    2. login: "hemanglavana"
    3. mimetype: "text/plain"
    4. title changed to: "error in "glob -type r *""
    5. username: "hemanglavana"
  8. Ticket change [f9f7b0e8a5] (rid 91787) by dkf on 2001-08-13 21:33:08:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Of course you can't use [glob -type r *] to find all files
      of type link; it gives a list of readable files, and links
      without a target are not readable in any normal sense.  If
      you want links, use [glob -type l *] (if I'm not greatly
      mistaken...)
      
      The real question here is what do we want the semantics of
      broken links to be?  One possibility is that they are
      filenames without a file to go with them...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. priority changed to: "9 Immediate"
    5. title changed to: "error in "glob -type r *""
    6. username: "dkf"
  9. Ticket change [5a99efb9bf] (rid 118171) by vincentdarley on 2001-08-16 00:44:24:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      I have to say I don't know what the semantics of broken 
      links should be in Tcl.  The current behaviour (after this 
      patch is applied) is ok, but we probably should examine 
      Tcl's filesystem in general and see where it might be 
      tripped up by files disappearing on it, and then take 
      appropriate, consistent action everywhere.
      
      I'll put this patch into the core and mark this bug closed 
      when I apply some other small filesystem changes which have 
      cropped up.
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. title changed to: "error in "glob -type r *""
    5. username: "vincentdarley"
  10. Ticket change [93a9aca61c] (rid 105855) by hobbs on 2001-08-16 00:57:50:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      I don't think Tcl should ever panic on inconsistencies in 
      the file system like this.  Return an error maybe, but not 
      panic - that bombs out of everything.  This is a language, 
      and it should be fault tolerant to the underlying system as 
      much as possible.  Panics should be reserved for internal 
      inconsistencies and Really Bad problems like no memory left.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. title changed to: "error in "glob -type r *""
    5. username: "hobbs"
  11. Ticket change [c66d405ed3] (rid 121765) by vincentdarley on 2001-08-16 15:57:39:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      Ok, I guess I agree with Jeff.  So the choices are:
      
      (i) simply ignore the disappearance
      (ii) warn the user by signalling an error (but this will of 
      course abort the entire 'glob' in progress)
      
      I guess I would vote for (i) in this particular case -- the 
      user wants a list of files, but then one file has 
      disappeared (or had some other OS problem) half way through 
      so, it shouldn't be returned.  This behaviour kind of 
      assumes that if we tried the 'readdir' a second time, it 
      wouldn't return this particular file.
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. title changed to: "error in "glob -type r *""
    5. username: "vincentdarley"
  12. Ticket change [bf59788a12] (rid 102236) by dkf on 2001-08-16 16:57:44:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      The key (I think) is that with [glob -type r *] the user is
      asking for all files that can be opened by [open ... r]
      without causing an error. Since that is not the case with a
      broken link, it should not be returned. This assumption is
      also true for -type x, but not necessarily for -type w (it
      depends on whether creation is permitted in that directory)
      but it wouldn't be harmful to exclude those too (it depends
      on the interpretation of 'writable', but arguably a file is
      not previously writable if you have to create it as part of
      opening it for writing. Which is lucky since it makes the
      implementation simpler. :^)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. title changed to: "error in "glob -type r *""
    5. username: "dkf"
  13. Ticket change [0fde7eaf06] (rid 94868) by vincentdarley on 2001-08-24 01:25:50:

    1. status changed to: "Closed"
  14. Ticket change [161bd83da0] (rid 124670) by vincentdarley on 2001-08-24 01:25:51:

    1. closedate changed to: "2001-08-23T18:25:51"
    2. closer changed to: "vincentdarley"
    3. icomment:
      Logged In: YES 
      user_id=32170
      
      Fixed in cvs head
      
      
    4. login: "vincentdarley"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. title changed to: "error in "glob -type r *""
    8. username: "vincentdarley"