Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 327538d7ae00932c92f5e6e6c9e7413196f02cac
Ticket: 217978ffffffffffffffffffffffffffffffffff
interp hide, invokehidden bug
User & Date: nobody on 2000-10-26 00:47:05
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 5373 Bug
    Version: 8.3.1
    SubmitDate: '2000-05-05'
    LastModified: '2000-06-25'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: ericm
    RelatedBugIDs: 5845
    OS: Solaris
    OSVersion: solaris2.6, linux2.x
    Machine: sun-ultra5, pentium 686
    FixedDate: '2000-06-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    Hemang Lavana
    
    ReproducibleScript:
    I am experimenting with the "interp hide" and "interp invokehidden"
    commands. I do the following (see the attached example script):
      1. create a child interpreter
      2. load Tk package into the child interpreter
      3. hide the "button" command
      4. create an alias to a proc, called "button" in child interpreter,
          that uses "interp invokehidden" command to invoke the
          original (hidden) button command. It also prints a message
          to stdout whenever button command is called
      5. Create and pack buttons in the child interpreter.
    
    ----------------------
    # interphide.tk
    
    #wm iconify .
    set iid [interp create]
    load {} Tk $iid
    
    set tkcmds "button label"
    
    foreach cmd $tkcmds {
      $iid hide $cmd
      $iid alias $cmd createWidget $iid $cmd
    }
    
    proc createWidget {iid cmd pathname args} {
      set ret [uplevel 1 $iid invokehidden $cmd $pathname $args]
      puts stdout "$cmd $pathname $args, RETURNS=$ret."
      $iid hide $pathname
      $iid alias $pathname invokePathname $iid $pathname
      return $ret
    } ;# End of proc createWidget
    
    proc invokePathname {iid pathname args} {
      set ret [uplevel 1 $iid invokehidden $pathname $args]
      puts stdout "$pathname $args, RETURNS=$ret."
      return $ret
    } ;# End of proc invokePathname
    
    $iid eval {
      pack [button .b1 -text "Button B1" -command {puts .b1}]
      pack [button .b2 -text "Button B2" -command {puts .b2}]
    #  pack [label .l1 -text "label 1"]
    #  pack [label .l2 -text "label 2"]
    }
    # interphide.tk
    
    #wm iconify .
    set iid [interp create]
    load {} Tk $iid
    
    set tkcmds "button label"
    
    foreach cmd $tkcmds {
      $iid hide $cmd
      $iid alias $cmd createWidget $iid $cmd
    }
    
    proc createWidget {iid cmd pathname args} {
      set ret [uplevel 1 $iid invokehidden $cmd $pathname $args]
      puts stdout "$cmd $pathname $args, RETURNS=$ret."
      $iid hide $pathname
      $iid alias $pathname invokePathname $iid $pathname
      return $ret
    } ;# End of proc createWidget
    
    proc invokePathname {iid pathname args} {
      set ret [uplevel 1 $iid invokehidden $pathname $args]
      puts stdout "$pathname $args, RETURNS=$ret."
      return $ret
    } ;# End of proc invokePathname
    
    $iid eval {
      pack [button .b1 -text "Button B1" -command {puts .b1}]
      pack [button .b2 -text "Button B2" -command {puts .b2}]
    #  pack [label .l1 -text "label 1"]
    #  pack [label .l2 -text "label 2"]
    }
    -----------------------------
    
    When I invoke this script with wish8.3.1, I get a segmentation fault/bus
    error if I try to create more than one button. I do not get this errror, when
    invoked with wish8.0.5.
    
    u11> uname -a
    SunOS hlavana-u5 5.6 Generic_105181-10 sun4u sparc SUNW,Ultra-5_10
    
    u12> wish8.3 interhide.tk
    button .b1 -text {Button B1} -command {puts .b1}, RETURNS=.b1
    Bus error
    
    u13> wish8.0 interphide.tk
    button .b1 -text {Button B1} -command {puts .b1}, RETURNS=.b1
    button .b2 -text {Button B2} -command {puts .b2}, RETURNS=.b2
    ^C
    u14>
    
    ObservedBehavior:
    The "interp invokehidden" creates a bus error, whenever more than one button is
    created in the child interpreter. Similar results occur for other widgets too - I have
    observed this behavior for with "label" widget.
    
    This behavior is also noticed on linux2.x version (I don't recall the exact version number,
    but it was linux-mandrade 7.0). I have not tested on winNT/9x yet.
    
    DesiredBehavior:
    No "segmentation fault/bus error".
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.3.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "interp hide, invokehidden bug"
  11. type changed to: "Bug"