Bugs/Threaded Tcl
From Eggdrop Wiki
m (New answer) |
m (moved Threaded Tcl to Bugs/Threaded Tcl: introducing common "Bugs" prefix) |
||
(35 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
- | + | {{Alertbox|red|This page is deprecated as of Eggdrop 1.6.20. You should upgrade instead of applying the fixes below!}} | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | Some recent versions of Debian have begun shipping out with Tcl pre-compiled as threaded instead of non-threaded. The techno-babble: Up until now, eggdrop could not detect whether Tcl was 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 changed the way Tcl was compiled and distributed a while back, 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 [[User:Tothwolf|Tothwolf]]'s Patch to your 1.6.19 source = |
- | + | [[User:Tothwolf|Tothwolf]]'s patch can be found [http://www.techmonkeys.org/~tothwolf/eggdrop/eggdrop1.6.19+runtime-threads.patch.gz here]. | |
- | + | Specific instructions on how to apply it are [[thread-patch|here]]. | |
- | + | ||
- | + | # Apply this patch to the 1.6.19 source. | |
- | + | # ./configure | |
+ | # make config | ||
+ | # make | ||
+ | # make install | ||
+ | # enjoy! | ||
+ | |||
+ | = Solution 2: Edit config.h = | ||
+ | '''./configure''' your bot. | ||
+ | {{Changefile|file=config.h|line=244|lang=C|text= | ||
+ | /* Define for Tcl that has threads. */ | ||
+ | /* #undef HAVE_TCL_THREADS */ | ||
+ | |newtext= | ||
/* Define for Tcl that has threads. */ | /* Define for Tcl that has threads. */ | ||
#define HAVE_TCL_THREADS 1 | #define HAVE_TCL_THREADS 1 | ||
+ | }} | ||
Carry on with your make config && make && make install. | 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. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | So, here's the deal. Eggdrop is supposed to be coded to handle | + | |
Yeah, some of you will say 'Oh, ok, easy' and go and do it. The rest of you are probably saying 'Huh?' | 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: | These are some of the possible solutions to fix your problem: | ||
+ | == If you don't have root access == | ||
+ | |||
+ | *[[Installing_Tcl_locally_in_your_shell|Install tcl locally]] | ||
== If you have root access == | == If you have root access == | ||
- | === Debian with | + | === 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 [http://www.debian.org/doc/manuals/maint-guide/ch-start.en.html this page] in section 1.1. | * Install the dependencies for developing debian packages using apt-get. There is a list of these dependencies on [http://www.debian.org/doc/manuals/maint-guide/ch-start.en.html this page] in section 1.1. | ||
* mkdir /root/tcl | * mkdir /root/tcl | ||
* cd /root/tcl | * cd /root/tcl | ||
- | * apt-get source | + | * apt-get source tcl{{LSR/Tcl/Major}} |
- | * cd into the directory it creates ( | + | * cd into the directory it creates (tcl{{LSR/Tcl/Major}}-{{LSR/Tcl}} currently) |
* cd debian | * cd debian | ||
* edit rules; remove the line " --enable-threads \" (currently line 52) | * edit rules; remove the line " --enable-threads \" (currently line 52) | ||
Line 44: | Line 52: | ||
* dpkg -i *.deb | * dpkg -i *.deb | ||
- | Instead of doing that yourself, you could download the .deb files here: [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/debian/ Debian] and [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/Ubuntu8.04/ | + | Instead of doing that yourself, you could download the .deb files here: [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/debian/ Debian] and [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/Ubuntu8.04/ Ubuntu 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. | If you don't trust the files I've built, build them yourself, it shouldn't be that hard. | ||
- | * Note: The | + | * Note: The Ubuntu 8.04 tcl{{LSR/Tcl/Major}} 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 | + | === RHEL5/CentOS5 or Fedora Core 9 with Tcl 8.5 === |
* mkdir /root/tcl | * mkdir /root/tcl | ||
* cd /root/tcl | * cd /root/tcl | ||
- | * Get the latest | + | * Get the latest {{LSR/Tcl/Major}} source from http://sourceforge.net/project/showfiles.php?group_id=10894 |
- | ** wget | + | ** wget {{LSR/Tcl/URL}} |
- | ** wget http:// | + | ** wget http://prdownloads.sourceforge.net/tcl/tcl{{LSR/Tcl}}-html.tar.gz |
- | * tar zxf | + | * tar zxf tcl{{LSR/Tcl}}-src.tar.gz |
* mv *.gz /usr/src/redhat/SOURCES | * mv *.gz /usr/src/redhat/SOURCES | ||
- | * cd | + | * cd tcl{{LSR/Tcl}} |
* cd unix | * cd unix | ||
* mv tcl.spec tcl.spec.orig | * mv tcl.spec tcl.spec.orig | ||
Line 63: | Line 71: | ||
* edit tcl.spec | * edit tcl.spec | ||
** %define majorver 8.5 | ** %define majorver 8.5 | ||
- | *** (should be 8.5, that's from our source version, | + | *** (should be 8.5, that's from our source version, {{LSR/Tcl}}) |
- | ** Version: %{majorver}. | + | ** Version: %{majorver}.{{LSR/Tcl/Minor}} |
- | *** (. | + | *** (.7 at the end, that's from our source version, {{LSR/Tcl}}) |
** Release: 2 | ** Release: 2 | ||
- | *** (Not so important, if you really want to make it match the source, grab the release number from tcl.spec.orig. In this case, it's 2 anyway: 8.5. | + | *** (Not so important, if you really want to make it match the source, grab the release number from tcl.spec.orig. In this case, it's 2 anyway: 8.5.7-2) |
* cd .. | * cd .. | ||
* rpmbuild -bb unix/tcl.spec | * rpmbuild -bb unix/tcl.spec | ||
* cd /usr/src/redhat/RPMS/i386/ | * cd /usr/src/redhat/RPMS/i386/ | ||
- | * rpm -Uvh tcl- | + | * rpm -Uvh tcl-{{LSR/Tcl}}-*.i386.rpm tcl-devel-{{LSR/Tcl}}-*.i386.rpm tcl-html-{{LSR/Tcl}}-*.i386.rpm |
Instead of doing that yourself, you could download the RPMs here: [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/RHEL5/ RHEL5/CentOS5] or [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/fc9/ Fedora Core 9] and rpm -Uvh them yourself. | Instead of doing that yourself, you could download the RPMs here: [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/RHEL5/ RHEL5/CentOS5] or [http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/fc9/ Fedora Core 9] and rpm -Uvh them yourself. | ||
Line 84: | Line 92: | ||
nano PKGBUILD (delete --enable-threads) | nano PKGBUILD (delete --enable-threads) | ||
makepkg | makepkg | ||
- | pacman -U tcl- | + | pacman -U tcl-{{LSR/Tcl}}-*-i686.pkg.tar.gz |
Current revision as of 11:38, 6 May 2012

Some recent versions of Debian have begun shipping out with Tcl pre-compiled as threaded instead of non-threaded. The techno-babble: Up until now, eggdrop could not detect whether Tcl was 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 changed the way Tcl was compiled and distributed a while back, 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.
Contents |
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.
- Apply this patch to the 1.6.19 source.
- ./configure
- make config
- make
- make install
- enjoy!
Solution 2: Edit config.h
./configure your bot. 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. */ #define HAVE_TCL_THREADS 1
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.6
- cd into the directory it creates (tcl8.6-8.6.4 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 Ubuntu 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 Ubuntu 8.04 tcl8.6 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
- mkdir /root/tcl
- cd /root/tcl
- Get the latest 8.6 source from http://sourceforge.net/project/showfiles.php?group_id=10894
- tar zxf tcl8.6.4-src.tar.gz
- mv *.gz /usr/src/redhat/SOURCES
- cd tcl8.6.4
- cd unix
- mv tcl.spec tcl.spec.orig
- wget http://ns0.skralg.com/eggdrop/tcl8.5-nothreads/RHEL5/tcl.spec
- edit tcl.spec
- %define majorver 8.5
- (should be 8.5, that's from our source version, 8.6.4)
- Version: %{majorver}.4
- (.7 at the end, that's from our source version, 8.6.4)
- Release: 2
- (Not so important, if you really want to make it match the source, grab the release number from tcl.spec.orig. In this case, it's 2 anyway: 8.5.7-2)
- %define majorver 8.5
- cd ..
- rpmbuild -bb unix/tcl.spec
- cd /usr/src/redhat/RPMS/i386/
- rpm -Uvh tcl-8.6.4-*.i386.rpm tcl-devel-8.6.4-*.i386.rpm tcl-html-8.6.4-*.i386.rpm
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.
Archlinux
cp -r /var/abs/extra/tcl . cd tcl nano PKGBUILD (delete --enable-threads) makepkg pacman -U tcl-8.6.4-*-i686.pkg.tar.gz