FS#16401 - [tcl] threads cause deadlock when processes fork

Attached to Project: Arch Linux
Opened by Michael Kreitzer (mrgrim) - Wednesday, 30 September 2009, 02:40 GMT
Last edited by Allan McRae (Allan) - Saturday, 23 January 2010, 12:57 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

tcl 8.5 has a known problem where forking causes a futex deadlock when tcl is compiled with --enable-threads. This is documented in the following places:

http://sourceforge.net/tracker/index.php?func=detail&aid=1470152&group_id=10894&atid=110894
http://coding.derkeiler.com/Archive/Tcl/comp.lang.tcl/2008-01/msg00023.html
http://groups.google.com/group/comp.lang.tcl/msg/ce6a1324bada8db0

I encountered this when a user attempted to run an eggdrop bot. When running with the -n flag which causes eggdrop not to fork it works fine. Otherwise it deadlocks. The only solution is to compiled tcl using --disable-threads. This is the solution other distributions have taken.

https://bugzilla.redhat.com/show_bug.cgi?id=443246

If there is nothing specific that must have tcl threads I would request this be disabled in the package in extra.
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 23 January 2010, 12:57 GMT
Reason for closing:  Won't implement
Additional comments about closing:  See comment
Comment by Allan McRae (Allan) - Thursday, 01 October 2009, 13:34 GMT
What version of eggdrop are you using? Debian patches eggdrop to ensure thread usage...
Comment by Michael Kreitzer (mrgrim) - Thursday, 01 October 2009, 14:14 GMT
Whatever the latest is.. a user on my machine was the one setting it up. 1.6.19+ctcpfix.

The issue is not eggdrop, however. Eggdrop simply exposes the bug. _Any_ application that links to TCL or is written in TCL that forks while threads are enabled _in TCL_ will deadlock. It's TCL itself that must be compiled with --disable-threads. Another discussion can be found here where compiling with threads disabled breaks other things:

http://www.linux-archive.org/fedora-development/348808-tcl-tk-without-threads.html

All in all it seems TCL just sucks no matter what you do, the issue will not be fixed, and the official solution is ship two packages.. one w/ threads and one w/o.

Perhaps a solution might be to have two packages that provide tcl, tcl-nothreads and tcl-threads, and make one default when pacman needs tcl.
Comment by Allan McRae (Allan) - Saturday, 23 January 2010, 12:57 GMT
I will keep tcl with threading support as the main tcl in the repos. If a non-threading build is needed, make one and add it to the AUR. Although, I would look for a patch in Debian first...

Loading...