Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 347223

Summary: dev-db/postgresql-server-{8.1.22,8.2.18,8.3.12} fail tests
Product: Gentoo Linux Reporter: Jeroen Roovers (RETIRED) <jer>
Component: [OLD] ServerAssignee: PgSQL Bugs <pgsql-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aballier, titanofold
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 339935    
Attachments: dev-db:postgresql-server-8.1.22:20101129-233344.log [hppa,fail]
dev-db:postgresql-server-8.2.18:20101129-235119.log [hppa,fail]

Description Jeroen Roovers (RETIRED) gentoo-dev 2010-11-29 23:57:10 UTC
Build logs to follow.


Portage 2.1.9.25 (default/linux/hppa/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.35-gentoo-r12-JeR parisc)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.35-gentoo-r12-JeR-parisc-PA8700_-PCX-W2-with-gentoo-2.0.1
Timestamp of tree: Mon, 29 Nov 2010 16:45:01 +0000
distcc 3.1 hppa2.0-unknown-linux-gnu [enabled]
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.5
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.4_p6-r1, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="hppa"
ACCEPT_LICENSE="* -@EULA"
CBUILD="hppa2.0-unknown-linux-gnu"
CFLAGS="-mschedule=8000 -march=2.0 -pipe -Wall -O2"
CHOST="hppa2.0-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind /var/spool/torque /var/www/localhost/htdocs/wordpress/wp-config.php"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.2/ext-active/ /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-mschedule=8000 -march=2.0 -pipe -Wall -O2"
DISTDIR="/aches/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg distcc distlocks fixlafiles fixpackages news notitles parallel-fetch protect-owned sandbox sfperms splitdebug strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv"
FFLAGS="-mschedule=8000 -march=2.0 -pipe -Wall -O2"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://mirror.netcologne.de/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.tiscali.nl/ "
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
LINGUAS="en nl he"
MAKEOPTS="-j6"
PKGDIR="/keeps/gentoo/packages/elmer"
PORTAGE_CONFIGROOT="/"
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="/dev/shm/"
PORTDIR="/keeps/gentoo/portage"
PORTDIR_OVERLAY="/keeps/gentoo/local"
SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"
USE="7zip X Xaw3d a52 aac aalib abyss accessibility acl ads agg alsa amr amrnb amrwb ao aoss apis ares artist-screen asf ass assistant async asyncns audiofile audit automount avfs bash-completion berkdb bidi bittorrent bittorrent-external bl bluetooth bzip2 c++ cairo caps captury catalogs cblas cdb cddb cdparanoia cdr chardet cjk clarens cleartype cli colors contrast cpath cracklib crypt cups curl custom-cflags custom-cxxflags cxx dbi dbtool dbus designer designer-plugin device-mapper dga dia dirac directfb djbfft djvu domainkeys dri drm dts dv dvd dvdr dvdread ebook edl elf emacs enca encode esd examples exceptions exif expat facebook facedetect fame fastbuild fastcgi fbcon ffmpeg filter fits flac fluidsynth fontconfig foomaticdb fortran fpx frei0r ftp fts3 gadu galago games gcrypt gd gdbm geant4 geoip ggi gif gimp gimpprint glep glib glut gmp gnokii gnutls gphoto2 gpm gps gs gsl gsm gtk gtk2 gtkhtml guidexml guile hal hepmc hesiod hotpixels hppa i18n ical icecast iconv icu idea idn imagemagick imlib indi inquisitio ipv6 isc ithreads jabber jack javascript jbig jingle jpeg jpeg2k judy kpathsea lapack lasi latex lcms ldap leim lensfun libass libcaca libffi libmms libotf libsamplerate libwww live logrotate logwatch lua lyrics-screen lzma lzo mad manhole matroska mbrola mem-scramble memcache metis mhash midi mikmod mmap mng modplug modules motif mozbranding mp3 mpi mplayer mssql mudflap musepack musicbrainz mysql nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh nas ncurses netpbm network-cron nfconntrack nfs nls nntp nova nptl nptlonly nsplugin ntlm offensive ogg openal openexr opengl openmp openssl optimization oss ots overlays pam pango pbs pch pcre pdf pdo-external perl php plasma plotutils plugins png policykit portage portaudio postgres povray ppds pppd pulseaudio python pyzord qalculate qdbm qt3support qt4 quotas raw readline recode rle romio rpc rrdtool rtc rtmp ruby ruby18 samba sasl scale0tilt scanner scim sdl seamonkey secure-delete server session sid slang slp smi sms sndfile snmp soap song-screen soundex speex spell spoof-source sqlite srt srtp ssh ssl startup-notification strong-optimization subtitles subversion suhosin supernodal svg swat sysfs syslog system-sqlite talkfilters tcl tcpd test tftp tga theora threads thumbnail thunar thunar-vfs tidy tiff timezone timidity tk tokyocabinet tools truetype tslib tunepimp twolame udev unicode unzip urandom usb userlocales utempter utf v4l v4l2 vanim vcd vidix vim-syntax vorbis watchdog wavpack webdav webinstall wildmidi winbind wlan wma wmf xanim xattr xcb xchattext xcomposite xface xlisten xml xml2 xmp xmpi xorg xpm xrandr xscreensaver xsettings xulrunner xv xvid xvmc zip zip-external zlib" ALSA_CARDS="ad1889 usb-audio" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_ftp proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias asis authn_alias cern_meta charset_lite dumpio log_forensic substitute version" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev joystick keyboard mouse acecad aiptek calcomp citron digitaledge dmc dynapro elo2300 elographics fpit hyperpen jamstudio magellan microtouch mutouch palmax penmount spaceorb summa tek4957 tslib ur98 wacom void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en nl he" PHP_TARGETS="php5-2 php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="stifb fbdev none dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-db/postgresql-server-8.1.22 was built with the following:
USE="nls perl python tcl test xml -doc (-selinux)" LINGUAS="-af -cs -de -es -fa -fr -hr -hu -it -ko -nb -pl -pt_BR -ro -ru -sk -sl -sv -tr -zh_CN -zh_TW"
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-30 00:00:55 UTC
Created attachment 255883 [details]
dev-db:postgresql-server-8.1.22:20101129-233344.log [hppa,fail]

make[3]: `refint.so' is up to date.
make[3]: `autoinc.so' is up to date.
make[3]: Leaving directory `/dev/shm/portage/dev-db/postgresql-server-8.1.22/work/postgresql-8.1.22/contrib/spi'
rm -rf ./testtablespace
mkdir ./testtablespace
clientbindir="/usr/lib/postgresql-8.1/bin/" /bin/sh ./pg_regress --temp-install --top-builddir=../../.. --temp-port=55432 --schedule=./parallel_schedule --multibyte=SQL_ASCII --load-language=plpgsql  
============== creating temporary installation        ==============
============== initializing database system           ==============
============== starting postmaster                    ==============

pg_regress: postmaster did not start
Examine ./log/postmaster.log for the reason.

./pg_regress: line 266: kill: (31932) - No such process
make[2]: *** [check] Error 2
make[2]: Leaving directory `/dev/shm/portage/dev-db/postgresql-server-8.1.22/work/postgresql-8.1.22/src/test/regress'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/dev/shm/portage/dev-db/postgresql-server-8.1.22/work/postgresql-8.1.22/src/test'
make: *** [check] Error 2
emake failed
 * ERROR: dev-db/postgresql-server-8.1.22 failed:
 *   Make check failed. See above for details.
 * 
 * Call stack:
 *     ebuild.sh, line  56:  Called src_test
 *   environment, line 3335:  Called die
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-30 00:10:05 UTC
Created attachment 255885 [details]
dev-db:postgresql-server-8.2.18:20101129-235119.log [hppa,fail]

make[3]: `refint.so' is up to date.
make[3]: `autoinc.so' is up to date.
make[3]: Leaving directory `/dev/shm/portage/dev-db/postgresql-server-8.2.18/work/postg
resql-8.2.18/contrib/spi'
rm -rf ./testtablespace
mkdir ./testtablespace
./pg_regress --temp-install=./tmp_check --top-builddir=../../.. --temp-port=55432 --sch
edule=./parallel_schedule --multibyte=SQL_ASCII --load-language=plpgsql   --psqldir=/us
r/lib/postgresql-8.2/bin/
============== creating temporary installation        ==============
============== initializing database system           ==============
============== starting postmaster                    ==============

pg_regress: postmaster did not respond within 60 seconds
Examine ./log/postmaster.log for the reason
make[2]: *** [check] Error 2
make[2]: Leaving directory `/dev/shm/portage/dev-db/postgresql-server-8.2.18/work/postg
resql-8.2.18/src/test/regress'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/dev/shm/portage/dev-db/postgresql-server-8.2.18/work/postg
resql-8.2.18/src/test'
make: *** [check] Error 2
emake failed
 * ERROR: dev-db/postgresql-server-8.2.18 failed:
 *   Make check failed. See above for details.
 * 
 * Call stack:
 *     ebuild.sh, line  56:  Called src_test
 *   environment, line 3336:  Called die


elmer ~ # cat postmaster.log 
FATAL:  could not open lock file "/var/run/postgresql/.s.PGSQL.55432.lock": Permission denied
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-30 16:50:44 UTC
(In reply to comment #2)
> elmer ~ # cat postmaster.log 
> FATAL:  could not open lock file "/var/run/postgresql/.s.PGSQL.55432.lock":
> Permission denied

Same for 8.3.12.

8.4.5 has tests restricted.
Comment 4 Aaron W. Swenson gentoo-dev 2010-12-03 14:09:26 UTC
Hmm, I thought the ebuild changed the location of the socket to someplace it could actually create the socket. I'm pretty sure that will fix this problem.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2010-12-09 19:56:51 UTC
Please advise. A security bug depends on this one.
Comment 6 Aaron W. Swenson gentoo-dev 2010-12-10 12:09:00 UTC
It'll be a while before I can take a look at it and propose a patch. I'm currently without Internet on my workstation.
Comment 7 Aaron W. Swenson gentoo-dev 2010-12-10 12:29:45 UTC
What do the postmaster.log's have to say?
Comment 8 Aaron W. Swenson gentoo-dev 2010-12-10 13:26:00 UTC
Okay, I think I know what the issue really is here.

/var/run/postgresql/ isn't created until after the package is installed.

The existence of /var/run/postgresql/ is mandatory given that the patches set that as the default socket location. So, the test will fail the first time the package is installed, but should succeed on subsequent emerges. This would explain why I haven't seen the tests fail when I gave it a go on my system and is the most likely reason as to why RESTRICT="test" is in 8.4.

I'll have to dig into the source code/makefiles/whatever of the tests to see if it's even possible to change the location for just the test as it doesn't look like I can define that on the call line in src_test.

Really, there are two options here: Test before install or test after install. The check can be done in pkg_postinst rather than src_test.
Comment 9 Aaron W. Swenson gentoo-dev 2010-12-10 13:29:56 UTC
P.S.: Bug 232174 and this are one and the same.
Comment 10 Tobias Klausmann (RETIRED) gentoo-dev 2010-12-20 15:55:40 UTC
Even if you add /var/run/postgresql/ with a+rwx, it still fails probably due to sandbox. Since you can't run the test suite as root, I used a normal unprivileged account, which also fails, but some more digging tells me that the testing process is looking for libpq.a, which doesn't exist at that point (and is a byproduct, so there is no way for make to figure it out). If you compile it by hand, the test suite still won't run under the auspices of Ebuild/Sandbox, since it still can't write to the aforementioned directory. Running without sandbox gives this error:

============== creating database "regression"         ==============
./pg_regress: line 543: /usr/lib/postgresql-/bin//createdb: No such file or directory
pg_regress: createdb failed
make: *** [check] Error 2

At which point I give up until I find some more time - I've already wasted an afternoon at work on this.
Comment 11 Patrick Lauer gentoo-dev 2011-01-06 11:52:42 UTC
*** Bug 232174 has been marked as a duplicate of this bug. ***
Comment 12 Aaron W. Swenson gentoo-dev 2011-01-08 13:39:06 UTC
(In reply to comment #10)
> Even if you add /var/run/postgresql/ with a+rwx, it still fails probably due to
> sandbox. Since you can't run the test suite as root, I used a normal
> unprivileged account, which also fails, but some more digging tells me that the
> testing process is looking for libpq.a, which doesn't exist at that point (and
> is a byproduct, so there is no way for make to figure it out). If you compile
> it by hand, the test suite still won't run under the auspices of
> Ebuild/Sandbox, since it still can't write to the aforementioned directory.
> Running without sandbox gives this error:
> 
> ============== creating database "regression"         ==============
> ./pg_regress: line 543: /usr/lib/postgresql-/bin//createdb: No such file or
> directory
> pg_regress: createdb failed
> make: *** [check] Error 2
> 
> At which point I give up until I find some more time - I've already wasted an
> afternoon at work on this.
> 

My concern here is that "/usr/lib/postgresql-/bin//createdb" should read "/usr/lib/postgresql-9.0/bin/createdb". Something is off there.
Comment 13 Aaron W. Swenson gentoo-dev 2011-01-16 18:21:16 UTC
'libpq.a' should be generated by dev-db/postgresql-base.

I've gotten the tests to run using the following steps:
# chmod o+rwx /var/run/postgresql
# FEATURES="userpriv" ebuild postgresql-server-8.3.13-r1.ebuild test

That -r1 is in my local overlay, but nothing in it effects src_test().

I think I have found the changes I can make in the source code to move the location of the socket. Until then, that chmod will have to be done manually.
Comment 14 Aaron W. Swenson gentoo-dev 2011-01-18 14:47:20 UTC
I've created some patches for 8.{2,3,4} and 9.0. On my machine, the regression tests have all passed successfully. (I'll pass them along to Patrick so he can do his review on the patches.)

The patches avoid the need for /var/run/postgresql to exist or have its permissions relaxed. The lock file is created properly in ${S}, and forces the client/server communications through the localhost.

Changes have been made to the ebuilds as well so that the test only run if ${UID} -ne 0, otherwise they're skipped gracefully.


@Tobias: I actually did encounter that very issue with libpq.a being missing. I ran 'ebuild postgresql-server-8.2.19-r1.ebuild test'. I hadn't properly emerged =dev-db/postgresql-base-8.2.19. Once that had been done I didn't have any further issues.
Comment 15 Aaron W. Swenson gentoo-dev 2011-03-21 04:23:54 UTC
Fixed.

  21 Mar 2011; Aaron W. Swenson <titanofold@gentoo.org>
  +postgresql-server-8.2.20-r1.ebuild, +postgresql-server-8.3.14-r1.ebuild,
  +postgresql-server-8.4.7-r1.ebuild, +postgresql-server-9.0.3-r1.ebuild:
  Fixes bugs 274836, 302384, 323683, 325709, 347005, 347223, 353687 and
  353750.

All slots, including 8.4 and 9.0 successfully run and pass tests here.