Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fc4481e15a5a890c74a44098c573f2ee269997b7
Ticket: 2458202fffffffffffffffffffffffffffffffff
Reflected channel crash on exit
User & Date: andreas_kupries on 2009-01-22 05:59:50
Changes

  1. icomment:
    Ah .. submitted to early.
    
    While the change does indeed fix our problem it is not clear yet if that is actually the correct thing to do.
    
    First, the reflections (transform too), currently assume that 'interp == NULL' means 'TclFinalizeIOSystem'. And indeed that is the only place in the core where interp == NULL is used.
    
    Reading the OpenFileChnl.3 manpage the description of Tcl_Close contains
    
        If the channel is being closed synchronously and an error occurs during
        closing of the channel and interp is not NULL, an error message is left in
        the interpreter's result.
    
    This seems to imply that Tcl_Close is allowed to be called with interp == NULL from the outside, i.e. packages, and that this just means 'I do not wish to see error messages'.
    The comments in the code (i.e. tclIO.c, definition of Tcl_Close()), however do not mention that the interp argument is allowed to be NULL.
    
    If we assume that the manpage has priority then the correct fix is not to change Tk, but the implementation of the reflections, i.e. use a different way of detecting when ReflectClose() is called from the TclFinalizeIOSystem().
    
    Maybe the channel flags allow us to tell this ?
    Hm. TclInThreadExit() seems to be closest.
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. username: "andreas_kupries"