Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ed8e31d56a094c2724f661318f9eaa8c59b6c24c
Ticket: 2978773fffffffffffffffffffffffffffffffff
Segfault when using a reflected channel
User & Date: andreas_kupries on 2010-03-31 01:47:38
Changes

  1. icomment:
    The problem is equivalent to 2921116, except for reflected channel instead of reflected transform.
    
    The crashing script deeply nests through the script handler of the channel, then destroys the channel very deeply in the stack, and during the unwinding process it tries to invoke the script handler at a point where the structure is already destroyed, with bogus interp and other pointers.
    
    This can be seen very nicely in the modified segfault.tcl script where I changed the logging to show the nesting structure of Tcl procedures. The nesting does occur because of the immediate posting of events in some places, calling immediately back into the Tcl layer. This is why defering this action via 'after' is a workaround. It prevents the nesting and thus each callback into the channel handler can be sure to have the C structure whole and complete for the lifetime of its operation.
    
    Now working on the fix (Tcl_Preserve/Release the C level ReflectedChannel structure to keep it alive while there are references to it in C and Tcl stacks).
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. username: "andreas_kupries"