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
Aborted

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

$ strings /lib/libc.so.6 |grep -i epoll
epoll_wait
epoll_ctl
epoll_create
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/libc.so.6 | grep epol
epoll_wait
epoll_ctl
epoll_create
__GI_epoll_ctl
__GI_epoll_wait
__GI_epoll_create
epoll_wait
epoll_ctl
epoll_create

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

/home/teamspeak/teamspeak_server-b16# LD_PRELOAD="/lib/tls.disabled/libc.so.6 /lib/tls.disabled/libpthread-2.3.6.so" 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 0.0.0.0:30033
2010-01-25 09:34:17.690035|ERROR |VirtualServer | 1| bind failed on 0.0.0.0:9987
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 | | 0.0.0.0:10011 unable to bind error: 98:Address already in use
2010-01-25 09:34:17.766585|ERROR |Query | | bind failed on 0.0.0.0:10011
2010-01-25 09:34:17.864334|INFO |Query | | whitelist ips: 127.0.0.1,

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/libc.so.6 | grep epol” shows ok
    but using LD_PRELOAD=”/lib/tls/libc.so.6 /lib/tls/libpthread-2.3.6.so” ./ts3server_linux_x86
    doesn’t work. “ERROR: ld.so: object ‘/lib/tls/libc.so.6’ from LD_PRELOAD cannot be preloaded: ignored.”

Leave a Reply

You must be logged in to post a comment.

Archives

  • 2018 (1)
  • 2016 (1)
  • 2015 (7)
  • 2014 (4)
  • 2013 (11)
  • 2012 (27)
  • 2011 (26)
  • 2010 (25)
  • 2009 (68)