Skip to content
Tcl Source Code History Of Ticket 1965787
Login

History Of Ticket 1965787

Artifacts Associated With Ticket 1965787

  1. Ticket change [7edaca24a2] (rid 97479) by nobody on 2008-05-17 03:57:10:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Tcl "tell" command returned 64-bit unsigned values starting in 8.4 for use in managing files >2GB.
      
      Tcl "tell" command in 8.5.2 seems to be returning a signed value which appears "negative" and unsuitable for use in Tcl "seek" command for file positions > 2GB.
      
      Platform: XP-SP2, builds built locally with VC++ 2008 Express, also the distributed Equi4 "tclkit" for 8.5.2 produce this output:
      
      (2008) 3 % set tcl_patchLevel
      8.5.2
      (2008) 4 % set fn "whopper.bin"
      whopper.bin
      (2008) 5 % file stat $fn s
      (2008) 6 % set s(size)
      3974747277
      (2008) 7 % set f [open $fn "rb"]
      fileb54c58
      (2008) 8 % seek $f 2147016079
      (2008) 9 % tell $f
      2147016079
      (2008) 10 % read $f 1000000 ; set x
      can't read "x": no such variable
      (2008) 11 % tell $f
      -2146951217
      (2008) 12 % seek $f 3974747000
      (2008) 13 % tell $f
      -320220296
      
      By comparison (same platform):
      (2008) 11 % set tcl_patchLevel
      8.4.4
      (2008) 12 % set fn "whopper.bin"
      whopper.bin
      (2008) 13 % file stat $fn s
      (2008) 14 % set s(size)
      3974747277
      (2008) 15 % set f [open $fn "r"] ; fconfigure $f -translation binary
      (2008) 16 % set f
      file9bd888
      (2008) 17 % seek $f 2147016079
      (2008) 18 % tell $f
      2147016079
      (2008) 19 % read $f 1000000 ; set x
      can't read "x": no such variable
      (2008) 20 % tell $f
      2148016079
      (2008) 21 % seek $f 3974747000
      (2008) 22 % tell $f
      3974747000
      (2008) 23 % 
      
      David Burns : consollidator<AT>yahoo.com
      
    4. foundin initialized to: "obsolete: 8.5.2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "nobody"
    10. subsystem initialized to: "18. Commands M-Z"
    11. title initialized to:
      8.5.2 "tell" returns neg 32-bit value for positions > 2GB
      
    12. type initialized to: "Bug"
  2. Ticket change [b6a4761001] (rid 125455) by dkf on 2008-05-17 12:21:42:

    1. assignee changed to: "andreas_kupries"
    2. priority changed to: "7 High"
    3. subsystem changed to: "24. Channel Commands"
  3. Add attachment "wideseek.patch" [39c00422cc] (rid 112445) by ferrieux on 2008-05-23 03:40:18.

  4. Ticket change [8ae1dbb819] (rid 127462) by ferrieux on 2008-05-23 03:40:18:

    1. icomment:
      
      
      File Added - 278721: wideseek.patch
      
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Found and fixed (attached patch).
      The problem is the sign-extending int32->int64 conversion Tcl_LongAsWide, done on the low-order part of the tell value, which is a signed int32. To circumvent this I have replaced the use of the Tcl_LongAsWide macro by the more explicit cast:
      
        ((Tcl_WideInt)((unsigned)value))
      
      Test suite passed.
      This should work on 64-bit Windows, though I have now way to check.
      Also notice that generating a test case is not easy since a file slightly over 2G is neede :-(
      
      File Added: wideseek.patch
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Add attachment "wideseek.patch" [6863928d42] (rid 103057) by ferrieux on 2008-05-23 04:36:19.

  6. Ticket change [773188c939] (rid 89739) by ferrieux on 2008-05-23 04:36:21:

    1. icomment:
      
      
      File Added - 278728: wideseek.patch
      
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Found and fixed (attached patch).
      The problem is the sign-extending int32->int64 conversion Tcl_LongAsWide, done on the low-order part of the tell value, which is a signed int32. To circumvent this I have replaced the use of the Tcl_LongAsWide macro by the more explicit cast:
      
        ((Tcl_WideInt)((unsigned)value))
      
      Test suite passed.
      This should work on 64-bit Windows, though I have now way to check.
      Also notice that generating a test case is not easy since a file slightly over 2G is neede :-(
      
      File Added: wideseek.patch
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  7. Ticket change [6a1518e592] (rid 128084) by dkf on 2008-05-23 06:43:59:

    1. priority changed to: "9 Immediate"
  8. Ticket change [4e7cecaafb] (rid 125643) by andreas_kupries on 2008-05-24 04:34:36:

    1. closedate changed to: "2008-05-23T21:34:36"
    2. closer changed to: "andreas_kupries"
    3. icomment:
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      Committed to Tcl 8.4 branch.
      Committed to Tcl 8.5 branch.
      Committed to Tcl Head branch.
      
      
      
    4. login: "andreas_kupries"
    5. mimetype: "text/plain"
    6. resolution changed to: "Accepted"
    7. status changed to: "Closed"
    8. username: "andreas_kupries"