| Ticket UUID: | 05411ee5331ba3325dcf0f971ca80c82eb979e86 | |||
| Title: | Revised [text]: inserting text with an -elide 0 tag into an elided range fails an assertion | |||
| Type: | Bug | Version: | revised_text | |
| Submitter: | serhiy.storchaka | Created on: | 2026-10-10 11:39:25 | |
| Subsystem: | 18. [text] | Assigned To: | ||
| Priority: | 5 Medium | Severity: | Important | |
| Status: | Closed | Last Modified: | 2026-10-13 19:54:57 | |
| Resolution: | Fixed | Closed By: | ||
| Closed on: | ||||
| Description: |
In the revised text widget, inserting text with a tag that has -elide 0 into a range elided by another tag fails an assertion (build with --enable-symbols):
pack [text .t]
.t tag configure A -elide 0
.t tag configure B -elide 1
for {set i 1} {$i <= 25} {incr i} {.t insert end "row $i abcdef\n"}
.t tag add B 7.6 9.3
.t insert 8.4 "xy\n" A
tkTextBTree.c: TkBTreeFindStartOfElidedRange: Assertion `SegmentIsElided(sharedTextPtr, segPtr, textPtr)' failed.Untagged text, or text with a tag without -elide, is inserted without errors. The legacy text widget in main is not affected. Found by fuzzing the elide handling while looking at [ad458a3a72]. | |||
| User Comments: |
nab added on 2026-10-13 19:54:57:
Merged into revised_text with [07716463c0|07716463c0], as you asked. Thank you. serhiy.storchaka added on 2026-10-13 17:45:58: Please go ahead and merge both into revised_text. Thank you for testing them. nab added on 2026-10-13 17:23:13: Hi Serhiy, Both of your branches for the revised text widget are still open: elide0-insert-in-elided-range [a7fad20697] (this ticket) and elide-walk-skipped-lines [8d0c690381] ([ad458a3a72]). They merge together without conflict into the current revised_text [eea332730c], and text*.test passes with both (2108 tests, no failure, debug build). Our fuzzing of revised_text keeps hitting the assertion of this ticket, which hides other failures. Will you merge them into revised_text, or are you fine with us doing it? Separately, the nab added on 2026-10-11 12:42:19: The fix looks right to me: when the highest-priority elide tag of the new text has -elide 0, the text is not elided, so it has to split the enclosing range like untagged text, and a7fad20697 sends it through that path. Tested on a debug build (--enable-symbols):
The 10 remaining seeds all fail on
It also fails with 8d0c690381 and with both branches merged; The fuzzer found three other bugs, reported in f39133da29 (with a fix), 5b97764fc6 and cef1ef9d52. I can attach the fuzzer if it is useful. serhiy.storchaka added on 2026-10-10 12:14:46: Such text is not elided, so the enclosing elided range has to be split, as for untagged text inserted at the meeting point of two elide tags; but the update for the -elide 0 tag searched the start of the elided range from the new text. Proposed fix in branch elide0-insert-in-elided-range, [a7fad20697], test btree-14.121. Related fixed cases: [bdd1f64523] (switching -elide) and [859cb411ce] (adding a -elide 0 tag). | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki