Tcl Source Code

View Ticket
Login
Ticket UUID: 25cdcb7e8fb381fb981b5595cfc6dc48a7f1c83b
Title: incomplete utf-8 sequence followed by eofchar results in failed assertion
Type: Bug Created on: 2023-04-18 19:24:11
Submitter: pooryorick Assigned to: pooryorick
Subsystem: - New Builtin Commands Severity: Important
Priority: 5 Medium Last modified: 2023-04-21 23:03:08
Status: Closed Closed by: pooryorick
Resolution: Fixed Closed on: 2023-04-21 23:03:08
Version:
Description:

The following script causes build trunk to abort:

set chan [file tempfile];
fconfigure $chan -encoding binary
puts -nonewline $chan \x81\x1A
flush $chan
seek $chan 0
chan configure $chan -encoding utf-8 -profile strict
read $chan 1

Output:

/path/to/tcl9.0/generic/tclIO.c:6154: DoReadChars: Assertion `!GotFlag(statePtr, CHANNEL_EOF) || GotFlag(statePtr, CHANNEL_STICKY_EOF) || GotFlag(statePtr, CHANNEL_ENCODING_ERROR) || Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0' failed.

User Comments:
pooryorick added on 2023-04-18 22:01:22:

Fixed in [a02c5b9f8b].