Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cdc7a8552e9c77517ab8e4ba7ab300264b204cf30fe9f173ebf1232a36ba090b
Ticket: 1136e210b342c25ec019c9b326bb24103eaed75f
8.7, 9.0: Bad input triggers DoReadChars Assertion
User & Date: pointsman on 2022-02-06 17:35:38
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    The following script reproduces the problem:
    
    set fd [open bad.txt wb+]
    # Seems (almost?) any character will do it
    puts -nonewline $fd "a"
    close $fd
    
    # Happens for any enconding out of
    # cns11643 gb2312-raw gb12345 jis0208 jis0212 ksc5601
    set fd [open bad.txt]
    fconfigure $fd -encoding cns11643
    set badtext [read $fd]
    close $fd
    
    Running this with either 9.0 (current trunk) or 8.7 (core-8-branch) results in (just with different line numbers):
    
    tclIO.c:5982: DoReadChars: Assertion `!GotFlag(statePtr, CHANNEL_EOF) || GotFlag(statePtr, CHANNEL_STICKY_EOF) || Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0' failed.
    
    and of course abortion of the process
    
  5. foundin changed to: "8.7, 9.0"
  6. is_private changed to: "0"
  7. login: "pointsman"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "4ca203a8e925aecdd9419645f936bccf18cd6ea7"
  10. resolution changed to: "None"
  11. severity changed to: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "pointsman"
  14. subsystem changed to: "25. Channel System"
  15. title changed to: "8.7, 9.0: Bad input triggers DoReadChars Assertion"
  16. type changed to: "Bug"