Skip to content
Tcl Source Code History Of Ticket 6e82720e14
Login

History Of Ticket 6e82720e14

Artifacts Associated With Ticket 6e82720e14

  1. Ticket change [b11df8219f] (rid 255057) by tomkiti on 2026-07-28 11:56:50:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      When reading files > 4 GB, Tcl 9 panics with the error "Buffer Underflow, BUFFER_PADDING not enough".
      
      I created a 4 GB file on Windows with the command:
      
          fsutil file createnew 4294967296.txt 4294967296
      
      The following script crashes on Windows and Linux:
      
          set filename 4294967296.txt
          set chan [open $filename r]
          read $chan [file size $filename]
          close $chan
      
      A filesize of 4294967295 works.
      
      Tcl 8 throws the following error:
      
          expected non-negative integer but got "4294967296"
              while executing
          "read $chan [file size $filename]"
      
    5. foundin initialized to: "9.0.4"
    6. is_private initialized to: "0"
    7. login: "tomkiti"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "1c57e67924247fd7926e89348f266c081ec57db2"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "tomkiti"
    14. subsystem initialized to: "18. Commands M-Z"
    15. title initialized to:
      Panic "Buffer Underflow, BUFFER_PADDING not enough" when reading files > 4 GB
      
    16. type initialized to: "Bug"
  2. Ticket change [89ed737f77] (rid 255058) by tomkiti on 2026-07-28 12:03:20:

    1. comment changed to:
      When reading files >= 4 GB, Tcl 9 panics with the error "Buffer Underflow, BUFFER_PADDING not enough".
      
      I created a 4 GB file on Windows with the command:
      
          fsutil file createnew 4294967296.txt 4294967296
      
      The following script crashes on Windows and Linux:
      
          set filename 4294967296.txt
          set chan [open $filename r]
          read $chan [file size $filename]
          close $chan
      
      A filesize of 4294967295 works.
      
      Tcl 8 throws the following error:
      
          expected non-negative integer but got "4294967296"
              while executing
          "read $chan [file size $filename]"
      
    2. login: "tomkiti"
    3. mimetype: "text/plain"
    4. title changed to:
      Panic "Buffer Underflow, BUFFER_PADDING not enough" when reading files >= 4 GB
      
  3. Ticket change [744a975337] (rid 255064) by apnadkarni on 2026-07-29 05:55:13:

    1. icomment:
      Does not even need a large file on disk. Appears to be reproducible with 4294967296 size reads on any size file.
      
      WIP on branch bug-6e82720e
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  4. Ticket change [585ea97fc3] (rid 255065) by apnadkarni on 2026-07-29 05:55:28:

    1. assignee changed to: "apnadkarni"
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  5. Ticket change [02e6fe2dab] (rid 255088) by apnadkarni on 2026-08-02 05:48:55:

    1. icomment:
      A related failure mode also shows up in 8.6
      
      ```
      % file size x.txt
      2
      % set fd [open x.txt]
      file1dd2964bc10
      % read $fd 4294967296
      % <- empty result. Should return the file content
      ```
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  6. Ticket change [19241f1e55] (rid 255095) by apnadkarni on 2026-08-02 08:14:10:

    1. closedate changed to: "2461254.8431728934"
    2. closer changed to: "apnadkarni"
    3. icomment:
      Fixed for 9.1 in [5a2face9]. No plans to fix for 9.0 as it is dependent on TIP 737 which targets 9.1. A 9.0 fix would require additional changes and not seen as worthwhile for a rare/corner case. Closing accordingly.
      
    4. login: "apnadkarni"
    5. mimetype: "text/x-fossil-plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"