Forum OpenACS Development: Warning about Tcllib 1.21 with OpenACS

Dear all,

This is a warning to wait a little bit before using tcllib 1.21 (released May 2021) inside OpenACS. Between tcllib 1.20 and 1.21 several changes were introduced in tcllib using now reflected channels [1], such as e.g. in the mime package. Before that, reflected channels were not used by the tcllib packages used by OpenACS.

Unfortunately, it turned out that there is a bug in all the released version of Tcl in connection with thread cleanup and reflected channels, causing a (hard) crash. This bug is present in at least Tcl 8.6.9 - 8.6.13, Tcl 8.7* and Tcl9. Fortunately, this bug is now fixed [2] in all the variants of Tcl, but it will take some time until new releases containing these fixes will come out.

For the time being, it is recommended to stay with tcllib 1.20.

All the best
-g

[1] https://www.tcl.tk/man/tcl8.6/TclCmd/refchan.html
[2] https://core.tcl-lang.org/tcl/tktview/534172ff5b7f0e64f11a0ae6ba83ca1b359f73c6

Collapse
Posted by Andrew Piskorski on
That crash bug was fixed back on 2023-02-22 in the Tcl core-8-6-branch, so Tcl 8.6.13 should include that fix, right? Are there are other related problems with Tcllib 1.21, though?

I was using Tcl 8.6.13 and Tcllib 1.21 with a really old version of OpenACS, and ran into some weird failures where mime::buildmessage was dying inside tcl::chan::memchan with invalid command name "memchan::implementation" errors. I switched back to Tcllib 1.20, which I think has fixed those errors. Maybe the latest OpenACS would work ok with Tcllib 1.21, I don't know. But I plan to stick withTcllib 1.20 there for now too, just like Gustaf's install-ns script recommends.

Collapse
Posted by Gustaf Neumann on
Maybe the latest OpenACS would work ok with Tcllib 1.21, I don't know.
The problem is the interaction between Tcl and tcllib. It also occurs without OpenACS. The problem is fixed in the repository. So, when using the newest version of Tcl 8.6 from fossil, or when the next release of Tcl 8.6 or newer happens, tcllib 1.21 will work. If one relies on released versions/binaries, stick with tcllib 1.20.

Some words to Tcl9: The new flagship version of Tcl will be released soon (I know, since is said since at least a year, but now it looks realistic). This version brings true 64bit sizes for Tcl_Objs (the 2GB limit is gone) has many changes both on the C and the Tcl layer. While the C infrastructure (NaviServer/XOTcl/tDOM/ - newest and partly not-released versions) is ported and running with Tcl9, OpenACS will require some changes (checkout the long list of changes that were necessary for tcllib [2], I expect similar changes will be needed for OpenACS).

The plan is to get first OpenACS 5.10.1 out, and not to delay the process. For the Tcl9 compatible versions, we should create a new branch to avoid instabilities in the oacs-5-10 branch.

[1] https://wiki.tcl-lang.org/page/Porting+extensions+to+Tcl+9
[2] https://openacs.org/conf2023/info/download/file/porting-tcllib-tcl9.pdf