Skip to content
Tcl Source Code History Of Ticket b0e16e3f34ff4c76
Login

History Of Ticket b0e16e3f34ff4c76

Artifacts Associated With Ticket b0e16e3f34ff4c76

  1. Ticket change [d84ab85194] (rid 155336) by gcramer on 2017-08-11 15:46:05:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/html"
    4. comment initialized to:
      I have created a file channel with an open file descriptor <em>fd</em>:
      
      <verbatim>
          m_chan = Tcl_MakeFileChannel(fd, TCL_READABLE);
      </verbatim>
      
      <p>
      Later I'm closing the file channel, but at this time the file descriptor is already closed (the file descriptor comes from an external library):
      
      <verbatim>
          Tcl_Close(NULL, m_chan);
      </verbatim>
      
      <p>
      Now in function <code>PlatformEventsControl()</code> [unix/tclEpollNotfy.c:245] <code>Tcl_Panic()</code> will be invoked, and my program is aborting. This behavior is new, and I think that this should not happen at all, all system functions are able to work with closed file descriptors (without aborting the program). Please note that in my case the file descriptor comes from an external library, so I have no control about it's state. Of course I could check the state before calling <code>Tcl_Close()</code>, but this is no solution, because how should I release the created channel when not with <code>Tcl_Close()</code>? Furthermore this behavior is incompatible to previous Tcl version 8.6.
      
    5. foundin initialized to: "8.7"
    6. is_private initialized to: "0"
    7. login: "gcramer"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9b7155594aadef44d10a978838b8fe108cdafdd1"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "gcramer"
    14. subsystem initialized to: "25. Channel System"
    15. title initialized to: "Crash (Tcl_Panic) when closing a file channel"
    16. type initialized to: "Bug"
  2. Ticket change [23870dbbb8] (rid 257798) by serhiy.storchaka on 2026-10-12 19:33:22:

    1. icomment:
      Fixed by [5c274ca404] for [010d8f3885] (9.0.2): <code>Tcl_Close()</code> on a
      file channel whose descriptor was already closed now returns "bad file
      descriptor" instead of panicking. Tested with 9.0.1 (panic), 9.0.3 and 9.1.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [9ef57781b7] (rid 259900) by serhiy.storchaka on 2026-10-22 17:19:25:

    1. closedate changed to: "2461326.3148453357"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"