Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 216bf93c3d54d9d544042e690574a5e5de9e6e8f
Ticket: 3006741fffffffffffffffffffffffffffffffff
SIGSEGV in Tcl_LogCommandInfo
User & Date: coldstore on 2010-05-25 20:15:53
Changes

  1. icomment:
    I spent approximately 4 hours today looking for ways to trap this bug under gdb and valgrind, and tracing the fault to these patches.
    
    The problem is that in some circumstances the interp->framePtr->callerVarPtr chain is broken.
    
    Is there a case in which a frame can be created containing an uninitialized callerVarPtr?  I certainly could not observe callerVarPtr being explicitly set to the value which I consistently observed to be the bogus pointer.
    
    Given the context within which the segv occurred, I suggest that these cases may be associated with ::apply or with ::coroutine, but defer to Alexandre's specific knowledge of the patches and what they seek to achieve.
    
    I avoided the crash by testing for the condition 'iPtr->varFramePtr != iPtr->rootFramePtr' in addition to the existing test 'iPtr->varFramePtr != iPtr->framePtr'.  I note that this condition normally terminates the function in which the crash occurs, except in the case that varFramePtr != rootFramePtr, which is (I believe incorrectly) interpreted by the code as meaning that there's an uplevel in play.  I do not know under which conditions both of these predicates might be true, nor the accurate and complete interpretation of varFramePtr != framePtr, but something smells wrong about the interpretation being placed upon it, and I suspect the assumption that it strongly implies [uplevel] is false in the case of either ::coroutine or ::apply, or both.
    
    
    
  2. login: "coldstore"
  3. mimetype: "text/plain"
  4. username: "coldstore"