Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7ae66c32585725749f13c7d6ca32f56ee093824270e442e17d4b384d37cf7261
Ticket: e87000d8425ab86af682dd8195b9d20826974ba8
crash for "fconfigure stdout" in Win32
User & Date: chw on 2020-08-11 11:41:36
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    When doing a "fconfigure stdout" or "chan configure stdout" on Win32
    console channels, an immediate crash can happen. A potential fix is:
    
    ---8><------8><------8><------8><------8><------8><------8><------
    Index: win/tclWinConsole.c
    ==================================================================
    --- win/tclWinConsole.c
    +++ win/tclWinConsole.c
    @@ -1637,19 +1637,23 @@
         }
     
         if (valid) {
            return TCL_OK;
         }
    -    if (infoPtr->flags & CONSOLE_READ_OPS) {
    -       return Tcl_BadChannelOption(interp, optionName, "inputmode winsize");
    -    } else {
    -       return Tcl_BadChannelOption(interp, optionName, "");
    +    if (len > 0) {
    +       const char *optionList = "";
    +
    +       if (infoPtr->flags & CONSOLE_READ_OPS) {
    +           optionList = "inputmode winsize";
    +       }
    +       return Tcl_BadChannelOption(interp, optionName, optionList);
         }
    +    return TCL_OK;
     }
     ^L
     /*
      * Local Variables:
      * mode: c
      * c-basic-offset: 4
      * fill-column: 78
      * End:
      */
    
    ---8><------8><------8><------8><------8><------8><------8><------
    
  5. foundin changed to: "core-8-branch, current"
  6. is_private changed to: "0"
  7. login: "chw"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "0b3aff16612e1e9f3b675963fa64e01bd1d89307"
  10. resolution changed to: "None"
  11. severity changed to: "Critical"
  12. status changed to: "Open"
  13. submitter changed to: "chw"
  14. subsystem changed to: "25. Channel System"
  15. title changed to: "crash for "fconfigure stdout" in Win32"
  16. type changed to: "Bug"