app-misc/vlock-2.2.2-r1 fails compilation of 1 test program. The relevant message is: make[1]: Entering directory `/var/tmp/portage/app-misc/vlock-2.2.2-r1/work/vlock-2.2.2/tests' x86_64-pc-linux-gnu-gcc -march=k8 -O2 -pipe -fomit-frame-pointer -pedantic -std=gnu99 -I../src -c -o vlock-test.o vlock-test.c vlock-test.c:4:25: error: CUnit/CUnit.h: No such file or directory vlock-test.c:5:25: error: CUnit/Basic.h: No such file or directory In file included from vlock-test.c:7: test_list.h:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘list_tests’ In file included from vlock-test.c:8: test_tsort.h:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘tsort_tests’ In file included from vlock-test.c:9: test_util.h:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘util_tests’ In file included from vlock-test.c:10: test_process.h:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘process_tests’ vlock-test.c:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vlock_test_suites’ vlock-test.c:18: warning: ISO C does not allow extra ‘;’ outside of a function vlock-test.c: In function ‘main’: vlock-test.c:24: warning: implicit declaration of function ‘CU_initialize_registry’ vlock-test.c:24: error: ‘CUE_SUCCESS’ undeclared (first use in this function) vlock-test.c:24: error: (Each undeclared identifier is reported only once vlock-test.c:24: error: for each function it appears in.) vlock-test.c:29: warning: implicit declaration of function ‘CU_register_suites’ vlock-test.c:29: error: ‘vlock_test_suites’ undeclared (first use in this function) vlock-test.c:30: warning: implicit declaration of function ‘CU_get_error_msg’ vlock-test.c:35: warning: implicit declaration of function ‘strcmp’ vlock-test.c:36: warning: implicit declaration of function ‘CU_basic_set_mode’ vlock-test.c:36: error: ‘CU_BRM_VERBOSE’ undeclared (first use in this function) vlock-test.c:38: error: ‘CU_BRM_NORMAL’ undeclared (first use in this function) vlock-test.c:40: error: ‘CU_BRM_SILENT’ undeclared (first use in this function) vlock-test.c:43: warning: implicit declaration of function ‘CU_basic_run_tests’ vlock-test.c:48: warning: implicit declaration of function ‘CU_get_number_of_tests_failed’ vlock-test.c:51: warning: implicit declaration of function ‘CU_cleanup_registry’ make[1]: *** [vlock-test.o] Error 1 make[1]: Leaving directory `/var/tmp/portage/app-misc/vlock-2.2.2-r1/work/vlock-2.2.2/tests' make: *** [check] Error 2 * * ERROR: app-misc/vlock-2.2.2-r1 failed. * Call stack: * ebuild.sh, line 49: Called src_test * environment, line 2282: Called die * The specific snippet of code: * hasq test $FEATURES && die "Make check failed. See above for details."; * The die message: * Make check failed. See above for details. * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/log/portage/app-misc:vlock-2.2.2-r1:20081014-064545.log'. * The ebuild environment file is located at '/var/tmp/portage/app-misc/vlock-2.2.2-r1/temp/environment'. Complete build log and environment will be attached soon Reproducible: Always Steps to Reproduce: 1. emerge -1av vlock Actual Results: The failure above Expected Results: Testing the binaries and emerging the application # emerge --info Portage 2.1.4.5 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7 x86_64) ================================================================= System uname: 2.6.25-gentoo-r7 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ Timestamp of tree: Tue, 14 Oct 2008 05:30:01 +0000 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.4 [enabled] app-shells/bash: 3.2_p33 dev-java/java-config: 1.3.7, 2.1.6 dev-lang/python: 2.5.2-r7 dev-util/ccache: 2.4-r7 dev-util/cmake: 2.4.7-r1 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.3.0-r1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r2 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.23-r3 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache collision-protect distcc distlocks fixpackages metadata-transfer sandbox sfperms strict test unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://mirror.muntinternet.net/pub/gentoo/ ftp://mirror.ing.unibo.it/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://mirror.ing.unibo.it/gentoo/" LANG="it_IT.UTF-8" LC_ALL="it_IT.UTF-8" LDFLAGS="-Wl,-O1" LINGUAS="it" MAKEOPTS="-j14" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://pedroni03/gentoo-portage" USE="X Xaw3d a52 aac aalib acpi alsa amd64 ao arts audiofile avahi bash-completion berkdb bluetooth branding bzip2 cairo caps cddb cdparanoia cdr cli cracklib crypt cups curl dbus dga dio djvu dri dvd dvdr dvdread emboss encode exif expat fam fbcon ffmpeg fftw flac fontconfig foomaticdb fortran ftp gd gdbm geoip ggi gif gimp glut gmp gnutls gphoto2 gpm gtk guile hal htmlhandbook iconv idn ieee1394 imagemagick imlib isdnlog jack java javascript jbig jikes jpeg jpeg2k kde kdeenablefinal kdeprefix lcms libcaca libnotify libsamplerate lm_sensors lua lzo mad maildir matroska memlimit midi mikmod mime mmap mmx mng mozilla mp3 mpeg mpi mplayer mudflap multilib ncurses nls nptl nptlonly nsplugin offensive ogg openal openexr opengl openmp oss pam pch pcre pdf perl png portaudio posix ppds pppd python qt3 qt3support qt4 quicktime rdesktop readline recode reflection ruby samba sdl session sharedmem shorten sndfile sockets sox speex spell spl sse sse2 ssl startup-notification svg symlink sysfs syslog sysvipc tcl tcpd theora threads tidy tiff tk truetype unicode usb vcd vim-syntax vnc vorbis wmf wxwindows x264 xcb xcomposite xine xinerama xml xorg xosd xpm xscreensaver xulrunner xv xvid yahoo zeroconf zlib" ALSA_CARDS="intel8x0 virmidi" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="kodak ptp2" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" USERLAND="GNU" VIDEO_CARDS="radeon" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 168358 [details] Complete ebuild log Complete ebuild log for app-misc/vlock-2.2.2-r1
Created attachment 168360 [details] Complete environment Environment for the ebuild
I can confirm this bug. Some additional information: To run tests, cunit is required. I tried all versions available in portage and all work. Additionally, there are more problems: 1) With LDFLAGS="-Wl,-O1 -Wl,--as-needed", linking stage of vlock-test fails; 2) With LDFLAGS unset (LDFLAGS="-Wl,-O1"), vlock-test fails if run with FEATURES="userpriv" My suggestions: 1) Make the ebuild DEPEND on dev-util/cunit if tests are run. 2) Either RESTRICT userpriv or put a big fat warning at the end of the ebuild stating that tests will fail if not run as root. 3) Fix as-needed linking issue (I am not familiar with how to do that). For 1) and 2), I will attach a modified ebuild asap. BR, Dustin Fix as-needed linking issue
BTW, there is no stable dev-util/cunit in portage for amd64 yet. For completeness, my emerge --info: Portage 2.1.4.5 (default/linux/amd64/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo_dazuko-patch-r7-stable x86_64) ================================================================= System uname: 2.6.25-gentoo_dazuko-patch-r7-stable x86_64 Intel(R) Core(TM)2 Duo CPU T8100 @ 2.10GHz Timestamp of tree: Tue, 14 Oct 2008 07:16:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p33 dev-java/java-config: 1.3.7, 2.1.6 dev-lang/python: 2.5.2-r7 dev-util/ccache: 2.4-r7 dev-util/cmake: 2.4.6-r1 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r2 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.23-r3 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/bin/mygenkernel /usr/sbin/run-crons /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=nocona -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="ccache collision-protect distlocks fixpackages metadata-transfer multilib-strict parallel-fetch sandbox sfperms strict test unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://gentoo.inode.at/source/" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en de" MAKEOPTS="-j5" PKGDIR="/home/ftp/binpkg/" PORTAGE_COMPRESS="" PORTAGE_RSYNC_EXTRA_OPTS="--timeout=500" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/alon-barlev /usr/portage/local/layman/sunrise /usr/portage/local/layman/science /usr/portage/local/layman/synce /usr/portage/local/modified /usr/portage/local/own" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X Xaw3d a52 aac aalib accessibility acl acpi alsa amd64 amr amrnb amrr amrwb apm async audacious audiofile bash-completion berkdb bindist bl bluetooth branding bzip2 cairo cardbus cdinstall cjk cli cpudetection cracklib crypt css ctype cups dbus dga directfb divx dri dts dvd dvdr dvdread eds encode evo exif expat extensions fam fbcon fbcondecor fbsplash ffmpeg flac foomaticdb force-cgi-redirect fortran ftp gd gdbm gedit gif gimp glade glibc-omitfp glitz gmedia gmp gnutls gphoto2 gs gsm gtk gtkhtml guile hddtemp hdf5 iconv icq icu idn ieee1394 imagemagick imap imlib iproute2 isdnlog jack java javascript jikes jpeg jpeg2k kerberos keyscrub kpathsea laptop latex lcms ldap libcaca libnotify libwww live lm_sensors logrotate loop-aes lzo mad memlimit midi mikmod mime mmx mmxext mng motif mp2 mp3 mp4 mpeg mudflap multilib musepack ncurses nls nntp nowin nptl nptlonly nsplugin nvidia ogg opengl openmp opensslcrypto pam pch pcmcia pcre pda pdf perl plotutils png posix ppds pppd print python quicktime readline realmedia reflection rtsp ruby rubytests samba sasl sdl server session simplexml slang sndfile soap sockets sou speex spell spl sse sse2 ssl ssse3 stream suhosin svg swat sysfs syslog tcpd tetex tga theora threads tiff truetype unicode usb userlocales v4l v4l2 vcd vim-syntax vim-with-x vorbis wifi winbind wma wmf wmp wxwindows x264 xanim xine xinetd xml xorg xpm xsl xulrunner xv xvid xvmc zlib" ALSA_CARDS="hda-intel mpu401" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="fuji ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse ps2mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" USERLAND="GNU" VIDEO_CARDS="nvidia" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS_FLAGS
Created attachment 168396 [details, diff] Diff to fix cunit dependency and emit warning about root privileges needed to run tests
(In reply to comment #3) > I can confirm this bug. > Some additional information: > > To run tests, cunit is required. I tried all versions available in portage and > all work. Additionally, there are more problems: > > 1) With LDFLAGS="-Wl,-O1 -Wl,--as-needed", linking stage of vlock-test fails; Fix is just to pass -lcunit with LDLIBS instead with LDFLAGS. I'll attach a patch to the Makefile. > 2) With LDFLAGS unset (LDFLAGS="-Wl,-O1"), vlock-test fails if run with > FEATURES="userpriv" This is not true. The test 'test_wait_for_death' is kind of flaky. Sometimes it passes, sometimes not. IMO, this needs to be solved by upstream. For the meantime, I suggest to disable this particular test. I'll attach a patch to do. As well, I'll attach an updated patch to the ebuild as well BR, Dustin
Created attachment 168654 [details, diff] Updated ebuild diff
Created attachment 168656 [details, diff] Fix linking order for tests
Created attachment 168658 [details, diff] Exclude flaky 'test_wait_for_death'
Dustin thank you for your work. All commited to the tree in vlock-2.2.2-r2. I had to bump revision because of new dependency. But for rekeywording filled: bug 242546. BTW, I investigated test failure a bit more and I think I found reasons why it fails. Let's look at test function: void test_wait_for_death(void) { pid_t pid = fork(); if (pid == 0) { usleep(20000); execl("/bin/true", "/bin/true", NULL); _exit(1); } CU_ASSERT(!wait_for_death(pid, 0, 2000)); CU_ASSERT(wait_for_death(pid, 0, 20000)); } So test creates child which will sleep 20000 and then execute /bin/true and exit. I think time to wait for child death should be longer then 2000+20000. Child is a separate process so it could work longer then this time and sometimes this happens. I've suggested upstream to increase this time in 1000 times, but I'm not sure how reliable is that solution. On hard loaded system it could take somewhat longer time to create new process...