Skip to content
Tcl Source Code History Of Ticket 458576ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 458576ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 458576ffffffffffffffffffffffffffffffffff

  1. Ticket change [daa625a0aa] (rid 107826) by andyv on 2001-09-05 00:06:37:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      On x86 linux the "file type" command fails with an
      error on files that are more than 2G in length. 
      Clearly, what is happening is that a common subroutine
      is being called to stat the file and the 2G file length
      overflows a tcl integer.
      
      However, the length isn't needed at all for "file type"
      to return the correct result.  There are probably a
      similar problems with other variants of the file
      command.
      
           Andy
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "andyv"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to: "Failure of "file type""
    11. type initialized to: "Bug"
  2. Ticket change [f3f72d03cf] (rid 129812) by dkf on 2001-09-05 16:10:39:

    1. assignee changed to: "vincentdarley"
    2. subsystem changed to: "37. File System"
    3. title changed to: "Failure of "file type""
  3. Ticket change [7e02bcb34b] (rid 97332) by vincentdarley on 2001-09-05 21:06:14:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      Unfortunately, the 'clearly what is happening' above boils 
      down to:
      
      Tcl calls 'Tcl_FSLstat' which calls 'TclpObjLstat' which 
      calls 'lstat' which returns an error code.  Tcl receives 
      the error code and passes the error on.
      
      The only options available seem to be:
      
      (i) replace 'lstat' with a 64-bit aware version (with the 
      numerous knock-on effects that may have).
      (ii) if 'lstat' returns a particular POSIX error code which 
      can be interpreted to mean 'this file is too big', perhaps 
      we can take more subtle remedial action.
      
      I suggest the reporter of this bug try to work out what is 
      going on and which of (i), (ii) might solve the problem.
      
      cheers,   Vince.
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. title changed to: "Failure of "file type""
    5. username: "vincentdarley"
  4. Ticket change [6c6b45df84] (rid 128504) by dkf on 2001-09-05 21:43:36:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      'man lstat' says EOVERFLOW on Solaris, and recommends
      lstat64(..., struct stat64 *...) as a transitional
      interface.  Whatever *that* means...
      
      The difference between 'struct stat' and 'struct stat64' is
      in the typing of selected fields (st_ino, st_size, and
      st_blocks) whose names gain a '64' immediately preceding the
      '_t' (and which are presumably now 64-bit entities.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. title changed to: "Failure of [file type] on large files"
    5. username: "dkf"
  5. Ticket change [a21a4fe295] (rid 109833) by vincentdarley on 2001-09-05 22:07:11:

    1. assignee changed to: "nobody"
    2. icomment:
      Logged In: YES 
      user_id=32170
      
      I guess this means someone could cobble together option 
      (ii) below by checking for an EOVERFLOW return code and 
      doing appropriate stuff.  Not sure if it's worth doing 
      really, though (the problem is that we don't know what the 
      caller of lstat is after --- do they just want the 'type' 
      or are they actually after the size?).  Might be best for 
      someone who uses these things to add proper large file 
      support to Tcl.  It would be nice if this could get into 
      Tcl 8.4.
      
      
      
      
    3. login: "vincentdarley"
    4. mimetype: "text/plain"
    5. username: "vincentdarley"
  6. Ticket change [c6b265d400] (rid 121810) by andyv on 2001-09-05 23:30:56:

    1. icomment:
      Logged In: YES 
      user_id=29655
      
      I've already worked around my immediate problem.  I needed
      to know if the file was a directory or not, and 'file
      isdirectory' works fine on large files.
      
      I did download and compile 8.4-alpha with --enable-64bits
      and as far as I can tell, it didn't use lstat64(). 
      Replacing lstat() with lstat64() doesn't necessarily have to
      involve all the pain of replacing tcl integers with 64-bit
      integers; In the case of 'file type', the length is never
      needed.
      
      Perhaps a flag could be added to TclpObjLstat indicating
      whether the length was needed or not.  If the length is
      needed and was greater than 2^31, then an error could be
      raised.
      
      
      
    2. login: "andyv"
    3. mimetype: "text/plain"
    4. username: "andyv"
  7. Ticket change [d09a9f20f2] (rid 113212) by vincentdarley on 2001-09-07 00:44:25:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      I'm afraid '--enable-64bits' is badly named and nothing to 
      do with this.
      
      Adding a flag to every use of lstat for one particular 
      purpose seems like a mess (how many other 'one particular 
      purposes' can we think of).  Another option might be for 
      this code in tclCmdAH.c:
      
      case FILE_TYPE: {
          struct stat buf;
      
          if (objc != 3) {
          goto only3Args;
          }
          if (GetStatBuf(interp, objv[2], Tcl_FSLstat, 
      &buf) != TCL_OK) {
      return TCL_ERROR;
          }
          Tcl_SetStringObj(Tcl_GetObjResult(interp), 
          GetTypeFromMode((unsigned short) 
      buf.st_mode), -1);
          return TCL_OK;
      }
      
      to check if 'Tcl_GetErrno()' is EOVERFLOW and if so not to 
      return TCL_ERROR, but rather to go ahead and use the 
      information it needs anyway.  This assumes that 
      when 'lstat' fails with EOVERFLOW it still fills in the 
      entries it can in the stat buffer.   Feel free to test this 
      out and contribute a patch.
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  8. Ticket change [85ca1062f3] (rid 131378) by nobody on 2001-09-11 02:22:36:

    1. icomment:
      Logged In: NO 
      
      The main problem is that there are actually quite a few places that (l)stat files, and if you change the 
      interface in one place to take account of the possibility of large files, then you have to change it throughout. 
      Which is a lot of work. Furthermore, I do not know if there is any cross-platform agreement on what the 
      interface for dealing with large files should be, and the documentation on Solaris does not make me inclined 
      to believe that what is there is necessarily common throughout. If, as I suspect, large file support uses a 
      different API on each platform (urk!) then we will need to develop a suitable set of macros to detect this in 
      tcl.m4, and even in the case where this is not, we still have the problem of how to represent numbers larger 
      than 2G (as would be returned from [file size] applied to a large file) in Tcl where we do not currently 
      support numbers larger than that if the size of long is only 32 bits. Which means that we need to do a 
      *major* rearchitecturing of the whole Tcl core to support this. :^(
      
      I suppose the bullet must be bitten some time, but it is going to be much work...
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  9. Ticket change [3f3ac943dc] (rid 121420) by dkf on 2001-09-13 22:14:39:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      See also #219197, and I think that you can't assume anything
      about the contents of the stat buffer after a failed stat().
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  10. Ticket change [81be797cde] (rid 117097) by andyv on 2001-09-13 23:29:27:

    1. closedate changed to: "2001-09-13T16:29:27"
    2. closer changed to: "andyv"
    3. icomment:
      Logged In: YES 
      user_id=29655
      
      I thought I would have some time to give a better look at
      this, but I don't think I will.
      
      In my view, the tcl developers need to make tcl aware of
      more than 32 bits.
      
      
      
      
    4. login: "andyv"
    5. mimetype: "text/plain"
    6. resolution changed to: "Wont Fix"
    7. status changed to: "Closed"
    8. username: "andyv"
  11. Ticket change [acb394d36b] (rid 101341) by dkf on 2001-09-14 16:05:32:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      We're aware of the need to support more than 32-bit numbers
      on systems where sizeof(long) is 4 (some architectures
      support large files and numbers already due to increased
      word size) but until we do our support for large files is
      going to be patchy.  The first thing we need is to get
      configure to work out what the type of 64-bit numbers is so
      we can support them in Tcl_Objs (which are already large
      enough so there'll be no incompatability there.)  Only once
      that's addressed will we be able to sort out everything
      else.  :^(
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. priority changed to: "3 Low"
    5. resolution changed to: "Later"
    6. status changed to: "Open"
    7. username: "dkf"
  12. Ticket change [414a2c5ede] (rid 116164) by dkf on 2001-10-09 16:40:24:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      See dkf-64bit-support-branch
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  13. Ticket change [db661b03b0] (rid 107959) by vincentdarley on 2002-01-31 00:38:26:

    1. foundin changed to: "obsolete: 8.4a4"
    2. icomment:
      Logged In: YES 
      user_id=32170
      
      Isn't the '64bit' support branch pretty much complete and 
      passes all tests?  In that case shouldn't someone on the 
      TCT schedule a vote for the relevant TIP so we can get this 
      bug fixed?
      
      
    3. login: "vincentdarley"
    4. mimetype: "text/plain"
    5. priority changed to: "5 Medium"
    6. username: "vincentdarley"
  14. Ticket change [7302612cdb] (rid 104968) by dkf on 2002-01-31 17:11:47:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      I'll try to get to that when I have time, but I'm currently
      up to my eyeballs in other work which has a tight schedule
      with no opportunity to slip it either (I'm rewriting slides,
      notes and exercises for a lecture on concurrency given later
      this month by my boss, in case you're interested.)  Maybe at
      the weekend I'll be able to double-check that all the things
      I want to do are in the TIP and then do a CFV, but no
      guarantees there...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  15. Ticket change [1b0f716a46] (rid 123080) by dkf on 2002-02-16 04:15:20:

    1. closedate changed to: "2002-02-15T21:15:20"
    2. closer changed to: "dkf"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"