Bugs/Threaded Tcl

From Eggdrop Wiki

Revision as of 04:23, 6 January 2010 by Thommey (Talk | contribs)
Jump to: navigation, search

Some recent versions of Debian have begun shipping out with TCL pre-compiled as threaded instead of non-threaded. The techno-babble: In its current form, eggdrop cannot detect whether TCL is compiled as threaded or not. For many years, the developers just assumed that TCL was not threaded, as it was shipped this way with OS's nearly all the time. If eggdrop doesn't know TCL is compiled with threads, when eggdrop tries to fork(), it hangs. Debian recently changed the way TCL was compiled and distributed, and as a result of not being able to detect that during the compile process, a few changes need to be made to the source to allow it to run again. Again, for the average user, what was just described won't make sense and doesn't need to, there is no advantage for eggdrop to run with threaded or non-threaded TCL. Bottom line, if you want to fix it, try one of the solutions below.


Solution 1: Apply Tothwolf's Patch to your 1.6.19 source

Tothwolf's patch can be found here. Specific instructions on how to apply it are here.

  1. Apply this patch to the 1.6.19 source.
  2. Reconfigure your source with --enable-tcl-threads (./configure --enable-tcl-threads).
  3. make config
  4. make
  5. make install
  6. enjoy!

Solution 2: Edit config.h

./configure your bot. Then Open the config.h file in your editor.

Search for (around line 244)

/* Define for Tcl that has threads. */
/* #undef HAVE_TCL_THREADS */

and replace it with

/* Define for Tcl that has threads. */

Carry on with your make config && make && make install.

Solution 3: Recompile Tcl

So, here's the deal. Eggdrop is supposed to be coded to handle Tcl threading. Either that code never worked, or it's now broken because of some change in Tcl internally. The solution? Compile and install Tcl with no threads, then recompile and reinstall your eggdrop.

Yeah, some of you will say 'Oh, ok, easy' and go and do it. The rest of you are probably saying 'Huh?'

These are some of the possible solutions to fix your problem:

If you don't have root access

If you have root access

Debian with Tcl 8.5, Ubuntu 8.04 with Tcl 8.5

  • Install the dependencies for developing debian packages using apt-get. There is a list of these dependencies on this page in section 1.1.
  • mkdir /root/tcl
  • cd /root/tcl
  • apt-get source tcl8.5
  • cd into the directory it creates (tcl8.5-8.5.2 currently)
  • cd debian
  • edit rules; remove the line " --enable-threads \" (currently line 52)
  • cd ..
  • dpkg-buildpackage -rfakeroot
  • Your .deb files are now being built.
  • cd ..
  • dpkg -i *.deb

Instead of doing that yourself, you could download the .deb files here: Debian and Ubunto 8.04 and dpkg -i them yourself.

If you don't trust the files I've built, build them yourself, it shouldn't be that hard.

  • Note: The Ubunto 8.04 tcl8.5 debian/rules file is borked. The quotes in lines 16, 21, and 23 need to be removed. Line 57 should be '$(MAKE) CFLAGS="$(CFLAGS)"'. The Ubuntu-MOTU group has been notified, and someone is filing a bug.

RHEL5/CentOS5 or Fedora Core 9 with Tcl 8.5

Instead of doing that yourself, you could download the RPMs here: RHEL5/CentOS5 or Fedora Core 9 and rpm -Uvh them yourself.

  • Note on FC9: I had to 'rm -rf /usr/lib/tcl8.5' after 'rpm -e tcl' before the new RPM would install.

If you don't trust the files I've built, build them yourself, it shouldn't be that hard.


cp -r /var/abs/extra/tcl .
cd tcl
nano PKGBUILD   (delete --enable-threads)
pacman -U tcl-8.5.2-1-i686.pkg.tar.gz
Personal tools