Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b11df8219f723b69eeeb349725fdd9ec04c4af93123ea9ac5939e5cddfd86af2
Ticket: 6e82720e146403fadc88117c0e4fe1a7deff0fe6
Panic "Buffer Underflow, BUFFER_PADDING not enough" when reading files >= 4 GB
User & Date: tomkiti on 2026-07-28 11:56:50
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. 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]"
    
  5. foundin changed to: "9.0.4"
  6. is_private changed to: "0"
  7. login: "tomkiti"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "1c57e67924247fd7926e89348f266c081ec57db2"
  10. resolution changed to: "None"
  11. severity changed to: "Critical"
  12. status changed to: "Open"
  13. submitter changed to: "tomkiti"
  14. subsystem changed to: "18. Commands M-Z"
  15. title changed to:
    Panic "Buffer Underflow, BUFFER_PADDING not enough" when reading files > 4 GB
    
  16. type changed to: "Bug"