Robert Csok
unread,Sep 27, 2022, 5:50:11 AM9/27/22You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello, everybody
We have noticed that since Tk 8.6.10 our application crashes in connection with bindings. Different kinds of assertions fail in tkBind.c, for instance:
tkBind.c:2825: MatchPatterns: Assertion `(psPtr->object == NULL) == (physPtrPtr != NULL)'
tkBind.c:2489: Tk_BindEvent: Assertion `i + 1 < psEntry->psPtr->numPats'
tkBind.c:2827: MatchPatterns: Assertion `psPtr->numPats > patIndex'
tkBind.c:2824: MatchPatterns: Assertion `TEST_PSENTRY(psPtr)'
From what I can tell at a glance, major changes were made to tkBind.c between 8.6.9 and 8.6.10.
I have attached a small script that can be used to reproduce the crashes (see below).
Could you guys please take another look at this?
Kind regards,
Robert
#!/bin/sh
#\
exec wish "$0" ${1+"$@"}
# If you draw a line, the program crashes with Tk since 8.6.10.
#
# Tested under
# Ubuntu 18.04/Tk 8.6.8 (works)
# Ubuntu 20.04/Tk 8.6.10 (crashes)
# Ubuntu 22.04/Tk 8.6.12 (crashes)
# openSUSE 15.4/Tk 8.6.12 (crashes)
# among others
#
# (8.6.9 works, 8.6.11 crashes)
#
# If Tk was compiled without debugging information, it may take several
# attempts to crash the program.
proc startLin {c} {
unbindCan $c; # try without this (shouldn't crash then)
# Some array (move mouse after <ButtonRelease-1>):
set arr($c,foofoofoo) ""
set arr($c,barbarbar) 1
# or try this instead (and move mouse, leave canvas or draw another line after <ButtonRelease-1>):
# set arr($c,foo) ""
# set arr($c,bar) 1
# Try this (shouldn't crash then)
# unset arr
bindCan $c [array get arr]
}
proc bindCan {c args} {
bind $c <ButtonPress-1> "createLin %W %x %y"
bind $c <B1-Motion> "drawLin %W %x %y"
# Try without the next two lines (shouldn't crash then)
bind $c <B1-Motion><Leave> "leaveCan %W"
bind $c <B1-Motion><Enter> "enterCan %W"
bind $c <ButtonRelease-1> "startLin %W"
}
proc unbindCan {c} {
bind $c <ButtonPress-1> {}
bind $c <B1-Motion> {}
# Try without the next two lines (shouldn't crash then)
bind $c <B1-Motion><Leave> {}
bind $c <B1-Motion><Enter> {}
bind $c <ButtonRelease-1> {}
}
proc createLin {c x y} {
set x0 [$c canvasx $x]
set y0 [$c canvasy $y]
$c delete linTag
$c create line $x0 $y0 $x0 $y0 -tags linTag
}
proc drawLin {c x y} {
lassign [$c coords linTag] x0 y0
$c coords linTag [list $x0 $y0 [$c canvasx $x] [$c canvasy $y]]
}
proc leaveCan {c} {
# nothing
}
proc enterCan {c} {
# nothing
}
set c [canvas .c]
pack $c
startLin $c