Skip to content
Tcl Source Code History Of Ticket bf7135428c3086e7
Login

History Of Ticket bf7135428c3086e7

Artifacts Associated With Ticket bf7135428c3086e7

  1. Ticket change [d76ca959dd] (rid 140256) by dgp on 2014-10-10 16:31:23:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Tcl_Write() as released in Tcl 8.5.16 and 8.6.2 no
      longer compatibly returns the same values it did in
      prior releases.
      
      Tcl_Write(chan, buf, toWrite) does not have its
      return value clearly documented.  It is only described
      as "similar to Tcl_WriteChars".
      
      In the code comments heading the Tcl_Write implementation
      it is claimed that the return value is "number of bytes
      written or -1 in case of error".  But this is ambiguous.
      Does that mean the number of bytes taken out of "buf"
      (some value <= toWrite)?  Or does it mean the number of
      bytes sent out to the channel output driver?  If we take
      our clue from the "similar to Tcl_WriteChars" language,
      we might assume that, like every other Tcl_Write* routine,
      what gets reported is the number of bytes sent out to the
      driver.  Since the only way Tcl_Write could consume less
      than "toWrite" bytes from "buf" would be in case of an error,
      and we have the special value -1 to signal errors, it's
      natural to assume that Tcl_Write () would not be returning
      the number of bytes taken from "buf" because in the absence
      of an error that would always just be an echo back of the
      "toWrite" value, and useless.
      
      But you'd be making assumptions contrary to the code history.
      In fact, up until now, Tcl_Write() has indeed been echoing
      back the "toWrite" value on success.  The refactoring work on
      channels incompatibly changed that to reporting the number of
      bytes written, and on Windows by default, and anywhere with
      -translation crlf active, that can be an incompatible difference.
      
      As you might guess, this is damaging a deployed application of
      mine.  As soon as folks upgrade to ActiveTcl 8.6.2.0, their
      programs stop working.  That's what's reported.  It's clear
      the same issue will plague those working with deployed programs
      using tcl85.dll from ActiveTcl 8.5.16.0.
      
    5. foundin initialized to: "8.5.16"
    6. is_private initialized to: "0"
    7. login: "dgp"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Critical"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "25. Channel System"
    14. title initialized to: "Tcl_Write() breaks interface in 8.5.16 and 8.6.2"
    15. type initialized to: "Bug"
  2. Ticket change [05db5524d8] (rid 140257) by dgp on 2014-10-10 17:04:34:

    1. icomment:
      
      ok, the "useless" assessment is too strong.
      
      If toWrite = -1 is passed in, all bytes up to
      the terminating NUL are written, and the return
      is a count of how many that was.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  3. Ticket change [07341351a8] (rid 140276) by dgp on 2014-10-10 19:57:04:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2456941.33130264"
    3. closer changed to: "dgp"
    4. icomment:
      
      Trivially simple fix committed to both branches.
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"