Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a427f999c2eb4817a455766bb54228db1462f64d
Ticket: 558324ffffffffffffffffffffffffffffffffff
Bad pointer ref with regexp, linked var
User & Date: watsonrick on 2002-05-20 15:46:34
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The bug occurs when a regular expression evaluation 
    updates a linked variable. In my case, tcp_plot_queue 
    name is the linked variable and the regular expression 
    is:
    
      regexp {(plot-[a-z]+)} [qr_dump_node $Process ]
                   junk1 tcp_plot_queue_name
    
    After the call in frame #5, interp->resultObjPtr has 
    been replaced, so resultPtr is invalid.
    
    gdb) where
    #0  TclFreeObj (objPtr=0x9fc9a78) 
    at ./../generic/tclObj.c:599
    #1  0x081acebb in LinkTraceProc (clientData=0x83c8a80, 
    interp=0x8378a68, name1=0x9f94150
    "tcp_login_queue_name", name2=0x0, flags=32)
        at ./../generic/tclLink.c:370
    #2  0x081c38f3 in CallTraces (iPtr=0x8378a68, 
    arrayPtr=0x0, varPtr=0x84b1920,
    part1=0x9f94150 "tcp_login_queue_name", part2=0x0, 
    flags=32)
        at ./../generic/tclVar.c:4172
    #3  0x081c179b in Tcl_SetVar2Ex (interp=0x8378a68, 
    part1=0x9f94150 "tcp_login_queue_name",
    part2=0x0, newValuePtr=0x83a81a8, flags=0)
        at ./../generic/tclVar.c:1340
    #4  0x081c1404 in Tcl_ObjSetVar2 (interp=0x8378a68, 
    part1Ptr=0x9fc9a30, part2Ptr=0x0,
    newValuePtr=0x83a81a8, flags=0) at ./../generic/tclV\
    ar.c:1142
    #5  0x0818b262 in Tcl_RegexpObjCmd (dummy=0x0, 
    interp=0x8378a68, objc=5, objv=0xbfffe80c)
    at ./../generic/tclCmdMZ.c:366
    #6  0x081b3754 in EvalObjv (interp=0x8378a68, objc=5, 
    objv=0xbfffe800,
        command=0x9f9041e "#puts [qr_dump_node $Process]
    \n\n### Testing new ipt\n#rick regexp
    {(berp-[a-z0-9]+)} [qr_dump_node $Process ] junk\
    2 tcp_login_queue_name\nregexp {(berp-[a-z0-9]+)} 
    \"$realstuff\" junk2
    tcp_login_queue_name"..., length=15455, flags=0) 
    at ./../generic/tc\
    lParse.c:932
    #7  0x081b3d6a in Tcl_EvalEx (interp=0x8378a68,
        script=0x9f8fd90 "# from prod that crashes 
    linux\nset Process [ config { set
    NTK_ProcessName } ]\nregexp {([^-]+)-([^0-9]*)([0-9]
    +)} $\
    Process junk class cluster instance\nset Hostname [ 
    config { set hostname } ]\n\n###
    temp"..., numBytes=17133, flags=0) at ./../generic/tc\
    lParse.c:1393
    #8  0x081b4019 in Tcl_Eval (interp=0x8378a68,
        string=0x9f8fd90 "# from prod that crashes 
    linux\nset Process [ config { set
    NTK_ProcessName } ]\nregexp {([^-]+)-([^0-9]*)([0-9]
    +)} $\
    Process junk class cluster instance\nset Hostname [ 
    config { set hostname } ]\n\n###
    temp"...) at ./../generic/tclParse.c:1548
    #9  0x08184327 in Tcl_GlobalEval (interp=0x8378a68,
        command=0x9f8fd90 "# from prod that crashes 
    linux\nset Process [ config { set
    NTK_ProcessName } ]\nregexp {([^-]+)-([^0-9]*)([0-9]
    +)} \
    $Process junk class cluster instance\nset Hostname [ 
    config { set hostname } ]\n\n###
    temp"...) at ./../generic/tclBasic.c:4149
    #10 0x08109e76 in NTK_Exec_Tcl_Config_File (ti=0x0, 
    file_name=0xbffffa40 "ipt_post.tcl",
    is_mandatory=1, exit_on_error=1) at nt_kernel.c:8\
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "watsonrick"
  9. subsystem changed to: "09. Linked C Variables"
  10. title changed to: "Bad pointer ref with regexp, linked var"
  11. type changed to: "Patch"