Try this script:
pack [text .t]
set linespace [font metrics [.t cget -font] -linespace]
.t insert end "1234\n" trigger "5678" used
.t tag bind trigger <Leave> {
.t tag delete used
.t tag configure unused -background yellow
.t tag bind unused <Enter> { puts "Bug: tag 'unused' is not used" }
}
.t tag bind used <Enter> {}
update
event generate .t <Motion> -x 5 -y 5 ;# hover fst line
event generate .t <Motion> -x 5 -y [expr {$linespace + 5}] ;# hover snd line
exit 0
This is the result on console:
Obviously this should not happen. It is possible that this bug is causing a crash (because Tk_BindEvent will be called with invalid data from free'd blocks). In revised version this problem is eliminated.