Menu

#221 Seg. fault accessing itcl var. which name is a proc.

3.4
closed-fixed
Other (66)
5
2012-02-19
2011-08-25
No

Tcl 8.5.10 and incrTcl 3.4, reproduced in Windows and Linux.

You need three steps to reproduce the segmentation fault:

package require Itcl
proc NIX args {puts $args}
set {@itcl NIX a}

thx

Discussion

  • Thomas Perschak

    Thomas Perschak - 2012-02-14

    Retested in 8.5.11 - still crashes

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-02-16

    Proposed fix committed in branch bug-3398008.

    Explanation: The crash occurs in the function
    Itcl_ScopedVarResolver, (itcl_object.c line 1215).
    Every object to be resolved has a cmdproc,
    and its objClientData contains the further
    information that Itcl_ScopedVarResolver
    needs. However, the objCmd must be
    of type Itcl_HandleInstance, otherwise
    the objClientData could be the clientData
    of some other command, which could
    contain anything.

    Solution: In Itcl_ScopedVarResolver,
    add an additional check, letting it
    fail when
    cmdInfo.objProc != Itcl_HandleInstance

    All tests pass with this modification.

    Thomas (or anyone else), please check if
    this doesn't have any unexpected side
    effects. Could cmdInfo.objProc have
    any other value which is valid as well?

    Regards,
    Jan Nijtmans

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-02-16
    • assigned_to: wiede --> nijtmans
     
  • Jan Nijtmans

    Jan Nijtmans - 2012-02-16
    • status: open --> open-fixed
     
  • Jan Nijtmans

    Jan Nijtmans - 2012-02-19

    fixed in itcl-3-branch

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-02-19
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB