Overview
| Artifact ID: | 7104ccd2367beac494336ef8026572cdbabffdb4 |
|---|---|
| Ticket: | 969358ffffffffffffffffffffffffffffffffff
Using -maxundo causes segfault in Text widget |
| User & Date: | jiangwu on 2004-06-09 04:01:15 |
Changes
- assignee changed to: "hobbs"
- cmimetype changed to: "text/plain"
- comment changed 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 changed to: "obsolete: 8.4.6"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "jiangwu"
- subsystem changed to: "41. Memory Allocation"
- title changed to: "Using -maxundo causes segfault in Text widget"
- type changed to: "Bug"