Tk Source Code

View Ticket
Login
Ticket UUID: 1630271
Title: segfault/infinite loop when a mark is before -startline
Type: Bug Version: obsolete: 8.5.10
Submitter: treectrl Created on: 2007-01-08 04:06:07
Subsystem: 18. [text] Assigned To: jan.nijtmans
Priority: 8 Severity:
Status: Closed Last Modified: 2014-03-13 08:58:49
Resolution: Fixed Closed By: nijtmans
    Closed on: 2012-01-25 21:31:08
Description:
Normally you can't access characters before -startline because "1.0" refers to the beginning of -startline. But marks get around that little hindrance!

pack [text .t] -side top
.t insert end "1\n2\n3\n"
.t mark set insert 1.0
.t conf -startline 2

# This gives a weird result, "0.0"
.t index insert

# This will segfault
.t index insert-1c

# This will infinite loop and gobble up all yer memory
.t get insert
User Comments: nijtmans added on 2012-01-26 04:31:08:
Merged to core-8-5-branch and trunk. Closing

fvogelnew1 added on 2012-01-23 03:04:20:
Following what was said on the tclcore mailing list I'm proposing a patch here:

https://sourceforge.net/tracker/index.php?func=detail&aid=3477449&group_id=12997&atid=312997

fvogelnew1 added on 2012-01-21 18:08:13:
Fixing just exactly the reported test cases and nothing more is quite easy.
The insert and current marks are not shared between peers, and it's just a matter of clamping them to the newly changed -startline and -endline.
I have a patch that does this.

The problem is more tricky for all the other marks which are shared between peers.
Marks can be set anywhere in the text widget, but then what's the intended meaning of
.t index mymark
or
.t get mymark
in case the index mymark refers to turns out to be outside the -startline/-endline range?

Should these return an error?

What was the original intent in the design (TIP #169 - Add Peer Text Widgets)?

dgp added on 2007-12-12 21:44:49:
Logged In: YES 
user_id=80530
Originator: NO


Not going to get to this one.

dgp added on 2007-10-25 22:51:31:
Logged In: YES 
user_id=80530
Originator: NO


confirmed both serious bugs
are still present in the
Tk HEAD... about to be 8.5b2.