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

History Of Ticket 219396ffffffffff

Artifacts Associated With Ticket 219396ffffffffff

  1. Ticket change [af91b7326e] (rid 97835) by nobody on 2000-10-26 05:12:23:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 6215 Bug
      Version: 8.3.2
      SubmitDate: '2000-09-05'
      LastModified: '2000-10-25'
      Severity: MED
      Status: UnAssn
      Submitter: techsupp
      OS: Digital Unix
      Machine: 64-bit Compaq Alpha
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name:
      Robin T. Miller
      
      CustomShell:
      No patches, no customizations.
      
      ReproducibleScript:
      On Tru64 Unix, file offsets are sizeof(long), but the definition of seek limits the file offset to sizeof(int) or 31 bits (must be positive value). I had a simple C function used to determine disk capacity, that I decided to re-write in Tcl, but was disappointed to see that seek has this limitation.  Of course to be portable to other platforms, 64-bit file system support is necessary.
      
      Here's the simple Tcl code to reproduce this problem:
      
      set attempts    0
      set bsize       512
      set mbyte       [expr (1024 * 1024)]
      set adjust      [expr ($mbyte * 250)]
      set offset      $adjust
      
      while { 1 } {
          incr attempts
          if [catch {seek $chan $offset start} result] {
              puts stderr "seek failed!\n$result"
              break
          }
          set off [tell $chan]
          if { $opts(DebugFlag) } {
              puts [format "offset = %ld, lba = %lu"  $off [expr ($off / $bsize)]]
          }
          if [catch {read $chan $bsize} result] {
              puts stderr "read failed!\n$result"
              break
          }
          if [eof $chan] {
              set adjust [expr ($adjust / 2)]
              if { ($adjust == 0) } {
                  incr adjust
              }
              set offset [expr ($off - $adjust)]
          } else {
              incr offset $adjust
              if { ($adjust == 1) } {
                  break;                      ;# We have max capacity!
              }
          }
      }
      
      puts "    Attempts: $attempts"
      puts "      Offset: $offset"
      puts "    Capacity: [expr ($offset / $bsize)]"
      
      I consider this a bug rather than a feature enhancement, since Tru64 Unix is naturally a 64-bit system.
      
      ObservedBehavior:
      tru64% getcapacity -device rz2 -debug
      offset = 262144000, lba = 512000
      offset = 524288000, lba = 1024000
      offset = 786432000, lba = 1536000
      offset = 1048576000, lba = 2048000
      offset = 1310720000, lba = 2560000
      offset = 1572864000, lba = 3072000
      offset = 1835008000, lba = 3584000
      offset = 2097152000, lba = 4096000
      seek failed!
      integer value too large to represent as non-long integer
          Attempts: 9
            Offset: 2359296000
          Capacity: 4608000
      tru64% tclsh
      % set chan [open /dev/rrz2c r]
      file5
      % seek $chan 2359296000 start
      integer value too large to represent as non-long integer
      % close $chan 
      % exit
      tru64%
      
      DesiredBehavior:
      I expect seek to allow a sizeof(long) offset value.
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.3.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to:
      seek offset is limited to sizeof(int), where sizeof(long) sh
      
    11. type initialized to: "Bug"
  2. Ticket change [1a4dbd452a] (rid 122957) by dkf on 2000-11-15 22:13:10:

    1. subsystem changed to: "62. (unused)"
  3. Ticket change [b3928050af] (rid 124880) by dkf on 2000-11-28 20:33:06:

    1. icomment:
      Yet another instance of the problems Tcl has with the difference between 32 bits and 64 bits (which also bites in expressions and clock handling; maybe elsewhere too) and which will take a concerted piece of monster effort to fix.  I'm not even sure that the underlying API for seeks to non-32bit locations is common across all UNIX platforms; if this is the case, then additional configure tests will be needed too.  :^(
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [065cab53f4] (rid 89213) by dgp on 2001-04-03 06:19:31:

    1. subsystem changed to: "24. Channel Commands"
  5. Ticket change [1692c5058c] (rid 124737) by dkf on 2001-09-20 17:38:06:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Assigning to myself really just to remind me that this is a
      sort-of duplicate of another bug I'm thinking of how to fix.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. resolution changed to: "Duplicate"
    6. username: "dkf"
  6. Ticket change [c2d4665aa8] (rid 111547) by dkf on 2002-02-15 21:42:25:

    1. resolution changed to: "Duplicate"
    2. status changed to: "Open"
  7. Ticket change [b0ac69587c] (rid 98027) by dkf on 2002-02-15 21:42:26:

    1. status changed to: "Open"
  8. Ticket change [01f2d8cbf6] (rid 119570) by dkf on 2002-02-15 21:42:27:

    1. resolution changed to: "Duplicate"
  9. Ticket change [6fb305823c] (rid 100356) by dkf on 2002-02-15 21:42:28:

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