Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 89ed737f775e9f3d05555d468145212f7a7279ce98281a7c0971305a2c160de2
Ticket: 6e82720e146403fadc88117c0e4fe1a7deff0fe6
Panic "Buffer Underflow, BUFFER_PADDING not enough" when reading files >= 4 GB
User & Date: tomkiti on 2026-07-28 12:03:20
Changes

  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