Tk Source Code

View Ticket
Login
Ticket UUID: 1630262
Title: segfault when deleting a line which is a -startline
Type: Bug Version: obsolete: 8.5.10
Submitter: treectrl Created on: 2007-01-08 03:43:03
Subsystem: 18. [text] Assigned To: fvogel
Priority: 7 High Severity: Minor
Status: Closed Last Modified: 2013-09-23 21:39:03
Resolution: Fixed Closed By: fvogel
    Closed on: 2013-09-23 21:39:03
Description:
text .t
.t insert end "1\n2\n3\n"
.t peer create .peer
.t configure -startline 3
.peer delete 2.0 end


I tracked this down to tkTextBTree.c:AdjustStartEndRefs(),
change 2 lines from this...

treePtr->startEndRef[count] = treePtr->sharedTextPtr->peers;

to this ...

treePtr->startEndRef[count] = textPtr;
User Comments: fvogelnew1 added on 2012-02-29 03:49:14:

allow_comments - 1

Merged in core-8-5-branch and trunk. Closing now.

fvogelnew1 added on 2012-02-02 17:41:45:
Second thoughts.
I have pushed a better fix for this bug, in the same branch bug-1630262

As a side effect, this new version also fixes bug-1615425.

fvogelnew1 added on 2012-02-01 05:28:35:
I have proposed a patch which is available for review in branch bug-1630262

fvogelnew1 added on 2012-01-23 17:13:21:
The proposed change indeed prevents the crash for the given test case.
It has however the side effect of resetting -startline of .t to {}, which is debatable.

Anyway I still get a crash when running the following slightly modified test case:

text .t
.t peer create .pt
pack .t .pt
.t configure -height 12
.pt configure -height 12
for {set i 1} {$i<10} {incr i} {
  .t insert end "Line $i\n"
}
.t configure -startline 5
.pt configure -startline 3
.pt delete 2.0 end