EV module test failure in 04_stat.t

Zsbán Ambrus ambrus at math.bme.hu
Tue Nov 17 13:12:13 CET 2009


Dear libev list,

I'm getting a test failure when I'm trying to compile the perl EV-3.8 module.

The only failing tests are t/04_stat.t tests 6, 7, 9, and sometimes 8
(these are testing the prev method of stat events).  The backend 4
(EVBACKEND_EPOLL) is used.

This is an i686 linux system running debian etch, but a vanilla linux
2.6.31.5 kernel, vanilla perl "v5.10.1 (*) built for i686-linux", on a
single cpu machine emulated by sun virtualbox.

I'm installing from the EV-3.8 distribution downloaded from cpan with
default options.  These default options determined by Makefile.PL are
listed below.  I can't see what I'm doing wrong.

Enable optional support for CLOCK_MONOTONIC (y/n)? [y] y
Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)? [n] n
Enable select backend (y/n)? [y] y
Force use of system fd_set for select backend (y/n)? [n] n
Enable poll backend (y/n)? [y] y
Enable epoll backend (y/n)? [y] y
Enable kqueue backend (y/n)? [n] n
Enable event port backend (y/n)? [n] n
Extra libraries for pthread_atfork and clock_gettime? [-lpthread ] -lpthread
Enable inotify support (y/n)? [y] y
Enable linux eventfd support (y/n)? [n] n
Enable linux signalfd support (y/n)? [n] n

I've copied the full output of the compilation below in case you need it.

Thanks in advance,

Ambrus


[am]huygens ~/build/perl$ rm -rf EV-3.8
[am]huygens ~/build/perl$ tar xvf EV-3.8.tar.gz
EV-3.8/
EV-3.8/t/
EV-3.8/t/11_signal.t
EV-3.8/t/08_async.t
EV-3.8/t/06_loop_once.t
EV-3.8/t/03_keepalive.t
EV-3.8/t/04_stat.t
EV-3.8/t/09_brandon.t
EV-3.8/t/05_priority.t
EV-3.8/t/01_timer.t
EV-3.8/t/02_once.t
EV-3.8/t/07_loop_timer.t
EV-3.8/t/00_load.t
EV-3.8/libev/
EV-3.8/libev/ev_port.c
EV-3.8/libev/README
EV-3.8/libev/ev_select.c
EV-3.8/libev/ev_wrap.h
EV-3.8/libev/ev.h
EV-3.8/libev/ev_vars.h
EV-3.8/libev/LICENSE
EV-3.8/libev/Changes
EV-3.8/libev/ev_poll.c
EV-3.8/libev/ev_kqueue.c
EV-3.8/libev/ev_win32.c
EV-3.8/libev/ev_epoll.c
EV-3.8/libev/ev.c
EV-3.8/libev/ev.pod
EV-3.8/COPYING
EV-3.8/Changes
EV-3.8/MANIFEST
EV-3.8/typemap
EV-3.8/schmorp.h
EV-3.8/EV/
EV-3.8/EV/EVAPI.h
EV-3.8/EV/MakeMaker.pm
EV-3.8/EV.xs
EV-3.8/EV.pm
EV-3.8/README
EV-3.8/Makefile.PL
EV-3.8/META.yml
[am]huygens ~/build/perl$ cd EV-3.8
[am]huygens ~/build/perl/EV-3.8$ perl Makefile.PL

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


Welcome to EV configuration. If you are in a hurry, just press return here
and hope for the best. The defaults should usually do.

Skip further questions and use defaults (y/n)? [y] y

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


POSIX optionally offers support for a monotonic clock source. EV
can take advantage of this clock source to detect time jumps
reliably. Unfortunately, some systems are bound to be broken, so you can
disable this here: you can completely disable the detection and use of
the monotonic clock by answering 'n' here. Support for this clock type
will otherwise be autodetected at both compile- and runtime. (this setting
currently affects the use of nanosleep over select as well).

Enable optional support for CLOCK_MONOTONIC (y/n)? [y] y

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


POSIX optionally offers support for a (potentially) high-resolution
realtime clock interface. In a good implementation, using it is faster
than the normal method of using gettimeofday. Unfortunately, this option
is also bound to be broken on some systems, and current EV versions do not
actually call C<gettimeofday> very often, so ti defaults to no.

Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)? [n] n

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


EV can use various backends with various portability issue. The select
backend is the most portable and makes for a good fallback, but it can be
limited to a low number of file descriptors and/or might not compile. If
you have problems with compiling ev_select.c, you might try to play around
with disabling it here, or forcing it to use the fd_set provided by your
OS, via the next question. I highly recommend keeping it in.

Enable select backend (y/n)? [y] y

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


The select backend can operate in two modes. One uses the system-provided
fd_set and is usually limited to 1024 file descriptors (64 on windows),
the other requires your header files to define NFDBITS and declare a
suitable fd_mask type. If you run into problems compiling ev_select.c, you
can try forcing the use of the system fd_set here.

Force use of system fd_set for select backend (y/n)? [n] n

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


The second very portable backend is poll(2). It does not exist on windows
and various versions of Mac OS X (and on the other versions it simply
doesn't work), but works basically everywhere else. It is recommended to use
the default here unless you run into compile problems in ev_poll.c.

Enable poll backend (y/n)? [y] y

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


Select and poll make it hard to write efficient servers, especially if the
number of active connections is much lower than the watched ones. GNU/Linux
systems have a more scalable method called "epoll", which EV can use. For
this to work, both your kernel and glibc have to support epoll, but if you
can compile it, the detection will be done at runtime, and EV will safely
fall back to using select when epoll isn't available. If unsure, accept
the default.

Enable epoll backend (y/n)? [y] y

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


Similarly to the epoll backend above, EV can take advantage of kqueue on
many BSD systems. Support for kqueue will be detected at runtime, with a
safe fallback to other methods when it cannot be used.

Note that kqueue is broken on most operating systems, so by default it
won't be used on many platforms, but you can still create your own event
loop with kqueue backend if you ask specifically for it.

Here is what we know:

NetBSD:  partially working in at least 3.1. Yeah! :)
FreeBSD: broken on at least 6.2-STABLE,
         sockets *likely* work, ptys definitely don't.
OpenBSD: reports indicate that it likely doesn't work
         (similar problems as on FreeBSD).
OS X:    completely, utterly broken on at least < 10.5.

Enable kqueue backend (y/n)? [n] n

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


Similarly to the kqueue backend above, EV can take advantage of the
solaris 10 event port interface. Support for event ports will be detected
at runtime, with a safe fallback to other methods when it cannot be used.

Enable event port backend (y/n)? [n] n

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


EV needs the functions pthread_atfork and clock_gettime. On most systems
you need some special libraries for this (such as -lrt and -lpthread). You
can specify additional libraries to provide these calls (and any other
required by EV) now, or accept the default.

Extra libraries for pthread_atfork and clock_gettime? [-lpthread ] -lpthread

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


A backend of a different kind is the Linux inotify(7) interface, which can
be used to speed up (and reduce resource consumption) of stat watchers. If
you have the include file and libc support for it, it is usually a good
idea to enable it, as kernel availability is detected at runtime.

Enable inotify support (y/n)? [y] y

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


Another useful bit of functionality is the Linux eventfd, which is useful
for faster signal handling (don't care) and intra-thread communications
(more relevant). Kernel support for this will be probed at runtime, but
your libc must contain the necessary wrapper. Glibc 2.7 and later should
have this wrapper.

Enable linux eventfd support (y/n)? [n] n

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


Another sometimes useful bit of functionality is the Linux signalfd, which
is useful for faster signal handling (don't care). Kernel support for
this will be probed at runtime, but your libc must contain the necessary
wrapper and include files. Glibc 2.9 and later should have this wrapper.

Enable linux signalfd support (y/n)? [n] n

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***


Checking if your kit is complete...
Looks good
Writing Makefile for EV
[am]huygens ~/build/perl/EV-3.8$ make
cp EV/MakeMaker.pm blib/lib/EV/MakeMaker.pm
cp libev/ev.pod blib/lib/EV/libev.pod
cp EV/EVAPI.h blib/lib/EV/EVAPI.h
cp EV.pm blib/lib/EV.pm
cp libev/ev.h blib/lib/EV/ev.h
/usr/local/bin/perl /usr/local/lib/perl5/5.10.1/ExtUtils/xsubpp
-typemap /usr/local/lib/perl5/5.10.1/ExtUtils/typemap -typemap typemap
 EV.xs > EV.xsc && mv EV.xsc EV.c
cc -c  -Ilibev -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-DVERSION=\"3.8\" -DXS_VERSION=\"3.8\" -fPIC
"-I/usr/local/lib/perl5/5.10.1/i686-linux/CORE"  -DEV_USE_MONOTONIC=1
-DEV_USE_REALTIME=0 -DEV_USE_SELECT=1 -DEV_USE_POLL=1 -DEV_USE_EPOLL=1
-DEV_USE_KQUEUE=0 -DEV_USE_PORT=0 -DEV_USE_INOTIFY=1
-DEV_USE_EVENTFD=0 -DEV_USE_SIGNALFD=0 EV.c
Running Mkbootstrap for EV ()
chmod 644 EV.bs
rm -f blib/arch/auto/EV/EV.so
LD_RUN_PATH="/lib" cc  -shared -O2 -L/usr/local/lib -fstack-protector
EV.o  -o blib/arch/auto/EV/EV.so      \
           -lpthread    \

chmod 755 blib/arch/auto/EV/EV.so
cp EV.bs blib/arch/auto/EV/EV.bs
chmod 644 blib/arch/auto/EV/EV.bs
Manifying blib/man3/EV::MakeMaker.3
Manifying blib/man3/EV::libev.3
Manifying blib/man3/EV.3
[am]huygens ~/build/perl/EV-3.8$ make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_load.t ........ ok
t/01_timer.t ....... ok
t/02_once.t ........ ok
t/03_keepalive.t ... ok
t/04_stat.t ........ Failed 3/14 subtests
t/05_priority.t .... ok
t/06_loop_once.t ... ok
t/07_loop_timer.t .. ok
t/08_async.t ....... ok
t/09_brandon.t ..... ok
t/11_signal.t ...... ok

Test Summary Report
-------------------
t/04_stat.t      (Wstat: 0 Tests: 14 Failed: 3)
  Failed tests:  6-7, 9
Files=11, Tests=6875,  7 wallclock secs ( 0.93 usr  1.36 sys +  0.40
cusr  1.60 csys =  4.29 CPU)
Result: FAIL
Failed 1/11 test programs. 3/6875 subtests failed.
make: *** [test_dynamic] Error 255
2[am]huygens ~/build/perl/EV-3.8$ make test TEST_VERBOSE=1
TEST_FILES=t/04_stat.t
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(1, 'blib/lib', 'blib/arch')" t/04_stat.t
t/04_stat.t ..
1..14
ok 1
ok 2
ok 3
ok 4
ok 5
not ok 6
not ok 7
ok 8
not ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
Failed 3/14 subtests

Test Summary Report
-------------------
t/04_stat.t (Wstat: 0 Tests: 14 Failed: 3)
  Failed tests:  6-7, 9
Files=1, Tests=14,  0 wallclock secs ( 0.05 usr  0.07 sys +  0.06 cusr
 0.17 csys =  0.35 CPU)
Result: FAIL
Failed 1/1 test programs. 3/14 subtests failed.
make: *** [test_dynamic] Error 255
2[am]huygens ~/build/perl/EV-3.8$ perl -V
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

  Platform:
    osname=linux, osvers=2.6.31.5, archname=i686-linux
    uname='linux huygens 2.6.31.5 #4 wed oct 28 23:35:43 cet 2009 i686
gnulinux '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.3.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.7.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.7'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'


Characteristics of this binary (from libperl):
  Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
                        USE_LARGE_FILES USE_PERLIO
  Built under linux
  Compiled at Nov 17 2009 11:50:58
  @INC:
    /usr/local/lib/perl5/5.10.1/i686-linux
    /usr/local/lib/perl5/5.10.1
    /usr/local/lib/perl5/site_perl/5.10.1/i686-linux
    /usr/local/lib/perl5/site_perl/5.10.1
    .
[am]huygens ~/build/perl/EV-3.8$ uname -a
Linux huygens 2.6.31.5 #4 Wed Oct 28 23:35:43 CET 2009 i686 GNU/Linux
[am]huygens ~/build/perl/EV-3.8$



More information about the libev mailing list