Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 234762 - libpq-8.2.7 with USE="threads" fails with This platform is not thread-safe
Summary: libpq-8.2.7 with USE="threads" fails with This platform is not thread-safe
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High major with 1 vote (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-14 19:11 UTC by Jared Griffith
Modified: 2010-07-11 22:39 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/tmp/portage/dev-db/libpq-8.2.6/work/postgresql-8.2.6/config.log (libpq_config.log,294.96 KB, text/plain)
2008-08-14 19:13 UTC, Jared Griffith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Griffith 2008-08-14 19:11:57 UTC
When trying to emerge dev-db/libpq-8.2.7 or 8.2.6 when using threads use flag, the configure check errors out with the following:

checking thread safety of required library functions... no
configure: error: thread test program failed
This platform is not thread-safe.  Check the file 'config.log'for the
exact reason.

You can use the configure option --enable-thread-safety-force to force
threads to be enabled.  But you must then run the program in
src/test/thread and add locking function calls to your applications to
guarantee thread safety.

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/dev-db/libpq-8.2.7/work/postgresql-8.2.7/config.log
 *
 * ERROR: dev-db/libpq-8.2.7 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2414:  Called econf 'src_compile' 'src_compile' '--prefix=/usr' '--includedir=/usr/include/postgresql/libpq-4' '--sysconfdir=/etc/postgresql' '--mandir=/usr/share/man' '--host=x86_64-pc-linux-gnu' '--with-docdir=/usr/share/doc/libpq-8.2.7' '--libdir=/usr/lib64' '--enable-depend' '--without-krb5' '--enable-nls' '--with-pam' '--without-perl' '--disable-integer-datetimes' '--without-python' '--with-readline' '--with-openssl' '--without-tcl'
 *               ebuild.sh, line  513:  Called die
 * The specific snippet of code:
 *                      die "econf failed"
 *  The die message:
 *   econf failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/dev-db/libpq-8.2.7/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/libpq-8.2.7/temp/environment'.

Reproducible: Always




This only fails on x86_64 systems.  It will install on x86 systems without any problem.
I have tried both the 2008.0 system profile and a system with a 2007.0 profile, both similar systems, both failed with the same error.  The 2007.0 profiled system currently has libpq-8.2.6 with threads enabled, though the 2008.0 profiled machine will not install 8.2.x libpq.  The only difference between the two in regards to the 8.2.6 build is that gcc and glibc are built with multilib on the 2008.0 profiled machine.  I am also not able to install 8.2.6 on the server that already has it installed with threads.  It fails at the same point.

Here is output from emerge --info

Portage 2.1.4.4 (default/linux/amd64/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo-r9 x86_64)
=================================================================
System uname: 2.6.23-gentoo-r9 x86_64 Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
Timestamp of tree: Thu, 14 Aug 2008 08:30:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.4.4-r13, 2.5.2-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.1
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"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j8"
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/layman/voip /usr/local/portage/farheap /usr/local/portage/layman/voip"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dm acl amd64 apache2 apic async bash-completion berkdb bzip2 cli cracklib crypt dri fortran gdbm iconv ipmi ipv6 ldap ldap-sasl logrotate midi mmx mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python quotas readline reflection samba sasl server session snmp spl sqlite sse sse2 ssl swat symlink sysfs syslog tcpd threads unicode urandom vim vim-pager vim-syntax winbind zero-penalty-hit zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jared Griffith 2008-08-14 19:13:13 UTC
Created attachment 162919 [details]
/var/tmp/portage/dev-db/libpq-8.2.6/work/postgresql-8.2.6/config.log

Here is the config log.
Comment 2 Jared Griffith 2008-08-14 19:18:52 UTC
Sorry, incorrect emerge --info, here is the correct server emerge --info output


Portage 2.1.4.4 (default/linux/amd64/2008.0, 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 Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
Timestamp of tree: Thu, 14 Aug 2008 08:33:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.4.4-r13, 2.5.2-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.7.9-r1, 1.10.1
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 -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j20"
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/farheap"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dm acl alsa amd64 apache2 apic async bash-completion berkdb bzip2 cli cnamefix cracklib crypt ctype curl dri encode ffmpeg fortran gd gdbm gif iconv imlib ipmi ipv6 jbig jpeg ldap ldap-sasl logrotate mailwrapper midi mmx mp3 mpeg mudflap multilib multipleip mysql ncurses nls nptl nptlonly openmp pam pcre pdf perl php png posix postgres ppds pri python qos quotas readline reflection samba sasl server session spl sqlite sse sse2 ssl symlink sysfs syslog tcpd threads threadsafe tiff tokenizer truetype unicode urandom vim vim-pager vim-syntax vmdbmysql vmdbpostgres vorbis winbind xml xmlreader xmlwriter xsl zaptel zero-penalty-hit zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OP
Comment 3 Jared Griffith 2008-08-15 20:25:33 UTC
This appears to be an issue specifically with the ebuild.
I am able to build from source with the following configure options (which are in the config.log)
./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --prefix=/usr --includedir=/usr/include/postgresql/libpq-4 --sysconfdir=/etc/postgresql --mandir=/usr/share/man --host=x86_64-pc-linux-gnu --with-docdir=/usr/share/doc/libpq-8.2.7 --libdir=/usr/lib64 --enable-depend --without-krb5 --enable-nls --with-pam --without-perl --disable-integer-datetimes --without-python --with-readline --with-openssl --without-tcl --enable-thread-safety --with-zlib --build=x86_64-pc-linux-gnu

make and make install work perfectly.
Comment 4 Guenther Brunthaler 2008-08-23 22:49:20 UTC
Same problem with version 8.3.1 on amd64.

I have tracked the problem down: It is a problem with the 64 bit version of the sandbox, not with libpq or the ebuild itself.

The library emerges fine when the sandbox is disabled, i. e. if PostgreSQL is emerged like that:

$ FEATURES="-usersandbox -sandbox" emerge -av1 libpq 
$ emerge -av postgresql
Comment 5 Guenther Brunthaler 2008-08-23 22:58:34 UTC
I have also run the failing configure test application (which segfaults) in the debugger, and tracked down the origin of the failure within the unlink() implementation of the sandbox.

As this normally works in the sandbox and the configure test application invokes the unlink library function in a heavy multithreading test scenario, I conclude the sandbox must have a flaw and is not completely thread safe; at least for amd64.

I am going to open a separate bug for that, because it is clearly a sandbox issue and not a libpq issue by itself.
Comment 6 Guenther Brunthaler 2008-08-23 23:53:18 UTC
Just for your reference: I have created bug

http://bugs.gentoo.org/show_bug.cgi?id=235581

for the sandbox problem.
Comment 7 m3q 2008-10-10 13:48:21 UTC
libpq-8.0.15 was also breaking on my machine (Athlon X2, unsafe cflags) with sandbox-1.2.18.1-r2, after unmasking (keyword ~*) and installing sandbox-1.2.18.1-r3 it compiled fine.
Comment 8 Matthew Gregory Sr. 2008-10-23 21:41:28 UTC
bug confirmed on x86:

ns2 ~ # emerge --info              
WARNING: repository at /usr/local/portage is missing a repo_name entry
Portage 2.2_rc12 (hardened/x86/2.6, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r8 i686)
=================================================================
System uname: Linux-2.6.25-gentoo-r8-i686-Intel-R-_Core-TM-2_Duo_CPU_E7200_@_2.53GHz-with-glibc2.0
Timestamp of tree: Wed, 22 Oct 2008 02:05:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r14, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.7.9-r1, 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="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -Os -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=pentium4 -Os -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg ccache distcc distlocks notitles parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo ftp://gentoo.mirrors.tds.net/gentoo http://gentoo.mirrors.easynews.com/linux/gentoo/ "
LDFLAGS=""
LINGUAS="en en_US"
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://rsync.gentoo.org/gentoo-portage"
USE="aalib acl apache2 bash-completion bashlogger berkdb bzip2 caps cracklib crypt dlz dovecot-sasl extensions gdbm glibc-omitfp hardened idea idn ipv6 ithreads java jbig jpeg jpeg2k kerberos ldap libgcrypt libssh2 lzo md5sum midi mmx mysql ncurses network-cron nis nls nptl nptlonly nss overlays pam parse-clocks perl pic plugins png postgres python readline resolvconf samba sasl sdl socks5 sse2 ssl tcpd threads tiff unicode urandom vda vim-pager vim-syntax x86 xattr xmldoclet xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1       emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m      maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="cern_meta imagemap log_forensic proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http substitute version mime mime_magic mem_cache log_config status speling setenvif rewrite include headers filter file_cache ext_filter expires env disk_cache dir deflate dav_lock dav_fs dav cache autoindex authz_user authz_owner authz_host alias actions auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile info logio negotiation unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt      mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage      siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware        voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

I updated to r3 as mentioned above and it resolved my problem.
Comment 9 Bob Johnson 2008-12-17 08:53:36 UTC
(In reply to comment #8)
> bug confirmed on x86:
> 
> [snip]
>
> I updated to r3 as mentioned above and it resolved my problem.
> 

Unfortunately, keywording sandbox-r3 ~x86 didn't work in my case:

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

checking for DocBook stylesheets... no
checking for collateindex.pl... /usr/bin/collateindex.pl
checking for sgmlspl... sgmlspl
checking thread safety of required library functions... no
configure: error:
*** Thread test program failed.  Your platform is not thread-safe.
*** Check the file 'config.log'for the exact reason.
***
*** You can use the configure option --enable-thread-safety-force
*** to force threads to be enabled.  However, you must then run
*** the program in src/tools/thread and add locking function calls
*** to your applications to guarantee thread safety.

 *
 * ERROR: dev-db/libpq-8.0.15 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2427:  Called die
 * The specific snippet of code:
 *       ./configure --prefix=/usr --includedir=/usr/include/postgresql/libpq-${SLOT} --sysconfdir=/etc/postgresql --mandir=/usr/share/man --host=${CHOST} --with-docdir=/usr/share/doc/${PF} --libdir=/usr/$(get_libdir) --enable-depend $(use_with kerberos krb5) $(use_enable nls ) $(use_with pam) --without-perl $(use_enable pg-intdatetime integer-datetimes ) --without-python $(use_with readline) $(use_with ssl openssl) --without-tcl $(use_enable threads thread-safety ) $(use_with zlib) || die "configure failed";
 *  The die message:
 *   configure failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/home/bjohnson/portagelog/dev-db:libpq-8.0.15:20081217-083733.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/libpq-8.0.15/temp/environment'.
 *

 * Messages for package sys-apps/sandbox-1.2.18.1-r3:

 * Applying sandbox-1.2.18.1-open-normal-fail.patch ...
 * Applying sandbox-1.2.18.1-open-cloexec.patch ...
 * Applying sandbox-1.2.18.1-rtld-validation.patch ...
 * Configuring sandbox for ABI=default...
 * Building sandbox for ABI=default...
 * If configure fails with a 'cannot run C compiled programs' error, try this:
 * FEATURES=-sandbox emerge sandbox
 * Installing sandbox for ABI=default...

 * Messages for package dev-db/libpq-8.0.15:

 * Applying libpq-8.0.15-gentoo.patch ...
 * Using GNU config files from /usr/share/libtool
 *   Updating config/config.sub
 *   Updating config/config.guess
 *
 * ERROR: dev-db/libpq-8.0.15 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2427:  Called die
 * The specific snippet of code:
 *       ./configure --prefix=/usr --includedir=/usr/include/postgresql/libpq-${SLOT} --sysconfdir=/etc/postgresql --mandir=/usr/share/man --host=${CHOST} --with-docdir=/usr/share/doc/${PF} --libdir=/usr/$(get_libdir) --enable-depend $(use_with kerberos krb5) $(use_enable nls ) $(use_with pam) --without-perl $(use_enable pg-intdatetime integer-datetimes ) --without-python $(use_with readline) $(use_with ssl openssl) --without-tcl $(use_enable threads thread-safety ) $(use_with zlib) || die "configure failed";
 *  The die message:
 *   configure failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/home/bjohnson/portagelog/dev-db:libpq-8.0.15:20081217-083733.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/libpq-8.0.15/temp/environment'.
 *
 * GNU info directory index is up-to-date.
inara etc # emerge --info
Portage 2.1.4.5 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.26-gentoo-r4 i686)
=================================================================
System uname: 2.6.26-gentoo-r4 i686 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
Timestamp of tree: Tue, 16 Dec 2008 17:15:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7-r1, 2.1.6
dev-lang/python:     2.5.2-r7
dev-util/cmake:      2.4.6-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 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="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe"
CHOST="i686-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/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=prescott -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US"
MAKEOPTS="-j5"
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://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac acl alsa apache2 berkdb blas bzip2 cli cracklib crypt cups curl dbus doc dri dts dv dvd dvdr dvdread encode examples exif ffmpeg firefox flac fortran gd gdbm gif gimp graphviz gstreamer gtk guile hddtemp iconv ieee1394 imagemagick imlib ipv6 isdnlog jack jadetex java jbig joystick jpeg jpeg2k kde ladcca lcms lm_sensors mad mbox midi mikmod mmx mng motif mp3 mpeg mudflap ncurses nls nptl nptlonly nsplugin odbc ogg openal opengl openmp pam pcre pdf perl png posix povray ppds pppd python quicktime raw readline reflection rtc samba scanner sdl session sox spell spl srt sse ssl svg sysfs tcl tcpd theora threads tiff tk truetype unicode usb v4l v4l2 vcd vorbis win32codecs wmf x86 xanim xine xinerama xml xorg xpm xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" USERLAND="GNU" VIDEO_CARDS="vesa fbdev radeon intel vmware"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

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

but:

FEATURES=-sandbox emerge -1v libpq

compiles fine for me with either version of sandbox. On my older single-core Athlon XP system the libpq-8.0.15 thread error doesn't appear.
Comment 10 Sebastian Luther (few) 2009-04-27 11:59:49 UTC
Any news here? The bug is still present on amd64 (at least) with .

#emerge -pvq libpq
[ebuild   R   ] dev-db/libpq-8.0.15  USE="nls pam readline ssl threads* zlib -kerberos -pg-intdatetime"

#emerge --info
Portage 2.1.6.7 (default/linux/amd64/2008.0/desktop, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.28-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.28-gentoo-r5-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T5800_@_2.00GHz-with-glibc2.2.5
Timestamp of tree: Sun, 26 Apr 2009 17:15:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.7
dev-lang/python:     2.5.4-r2
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
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.27-r2
ABI="amd64"
ACCEPT_KEYWORDS="amd64"
ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci"
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"
ANT_HOME="/usr/share/ant"
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"
ARCH="amd64"
ASFLAGS_x86="--32"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CDEFINE_amd64="__x86_64__"
CDEFINE_x86="__i386__"
CFLAGS="-O2 -march=native -pipe"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLISION_IGNORE="/lib/modules"
COLORTERM="gnome-terminal"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /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 /etc/udev/rules.d"
CVS_RSH="ssh"
CXXFLAGS="-O2 -march=native -pipe"
DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-NnNhKQOsH2,guid=f95baf92f4843f0591c401d949f49ae7"
DEFAULT_ABI="amd64"
DESKTOP_SESSION="gnome"
DISPLAY=":0.0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/bin/nano"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--ask --verbose --tree --jobs 10 --keep-going"
EMERGE_WARNING_DELAY="10"
FEATURES="buildpkg distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
GCC_SPECS=""
GDK_USE_XFT="1"
GDMSESSION="gnome"
GDM_LANG="de_DE"
GDM_XSERVER_LOCATION="local"
GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://mirror.ovh.net/gentoo-distfiles/"
GNOME_DESKTOP_SESSION_ID="Default"
GNOME_KEYRING_SOCKET="/tmp/keyring-0mP8hV/socket"
GPG_AGENT_INFO="/tmp/seahorse-iqOwrm/S.gpg-agent:4504:1"
GTK_MODULES="gnomebreakpad"
GTK_RC_FILES="/etc/gtk/gtkrc:/home/mingramm/.gtkrc-1.2-gnome2"
HG="/usr/bin/hg"
HOME="/home/mingramm"
INFOPATH="/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.18/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/info"
INPUT_DEVICES="evdev synaptics"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KDEDIRS="/usr:/usr/local:/usr/kde/3.5"
KERNEL="linux"
LANG="de_DE"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LC_ALL="de_DE.utf8"
LDFLAGS=""
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe.sh %s"
LIBDIR_amd64="lib64"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LINGUAS="de"
LOGNAME="mingramm"
LS_COLORS="rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
MAKEOPTS="-j3"
MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.18/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man"
MULTILIB_ABIS="amd64 x86"
MULTILIB_STRICT_DENY="64-bit.*shared object"
MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage)"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
NOCOLOR="true"
OPENGL_PROFILE="nvidia"
ORBIT_SOCKETDIR="/tmp/orbit-mingramm"
PAGER="/usr/bin/less"
PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/alpha-unknown-linux-gnu/gcc-bin/4.3.3:/usr/x86_64-pc-linux-gnu/i686-mingw32/gcc-bin/4.3.3:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.2:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin:/home/mingramm/maple12/bin"
PKGDIR="/usr/portage/packages"
PKG_CONFIG_PATH="/usr/qt/3/lib64/pkgconfig"
PORTAGE_ARCHLIST="ppc s390 amd64 x86 ppc64 x86-fbsd m68k arm sparc sh mips ia64 alpha hppa amd64-fbsd sparc-fbsd"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_BIN_PATH="/usr/lib64/portage/bin"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_COUNTER_HASH="21ffdc4a7c3e8e5c9cb03b83648035e6"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="save_summary echo"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_PYM_PATH="/usr/lib64/portage/pym"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_RSYNC_RETRIES="3"
PORTAGE_TMPDIR="/var/tmp"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/gnome /usr/local/portage"
PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"
PWD="/home/mingramm"
QMAKESPEC="linux-g++"
QTDIR="/usr/qt/3"
RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
ROOT="/"
ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/alpha-unknown-linux-gnu/gcc-bin/4.3.3:/usr/x86_64-pc-linux-gnu/i686-mingw32/gcc-bin/4.3.3:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.2:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin"
RPMDIR="/usr/portage/rpm"
SESSION_MANAGER="local/fewslaptop:@/tmp/.ICE-unix/4129,unix/fewslaptop:/tmp/.ICE-unix/4129"
SHELL="/bin/bash"
SHLVL="1"
SSH_AGENT_PID="4148"
SSH_AUTH_SOCK="/tmp/keyring-0mP8hV/ssh"
STAGE1_USE="multilib nptl nptlonly unicode"
SYMLINK_LIB="yes"
SYNC="rsync://rsync7.de.gentoo.org/gentoo-portage"
TERM="xterm"
USE="X acl acpi alsa amd64 avahi bash-completion berkdb bluetooth branding bzip2 cairo cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread emboss encode evo fam firefox fortran gdbm gif gnome gpm gstreamer gtk hal iconv isdnlog jpeg ldap libnotify mad midi mikmod mmx mp3 mpeg mudflap multilib nautilus ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3support quicktime readline reflection sdl session spell spl sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd tiff truetype unicode usb vorbis xml xorg xulrunner xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
USER="mingramm"
USERLAND="GNU"
USERNAME="mingramm"
USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CAMERAS CROSSCOMPILE_OPTS DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES USERLAND VIDEO_CARDS"
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"
VIDEO_CARDS="nvidia nv"
WINDOWID="56737546"
WINDOWPATH="7"
XAUTHORITY="/home/mingramm/.Xauthority"
XDG_DATA_DIRS="/usr/share:/usr/kde/3.5/share:/usr/local/share"
_="/usr/bin/emerge"
Comment 11 Sebastian Luther (few) 2009-05-06 13:51:30 UTC
This is fixed with >=sys-apps/sandbox-1.7.
Comment 12 skolima 2009-06-23 09:34:09 UTC
Fixed for me on x86 by upgrading sandbox to 2.0
Comment 13 Aleksey Yeryomin 2009-08-03 20:25:28 UTC
(In reply to comment #12)
> Fixed for me on x86 by upgrading sandbox to 2.0
> 

Fixed for me too on amd64.
Comment 14 Guenther Brunthaler 2009-08-03 21:24:13 UTC
Hi ppl,

Those of you who managed to finally install 8.2 or 8.3 might be interested in the fact that PostgreSQL 8.4 is already available and worked fine at least for me!

See Bug 276125 for details.

Therefore, *this* issue is becoming slowly but surely rather outdated anyway...
Comment 15 Skye 2009-08-16 00:03:35 UTC
(In reply to comment #12)
> Fixed for me on x86 by upgrading sandbox to 2.0
> 

Upgrading the sandbox is a workaround, rather than an actual solution. There are other programs (like e2fsprogs, see bug #261411 ) that will not compile with the unstable sandbox installed.
Comment 16 José María Fernández González 2009-09-01 13:26:51 UTC
FYI, libpq-8.1.11, e2fsprogs-1.41.9 and e2fsprogs-libs-1.41.9 are working with sandbox-2.1 in x86_64
Comment 17 edoceo 2009-12-03 21:29:35 UTC
I had this issue to on CHOST="x86_64-pc-linux-gnu".  Threads would segfault and my config.log looks silimilar to these.  Dropping sandbox allowed build to proceed and upgrading sandbox worked as well (I did both) 

I this method works for me on  with sys-apps/sandbox-1.6-r2

root@host # FEATURES="-usersandbox -sandbox" emerge -pv dev-db/libpq
[ebuild   R   ] dev-db/libpq-8.2.14  USE="-kerberos nls pam pg-intdatetime readline ssl threads zlib" 0 kB

libpq compiled properly, with threads, and the apps I have that use it are functioning as expected (but they themselves are not multi-threaded)
---

Then I updated to sandbox-2.2
[ebuild     U ] sys-apps/sandbox-2.2 [1.6-r2] USE="(multilib%*)" 327 kB

Then rebuild dev-db/libpq & dev-db/postgresql, with sandbox enabled

root@host # emerge -pv dev-db/libpq dev-db/postgresql
[ebuild   R   ] dev-db/libpq-8.2.14  USE="-kerberos nls pam pg-intdatetime readline ssl threads zlib" 0 kB
[ebuild     U ] dev-db/postgresql-8.2.14 [8.2.7] USE="-doc -kerberos nls pam perl pg-intdatetime python readline (-selinux) ssl -tcl -test -xml zlib" 0 kB

Then I rebuild e2fsprogs cause some said that was fail and it did
root@host # emerge -pv e2fsprogs  e2fsprogs-libs
[ebuild   R   ] sys-libs/e2fsprogs-libs-1.41.3-r1  USE="nls" 479 kB
[ebuild   R   ] sys-fs/e2fsprogs-1.41.3-r1  USE="nls" 4,263 kB

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-8750.log"

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /etc/ld.so.cache~
A: /etc/ld.so.cache~
R: /etc/ld.so.cache~
C: /sbin/ldconfig 

F: open_wr
S: deny
P: /etc/ld.so.cache~
A: /etc/ld.so.cache~
R: /etc/ld.so.cache~
C: /sbin/ldconfig 

F: open_wr
S: deny
P: /etc/ld.so.cache~
A: /etc/ld.so.cache~
R: /etc/ld.so.cache~
C: /sbin/ldconfig 

F: open_wr
S: deny
P: /etc/ld.so.cache~
A: /etc/ld.so.cache~
R: /etc/ld.so.cache~
C: /sbin/ldconfig 
--------------------------------------------------------------------------------

>>> Failed to emerge sys-fs/e2fsprogs-1.41.3-r1, Log file:
>>>  '/var/tmp/portage/sys-fs/e2fsprogs-1.41.3-r1/temp/build.log'

So, I've put the build log on 
Comment 18 Markos Chandras (RETIRED) gentoo-dev 2009-12-20 16:51:35 UTC
I run into the same problem as well. Upgrading to sandbox-2.2 fixed my issue. As this bug affects stable packages as well, I propose to run for a stable sandbox-2.*. 
Comment 19 Patrick Lauer gentoo-dev 2010-07-11 22:39:08 UTC
Package gone