BenV's notes

Teamspeak 3 / epoll issue fixed

by on Jan.25, 2010, under Software

After a few days of waiting on a reply on the forums I got tired of waiting. So my possible solutions: Either switch to a newer glibc (which probably comes down to upgrading to slackware 13, not in the mood for that) or move the teamspeak server to a new domU. Since it couldn’t possible *cough* be kernel related, I figured the problem had to be in glibc somewhere.
To remind you guys of the problem, check out this post: Teamspeak 3.
Or summarized: starting Teamspeak 3 server beta 16 on Slackware 11 (32 bit) fails with:

2010-01-22 15:16:12.282194|WARNING |VirtualServer | 1| --------------------------------------------------------
terminate called after throwing an instance of 'boost::exception_detail::clone_impl >'
what(): epoll: Function not implemented

So I wondered how to figure out the problem. Digging around in libc gave some insight:

$ strings /lib/ |grep -i epoll
warning: epoll_create is not implemented and will always fail
warning: epoll_ctl is not implemented and will always fail
warning: epoll_wait is not implemented and will always fail

Say what? Will always fail? That explains…. but why?!
Apparently there is another libc library that normally gets used that DOES have the proper epoll support, it is in /lib/tls . Weren’t it that the tls dir was renamed because Xen complained about it, so it doesn’t get used.

$ strings /lib/tls.disabled/ | grep epol

No warnings. However, a quick workaround to test this conclusion with LD_PRELOAD:

/home/teamspeak/teamspeak_server-b16# LD_PRELOAD="/lib/tls.disabled/ /lib/tls.disabled/" setuidgid teamspeak ./ts3server_linux_x86
TeamSpeak Server 3.0.0-beta16 [Build: 9929]
(c)TeamSpeak Systems GmbH

Logging started
2010-01-25 09:34:17.448370|INFO |ServerLibPriv | | Server Version: 3.0.0-beta16 [Build: 9929]
2010-01-25 09:34:17.448993|INFO |DatabaseQuery | | dbPlugin name: SQLite3 plugin, (c)TeamSpeak Systems GmbH
2010-01-25 09:34:17.449415|INFO |DatabaseQuery | | dbPlugin version: 3.6.21
2010-01-25 09:34:17.449913|INFO |DatabaseQuery | | checking database integrity
2010-01-25 09:34:17.605166|INFO |Accounting | | Licensing Information
2010-01-25 09:34:17.606004|INFO |Accounting | | type : Non-profit
2010-01-25 09:34:17.606884|INFO |Accounting | | starting date : Mon Jan 11 00:00:00 2010
2010-01-25 09:34:17.607657|INFO |Accounting | | ending date : Tue Jan 11 00:00:00 2011
2010-01-25 09:34:17.608393|INFO |Accounting | | max virtualservers: 10
2010-01-25 09:34:17.608856|INFO |Accounting | | max slots : 512
2010-01-25 09:34:17.639110|ERROR |FileManager | | bind() failed: 98
2010-01-25 09:34:17.639691|ERROR |FileManager | | bind failed on
2010-01-25 09:34:17.690035|ERROR |VirtualServer | 1| bind failed on
2010-01-25 09:34:17.690658|ERROR |VirtualSvrMgr | | loading VirtualServer(1) failed to start, error: unable to bind network port
2010-01-25 09:34:17.764504|INFO |VirtualServer | 1| stopped
2010-01-25 09:34:17.765957|ERROR |Query | | unable to bind error: 98:Address already in use
2010-01-25 09:34:17.766585|ERROR |Query | | bind failed on
2010-01-25 09:34:17.864334|INFO |Query | | whitelist ips:,

Ha, that’s more like it. Yeah, it fails to start because I still have the beta 12 running in another dir, but it doesn’t give the error anymore.

Googling a bit to find some details on Slackware 11 and glibc gave me a discussion somewhere on a mailinglist that mentioned that the glibc in /lib was compiled against
2.4 headers, while the /lib/tls version was compiled against 2.6 headers. That explains!
In other words, time to recompile glibc against the proper headers.
However, that task is a bit too cumbersome to post here. Long story short: it took me half the day to meddle with the glibc.Slackbuild script (and get the right kernel headers installed, etc) and I finally have a new glibc which works.

So, if you’re looking for a quick fix: use the LD_PRELOAD trick. For the more daring amongst you: upgrade your glibc — but beware that this is a DANGEROUS thing to do since it will break many things. Of course you could also upgrade to Slackware 13 and be done with it 😉

:, , ,

2 Comments for this entry

  • nosjp

    Nice trick.
    It’s working also beta17 with kernel 2.6.x (slackware 12).
    It doesn’t work with slackware 11 (kernel 2.4)
    “strings /lib/tls/ | grep epol” shows ok
    but using LD_PRELOAD=”/lib/tls/ /lib/tls/” ./ts3server_linux_x86
    doesn’t work. “ERROR: object ‘/lib/tls/’ from LD_PRELOAD cannot be preloaded: ignored.”

Leave a Reply

You must be logged in to post a comment.