Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9baab77ceed6dc0dd7542c5313a2eb824048d1e13a1238f4af21394a3fcc51c1
Ticket: b1b2d135818b64c11817013ea8828b298b08a079
Tcl_Eval causes SIGSEGV, Segmentation fault
User & Date: spatel on 2018-01-09 20:23:19
Changes

  1. icomment:
    Here is the stack:
    
    1  DisplayText                           0x7ffff7b429c0 
    2  TclServiceIdle                        0x7ffff77e5be6 
    3  Tcl_DoOneEvent                        0x7ffff77c737d 
    4  Tk_UpdateObjCmd                       0x7ffff7ac07cd 
    5  TclNRRunCallbacks                     0x7ffff7705b77 
    6  TclEvalEx                             0x7ffff7707cf0 
    7  Tcl_EvalEx                            0x7ffff7708006 
    8  Tcl_Eval                              0x7ffff7708025 
    9  __tlc_thread_callback tcl_thread.h 21 0x7fffd93bb25c 
    10 Tcl_ServiceEvent                      0x7ffff77c7037 
    11 Tcl_DoOneEvent                        0x7ffff77c7275 
    12 Tk_UpdateObjCmd                       0x7ffff7ac07cd 
    13 TclNRRunCallbacks                     0x7ffff7705b77 
    14 TclEvalEx                             0x7ffff7707cf0 
    15 Tcl_EvalEx                            0x7ffff7708006 
    16 Tcl_Eval                              0x7ffff7708025 
    17 __tlc_thread_callback tcl_thread.h 21 0x7fffd93bb25c 
    18 Tcl_ServiceEvent                      0x7ffff77c7037 
    19 Tcl_DoOneEvent                        0x7ffff77c7339 
    20 Tcl_VwaitObjCmd                       0x7ffff778c0c6 
    21 TclNRRunCallbacks                     0x7ffff7705b77 
    22 AfterProc                             0x7ffff77e5450 
    23 TclServiceIdle                        0x7ffff77e5be6 
    24 Tcl_DoOneEvent                        0x7ffff77c737d 
    25 Tk_MainLoop                           0x7ffff7ac7e82 
    26 Tk_MainEx                             0x7ffff7ad5df8 
    27 main                                  0x4009cc       
    
    Here is the code for the __tcl_thread_callback()
    
    int __tlc_thread_callback(Tcl_Event* e, int flags) {
        // Convert the even to the derived struct so that
        // the interp and cmd can be extracted.
        Tcl_ThreadEvent* me = (Tcl_ThreadEvent*)e;
    
        // Call the actual cmd here.
        Tcl_Eval(me->interp, me->cmd);
    
        // Free the command since tcl won't free it.
        free(me->cmd);
    
        return 1;
    }
    
    This works for few times and than fails.
    
  2. login: "spatel"
  3. mimetype: "text/plain"