'Error while loading server on port 2780: epoll: Function not implemented'

Asked by DjSlash

I compiled a fresh 2.8.0 instance (with `scons mode=release`), but got an error while trying to run: "SocketManager: Error while loading server on port 2780: epoll: Function not implemented". Not sure if I can disable epoll for adchpp and also not what the real issue might be. This is on a box with multiple ip's. The box is running Debian Wheezy (testing), currently running kernelversion 2.6.26-2-vserver-amd64.

djslash@sysyphus:~/adchpp_2.8.0_source/build/release-default/bin$ lsof -n -p 16913|grep lib
adchppd 16913 djslash mem REG 9,2 982461 15351895 /home/djslash/adchpp_2.8.0_source/build/release-default/bin/libalua.so
adchppd 16913 djslash mem REG 9,0 93936 323625 /usr/lib/libz.so.1.2.3.4
adchppd 16913 djslash mem REG 9,0 1845000 341747 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
adchppd 16913 djslash mem REG 9,0 1570832 371619 /lib/x86_64-linux-gnu/libc-2.13.so
adchppd 16913 djslash mem REG 9,0 89000 145339 /lib/x86_64-linux-gnu/libgcc_s.so.1
adchppd 16913 djslash mem REG 9,0 530736 377637 /lib/x86_64-linux-gnu/libm-2.13.so
adchppd 16913 djslash mem REG 9,2 8321791 15351893 /home/djslash/adchpp_2.8.0_source/build/release-default/bin/libadchpp.so
adchppd 16913 djslash mem REG 9,2 443176 15351892 /home/djslash/adchpp_2.8.0_source/build/release-default/bin/libaboost_date_time.so
adchppd 16913 djslash mem REG 9,2 74092 15351882 /home/djslash/adchpp_2.8.0_source/build/release-default/bin/libaboost_system.so
adchppd 16913 djslash mem REG 9,0 337024 343850 /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
adchppd 16913 djslash mem REG 9,0 131107 378687 /lib/x86_64-linux-gnu/libpthread-2.13.so
adchppd 16913 djslash mem REG 9,0 14768 378683 /lib/x86_64-linux-gnu/libdl-2.13.so
adchppd 16913 djslash mem REG 9,0 978968 338972 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
adchppd 16913 djslash mem REG 9,0 136936 378691 /lib/x86_64-linux-gnu/ld-2.13.so

What to do?

Question information

Language:
English Edit question
Status:
Solved
For:
ADCH++ Edit question
Assignee:
No assignee Edit question
Solved by:
DjSlash
Solved:
Last query:
Last reply:
Revision history for this message
poy (poy) said :
#1

a quick Google search shows many similar problems; there is a possible solution on <http://notes.benv.junerules.com/teamspeak-3-epoll-issue-fixed/>, involving LD_PRELOAD tricks...

Revision history for this message
DjSlash (djslash) said :
#2

Hmm, I should have mentioned that I had searched the web, but didnt consider this as a solution. For one, I don't have other libc6's laying around. And ideally I would find a solution that's something more permanent then just using LD_PRELOAD tricks.

That said, I have other software running on the same machine that *does* work with epoll, which are linked to the same libc6 as adchpp. So I started to investigate this somewhat further. From what I can read and understand, I don't have versions for libc6 nor my kernel* that shouldn't support the epoll functions. So I begin to wonder what epoll function adchpp is trying to use that is allegedly not implemented.

* sysyphus:~# grep -i epoll /boot/config-2.6.26-2-vserver-amd64
CONFIG_EPOLL=y

Revision history for this message
poy (poy) said :
#3

when you compile ADCH++, what does it say when checking for epoll? here:
"Checking for C header file sys/epoll.h... (cached) yes"

if you get a "no" there, try to open SConstruct and add the following after line 190:
 else:
  conf.env.Append(CPPDEFINES=['BOOST_ASIO_DISABLE_EPOLL'])

that seems to be a def used by asio to bypass its epoll checks.

Revision history for this message
DjSlash (djslash) said :
#4

It detects that epoll is available (sys/epoll.h exists*) on my system, so it should set 'HAVE_SYS_EPOLL_H' and wouldnt hit the 'else' you suggested. When I add conf.env.Append(CPPDEFINES=['BOOST_ASIO_DISABLE_EPOLL']) somewhere between the lines there, it disables epoll in asio all together. Which means it will use some other method (probably the old poll or select method?). With epoll disabled, the daemon starts and binds to the port without any hassle. Which is great ofcourse, but it doesnt solve my initial issue. ;) I'm still puzzled what function is being called that isn't implemented in my libs.

*from config.log:

scons: Configure: Checking for C header file sys/epoll.h...
build/debug-default/.sconf_temp/conftest_1.c <-
  |
  |#include "sys/epoll.h"
  |
  |
Compiling build/debug-default/.sconf_temp/conftest_1.o (static)
scons: Configure: yes

Revision history for this message
DjSlash (djslash) said :
#5

I've been digging around and discovered where it goes wrong. Apparantly is the kernel of this server too old, from what I read and understand. Some functionality with epoll is supposedly added in 2.6.27 and the machine is still running 2.6.26 (due to a other -nonrelated- compatibility issue). Meanwhile the code in boost's asio fails to fallback from epoll_create1 to epoll_create. Digging through it, I got to the same conclusion as the person who submitted this bugreport:

https://svn.boost.org/trac/boost/ticket/7012

I've applied his patch and tested it, which works fine. So that solved this problem for me.