From: <no...@so...> - 2002-11-09 00:00:52
|
Bugs item #630533, was opened at 2002-10-29 08:00 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=630533&group_id=12997 Category: 67. Unix Window Operations Group: 8.4.1 Status: Open Resolution: Duplicate Priority: 8 Submitted By: Don Porter (dgp) Assigned to: Mo DeJong (mdejong) Summary: TkpCloseDisplay panic Initial Comment: On Linux/Alpha, with Tcl/Tk 8.4.1: #FILE panic.tcl proc Die { win } { if {![string equal . $win]} { return } exit } bind . <Destroy> {Die %W} #END FILE panic.tcl $ wish8.4 panic.tcl <Use the [x] of the wm to close the . window> input contexts not freed before XCloseIM Abort Now for the really weird part, compare with: #FILE nopanic.tcl proc Die { win } { if {. ne $win} { return } exit } bind . <Destroy> {Die %W} #END FILE nopanic.tcl $ wish8.4 panic.tcl <Same [x] wm close as before works fine> ---------------------------------------------------------------------- >Comment By: Mo DeJong (mdejong) Date: 2002-11-08 16:00 Message: Logged In: YES user_id=90858 After much searching, I found that the problem was that Tk was not freeing up window resources when exit was getting called in a Destroy binding. The XIM panic is really just a symptom of a larger problem. I think the attached patch will fix the real cause of the problem by freeing up the resources of windows that were only half destroyed. I also added some new test cases that address this problem. Please take a look at this patch and let me know if you see any obvious problems. ---------------------------------------------------------------------- Comment By: Mo DeJong (mdejong) Date: 2002-11-06 02:08 Message: Logged In: YES user_id=90858 I will take a crack at this one since I also have 620808 assigned to me. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2002-10-30 12:28 Message: Logged In: YES user_id=75003 Joe, Don is currently on vacation (wedding and honeymoon). You can check this with Mo DeJong too, he was the last one to go over the tk shutdown logic and he also did the changes touching XCloseIM and such. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2002-10-30 12:21 Message: Logged In: YES user_id=68433 I can't replicate this on my machine, but it looks like a duplicate of Tk Bug #620808 'wish crashes after "destroy .toplevel"', which also involves calling [exit] in a <Destroy> binding. I'm not sure I *entirely* understand lines 196-198 of tkUnixEvent.c r1.10 -- avoiding a potential crash in XCloseIM by triggering a surefire crash in panic :-) -- but the attached patch to Tk_DestroyWindow() should avoid the condition (for this case anyway). This simply moves the winPtr->inputContext cleanup code earlier in the teardown sequence, to a point _before_ any <Destroy> events are generated. (This is safe to do at any time, since winPtr->inputContext is checked for NULL in all the places where it's referenced.) If I'm following Tk's shutdown logic correctly (a pretty big if :-), this should fix the problem . Don, could you test the patch and see if it actually works? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=630533&group_id=12997 |