Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: afdaf05f0ea67e2df306a89865dd90d555ff64ca
Ticket: 3067036fffffffffffffffffffffffffffffffff
Appending to 0-length byte array causes busy loop.
User & Date: sbron on 2010-09-15 17:52:43
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The code below goes into a busy loop with 100% cpu usage:
    
    set f [open /dev/null]
    chan configure $f -blocking 0 -translation binary
    set str [read $f 2]
    append str [binary format a* foo]
    
    The problem is in TclAppendBytesToByteArray(). This function tries to calculate the needed memory by doubling the currently allocated space until it is big enough. That method fails miserably when starting with an allocated space of size 0, as is the case in the code above.
    
    
  4. foundin changed to: "obsolete: 8.6b1.1"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "sbron"
  10. subsystem changed to: "12. ByteArray Object"
  11. title changed to: "Appending to 0-length byte array causes busy loop."
  12. type changed to: "Bug"