From: <no...@so...> - 2001-07-02 23:56:34
|
Bugs item #228024, was opened at 2001-01-08 04:23 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=228024&group_id=12997 Category: Canvas Basics Group: 8.3.2 >Status: Pending Resolution: Remind Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Jeffrey Hobbs (hobbs) Summary: core dumps with canvas Initial Comment: I wrote a little application which uses a canvas to display pie charts showing disk usage. I used bindings of mouse events so that clicking on a pie would zoom in and show the disk usage for that pie segment. This worked fine until 8.3.2, now it occasionally causes a core dume (occasionally means about a 50% chance). I think the problem is at least in part due to the way I re-build the canvas image. The function that gets executed when a pie segment is clicked destroys the canvas and then re-builds it. I've now fixed my code so that it just removes all the items from the canvas and the core dumps have stopped happening. Below is a fairly minimal example that demonstrates the problem. Note that it does not core dump every time. Note also I'm running this on a redhat 6.2 system using Freewrap 4.4 (I've also tried it on redhat 7.0 using tk 8.3.2, same problems.. so i think FreeWrap is not guilty). http://home.nycap.rr.com/dlabelle/freewrap/freewrap.html Note also I was unable to register / log in to the bug system (filled the form in then get told access denied... ) If you need further information please contact John Gill at jn...@re... #!/usr/bin/wish proc do_canvas {win} { eval destroy [winfo children $win] set c [canvas $win.c -height 200 -width 200] pack $c -fill both -expand yes $c create rectangle 80 80 120 120 -fill blue -tags blue # bind a button press to re-build the canvas $c bind blue <B1-ButtonRelease> [list do_canvas $win] return } do_canvas . ---------------------------------------------------------------------- >Comment By: Jeffrey Hobbs (hobbs) Date: 2001-07-02 16:56 Message: Logged In: YES user_id=72656 This core dump was fixed by the previous revert of changes. I've set it to remind just because it's still not "correct". ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2001-04-05 18:13 Message: Logged In: YES user_id=72656 trying to open this... ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2001-04-05 18:08 Message: Logged In: YES user_id=72656 * generic/tkCanvas.c (CanvasEventProc): reverted 2001-04-02 canvas changes back because it lead to cached fonts not being freed. The changes were correct for the bug, but the problem is that the needed Tcl_EventuallyFree will sometimes not get called until the whole app is being destroyed and thus the font panic is invoked. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2001-04-02 15:54 Message: Logged In: YES user_id=72656 The problem of course is in deleting the canvas while it was doing something. I traced this back to the fact that Tcl_Preserve and Tcl_Release are bing used properly, but Tcl_EventuallyFree wasn't used. I reordered the code in DestroyCanvas and CanvasEventProc to account for this correctly. I found that the entry and listbox widgets also violated this same use of the triad and fixed those. Fixes in 8.4a3. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2001-01-18 02:48 Message: Confirmed in 8.4a2. Stacktrace from core dump (on Solaris) follows (I don't have a debugging version built right now, so this is as much detail as I can supply.) #0 0xff1cd590 in Tcl_DeleteHashEntry () from /tmp/lib/libtcl8.4.so #1 0xff2b3658 in Tk_FreeGC () from /tmp/lib/libtk8.4.so #2 0xff303148 in Tk_DeleteOutline () from /tmp/lib/libtk8.4.so #3 0xff3056ec in DeleteRectOval () from /tmp/lib/libtk8.4.so #4 0xff2eef00 in DestroyCanvas () from /tmp/lib/libtk8.4.so #5 0xff2ef848 in CanvasEventProc () from /tmp/lib/libtk8.4.so #6 0xff2ae090 in Tk_HandleEvent () from /tmp/lib/libtk8.4.so #7 0xff2c4534 in Tk_DestroyWindow () from /tmp/lib/libtk8.4.so #8 0xff2a8230 in Tk_DestroyObjCmd () from /tmp/lib/libtk8.4.so #9 0xff1e3300 in EvalObjv () from /tmp/lib/libtcl8.4.so #10 0xff1e3944 in Tcl_EvalEx () from /tmp/lib/libtcl8.4.so #11 0xff1a3c60 in Tcl_EvalObjEx () from /tmp/lib/libtcl8.4.so #12 0xff1a86bc in Tcl_EvalObjCmd () from /tmp/lib/libtcl8.4.so #13 0xff1c25d8 in TclExecuteByteCode () from /tmp/lib/libtcl8.4.so #14 0xff1a3f0c in Tcl_EvalObjEx () from /tmp/lib/libtcl8.4.so #15 0xff1ead80 in TclObjInterpProc () from /tmp/lib/libtcl8.4.so #16 0xff1e3300 in EvalObjv () from /tmp/lib/libtcl8.4.so #17 0xff1e3944 in Tcl_EvalEx () from /tmp/lib/libtcl8.4.so #18 0xff1e3ba8 in Tcl_Eval () from /tmp/lib/libtcl8.4.so #19 0xff1a5708 in Tcl_GlobalEval () from /tmp/lib/libtcl8.4.so #20 0xff2a32dc in Tk_BindEvent () from /tmp/lib/libtk8.4.so #21 0xff2f20d0 in CanvasDoEvent () from /tmp/lib/libtk8.4.so #22 0xff2f1a3c in CanvasBindProc () from /tmp/lib/libtk8.4.so #23 0xff2ae090 in Tk_HandleEvent () from /tmp/lib/libtk8.4.so #24 0xff2ae4d0 in WindowEventProc () from /tmp/lib/libtk8.4.so #25 0xff1e0b20 in Tcl_ServiceEvent () from /tmp/lib/libtcl8.4.so #26 0xff1e0dc8 in Tcl_DoOneEvent () from /tmp/lib/libtcl8.4.so #27 0xff2ae544 in Tk_MainLoop () from /tmp/lib/libtk8.4.so #28 0xff2b9654 in Tk_MainEx () from /tmp/lib/libtk8.4.so #29 0x10bc4 in main () ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=228024&group_id=12997 |