Artifacts Associated With Ticket 969358ffffffffffffffffffffffffffffffffff
Ticket change [7104ccd236] (rid 100596) by jiangwu on 2004-06-09 04:01:15:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
After setting the -maxundo option in the text widget, a memory violation happens when number of undo operations exceeds this maximum bound. Using tcl 8.4.6 with memory debugging on, do this: text .t -undo 1 -autoseparator 1 -maxundo 2 pack .t -expand 1 -fill both .t insert end <some block of text> 1. select a portion of the text and do "Control-X" 2. do "Control-V" to paste back. 3. select another block of text an do "Control-X", the program crashes. The bug is in tkUndo.c, line 205. The loop to free undo element is incorrect. Patch to fix is this: Index: generic/tkUndo.c ========================================== ========================= RCS file: /home/cvs/starvine/cvsroot/tk/generic/tkUndo.c,v retrieving revision 1.3 diff -u -r1.3 tkUndo.c --- generic/tkUndo.c 9 Mar 2004 08:23:25 -0000 1.3 +++ generic/tkUndo.c 9 Jun 2004 03:52:01 -0000 @@ -205,7 +205,7 @@ while ( elem ) { prevelem = elem; elem = elem->next; - ckfree((char *) elem); + ckfree((char *) prevelem); } stack->depth = stack->maxdepth; } - foundin initialized to: "obsolete: 8.4.6"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "jiangwu"
- subsystem initialized to: "41. Memory Allocation"
- title initialized to: "Using -maxundo causes segfault in Text widget"
- type initialized to: "Bug"
Ticket change [6a35f56913] (rid 128105) by dkf on 2004-06-10 02:20:27:
- resolution changed to: "Fixed"
Ticket change [fbe913c3bd] (rid 108141) by dkf on 2004-06-10 02:20:28:
- icomment:
Logged In: YES user_id=79902 Thanks for spotting this. Fixed in HEAD (though we could also do with a test, not that I could exhibit the bug in the first place due to memory manager differences; purifying would have caught this if it was triggered). Backport to 8.4 branch required.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [2390bf6c38] (rid 130962) by dkf on 2004-06-10 02:20:54:
- priority changed to: "9 Immediate"
Ticket change [d929752d18] (rid 107559) by hobbs on 2004-07-15 02:08:26:
- closedate changed to: "2004-07-14T19:08:26"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 backported for 8.4.7.
- login: "hobbs"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "hobbs"