First: I'm using the package from latest. Pressing backspace in a not empty text widget results in a "kernel: pid 2770 (tclsh9.0), jid 0, uid 1001: exited on signal 11 (no core dump - bad address)" Simple code example: ------------------------- #!/usr/local/bin/tclsh9.0 package require Tk text .t pack .t ------------------------- Entering a char in a text widget and then pressing backspace crashes the Tcl/Tk interpreter; Pressing backspace in an empty widget doesn't crash.
I haven't got the chance to test it yet, but perhaps could you apply the patch that fixed this ticket and see if that is it? https://core.tcl-lang.org/tk/tktview/f52986c698
Here's the mentioned patch: https://core.tcl-lang.org/tk/info/7a599109d4fc8ea5 I've deinstalled the tcl90 and tk90 package (no other Tcl/Tk package installed), and compiled the source to test the patch; Doesn't make a difference. (And in another test I also tried the more popular gmake instead of FreeBSDs make…) And it's not just the text widget - the basic input field "ttk::entry" f.e. also fails. I tried to start more tests: On Debian I even can't open any Tk window: While with 8.6 a simple "package require Tk" works, on 9.0 - if wish or tclsh - loading Tk fails with 'couldn't connect to display ":1"'. And "bind <Leave>" fires up before a new window is drawn, so if you say "destroy .window" inside a Leave-event (f.e. "selfmade (context) menus") you'll never get your window :( At least the Unix version of Tcl/Tk 9 IMO seems to be more alpha than a production release. BTW, the package description of Tk 9.0 names itself 8.7 ;)
May be related: Bindings can crash the Tk interpreter, too. An example code that can be executed in the wish9.0 shell: % pack [ entry .e ] % bind .e <Control-f> { puts "ok" } % focus .e Now press [Control-f] in the entry field, and it will crash with a "bad address" (the focus line in my example is just for convenience). Same by using wish8.6 works as expected. So IMO this bug more related to bindings than to a special widget (widgets have default bindings).
I have just pushed a change to build tk90 with symbols when WITH_DEBUG is set. Can you please rebuild both tcl90 and tk90 using `make WITH_DEBUG=yes`, and provide a stack trace of the crash?
Building the Tcl/Tk 9 packages with symbols enabled is done, but… what is a "stack trace" on Tcl? If that's running the code with something like if { [catch { mycode } err] } { puts "Error info $err" } then there's no difference: It crashes without (/prior?) catch catches anything - simply with "Segmention fault (core dumped)" in the terminal and a "kernel: pid 23919 (tclsh9.0), jid 0, uid 1001: exited on signal 11 (core dumped)" in /var/log/messages. The core dump I could provide, but examine 37.660 kB… Anyway, if that's what needed: https://jmos.net/stuff/tclsh9.0.core
Yep thanks, that's what I was looking for. I'll keep you posted.
Can you please also post `pkg info tcl90` and `pkg info tk90`?
jo@ancamna ~> cat /etc/make.conf DEFAULT_VERSIONS+=tcltk=9.0 jo@ancamna ~> pkg info tcl90 tcl90-9.0.0 Name : tcl90 Version : 9.0.0 Installed on : Thu Oct 17 12:11:23 2024 CEST Origin : lang/tcl90 Architecture : FreeBSD:14:amd64 Prefix : /usr/local Categories : lang Licenses : TclTk Maintainer : tcltk@FreeBSD.org WWW : https://www.tcl.tk/ Comment : Tool Command Language Options : DTRACE : on TCLMAN : on TZDATA : on Shared Libs required: libtommath.so.1 Annotations : FreeBSD_version: 1401000 cpe : cpe:2.3:a:tcl:tcl:9.0.0:::::freebsd14:x64 Flat size : 13.2MiB Description : This is Tcl version 9.0, an embeddable tool command language. Tcl (Tool Command Language) is a very powerful but easy to learn dynamic programming language, suitable for a very wide range of uses, including web and desktop applications, networking, administration, testing and many more. Open source and business-friendly, Tcl is a mature yet evolving language that is truly cross platform, easily deployed and highly extensible. A full set of manual pages is also provided with this port. jo@ancamna ~> pkg info tk90 tk90-9.0.0 Name : tk90 Version : 9.0.0 Installed on : Thu Oct 17 12:12:13 2024 CEST Origin : x11-toolkits/tk90 Architecture : FreeBSD:14:amd64 Prefix : /usr/local Categories : x11-toolkits Licenses : TclTk Maintainer : tcltk@FreeBSD.org WWW : https://www.tcl.tk/ Comment : Graphical toolkit for Tcl Options : DEMOS : off TKMAN : off Shared Libs required: libtommath.so.1 libtcl9.0.so libfreetype.so.6 libfontconfig.so.1 libcups.so.2 libXss.so.1 libXrender.so.1 libXft.so.2 libXext.so.6 libX11.so.6 Annotations : FreeBSD_version: 1401000 Flat size : 6.50MiB Description : This is Tk version 8.7, a GUI toolkit for Tcl. Tk is a graphical user interface toolkit that takes developing desktop applications to a higher level than conventional approaches. Tk is the standard GUI not only for Tcl, but for many other dynamic languages, and can produce rich, native applications that run unchanged across Windows, Mac OS X, Linux and more. A full set of manual pages is also provided with this port.
I cannot reproduce the crash with my Tcl/Tk 9.0 on FreeBSD 14.1-RELEASE-p4 amd64 under xorg-server and i3. Can you please upload your tclsh9.0 somewhere, and include any other information (FreeBSD version, etc.)? Also, what X11 are you running? What desktop environment? Anything else?
Now I am really confused… Yesterday on a blank virtual machine: "pkg install xorg tk90" crashed as expected. "pkg delete -a" followed by compiling the two packages (and a "pkg autoremove"), and it worked (!). Now a "pkg upgrade -a" replaced all self-compiled packages with the ones installed at the beginning, and it still worked (!?). Today I wanted to document this "ports okay, packages buggy - but something is weird". So I took a backup of that machine and started again with "pkg install xorg tk90" - but with a different result: It worked right from the start… But I'm still unsuccessful on my main computer, fetching & reinstalling all packages don't help - and there I cannot create any core dumps for analyzing: It quits saying that those dumps are too large :( Maybe one random package around on some package servers is buggy, and I still didn't get a "good" one my main machine? Anyway, I don't think that this is a Tk 9 bug. Closing this topic.
Thanks!