Artifacts Associated With Ticket 217978
Ticket change [327538d7ae] (rid 93613) by nobody on 2000-10-26 00:47:05:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized 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". - foundin initialized to: "obsolete: 8.3.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "interp hide, invokehidden bug"
- type initialized to: "Bug"
Ticket change [9b2f8d8ee9] (rid 111086) by welch on 2000-10-26 08:12:09:
- closedate changed to: "2000-10-26T01:12:09"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [8ad0c03e9a] (rid 127454) by dgp on 2001-04-14 03:16:47:
- closedate changed to: "2001-04-13T20:16:47"
- closer changed to: "dgp"
- subsystem changed to: "20. [interp]"