Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 462602 - sys-cluster/openmpi-1.6.4 `mpicc` hangs inside of sandbox
Summary: sys-cluster/openmpi-1.6.4 `mpicc` hangs inside of sandbox
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
: 462990 465836 466982 467182 473294 (view as bug list)
Depends on:
Blocks: 465188
  Show dependency tree
 
Reported: 2013-03-21 16:39 UTC by Helmut Jarausch
Modified: 2013-07-02 12:43 UTC (History)
16 users (show)

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


Attachments
build log of sci-libs/scotch (build.log,89.78 KB, text/plain)
2013-03-21 20:25 UTC, Helmut Jarausch
Details
ebuild to emerge sci-libs/mumps (mumps-4.10.0-r2.ebuild,5.42 KB, text/plain)
2013-04-05 16:46 UTC, Helmut Jarausch
Details
standalone reproducer (standalone-repro.tgz,1.39 KB, application/octet-stream)
2013-05-11 20:05 UTC, Alexey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2013-03-21 16:39:32 UTC
after upgrading from openmpi-1.6.3 to 1.6.4
re-emerging sci-libs/scotch(6.0.0), e.g.,
mpicc compiles some files and then hangs - no CPU, no IO

downgrading to 1.6.3 again, solves the problem.
Both with gcc-4.7.2-r1

Thanks for looking into it,
Helmut.

emerge --info sys-cluster/openmpi
Portage 2.2.0_alpha166_p19 (default/linux/amd64/13.0/desktop, gcc-4.7.2, glibc-2.16.0, 3.9.0-rc3 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.9.0-rc3-x86_64-AMD_Phenom-tm-_II_X4_940_Processor-with-gentoo-2.2
KiB Mem:     7908152 total,     74600 free
KiB Swap:    1048572 total,    769076 free
Timestamp of tree: Thu, 21 Mar 2013 13:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
ccache version 3.1.9 [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.4_pre20130317::progress, 3.3.1_pre20130317::progress
dev-util/ccache:          3.1.9
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.6, 1.12.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.5.4, 4.6.3, 4.7.2-r1, 4.8.0_pre9999::local
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.8 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo local sunrise
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=native -O2 -msse3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /var/lib/hsqldb /var/lib/neatx/home"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/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="-mtune=native -O2 -msse3 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo "
LANG="en_US.iso88591"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/portage/layman/sunrise"
SYNC="rsync://rsync.informatik.RWTH-Aachen.de/gentoo-portage"
USE="3dnow 3dnowext 3dnowprefetch X a52 aac acl acpi alsa amd64 avahi berkdb branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam ffmpeg fftw firefox flac fortran fuse gdbm gfortran gif gimp gnome gpm gtk gtk3 iconv ipv6 jpeg kde lapack lcms libnotify mad mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf png policykit ppds qt qt3support qt4 readline sdl session smp spell sqlite sqlite3 sse sse2 sse3 sse4a ssl startup-notification svg tcl tcpd threads tiff tk truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xulrunner xv xvid zlib" ABI_X86="64" 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="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" 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" GRUB_PLATFORMS="pc multiboot" INPUT_DEVICES="keyboard mouse evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en de" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="ati radeon fglrx" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

sys-cluster/openmpi-1.6.4 was built with the following:
USE="cxx fortran ipv6 romio threads -heterogeneous -mpi-threads -vt" OPENMPI_FABRICS="-dapl -knem -ofed -open-mx -psm -sctp" OPENMPI_OFED_FEATURES="-connectx-xrc -control-hdr-padding -dynamic-sl -failover -rdmacm" OPENMPI_RM="-pbs -slurm"
Comment 1 Justin Bronder (RETIRED) gentoo-dev 2013-03-21 17:23:42 UTC
Can you please add the build log from sci-libs/scotch?
Comment 2 Helmut Jarausch 2013-03-21 20:25:36 UTC
Created attachment 342864 [details]
build log of sci-libs/scotch

This build had to be terminated by <ctrl> C since it hung forever.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-04-03 18:30:14 UTC
*** Bug 462990 has been marked as a duplicate of this bug. ***
Comment 4 Justin Bronder (RETIRED) gentoo-dev 2013-04-03 18:47:39 UTC
@sandbox, please see discussion in #462990.  This seems to only happen inside of the sandbox.
Comment 5 SpanKY gentoo-dev 2013-04-03 19:29:48 UTC
might be related to futexes.  at least, that's what mpicc is hanging on.
Comment 6 Justin Bronder (RETIRED) gentoo-dev 2013-04-04 19:07:28 UTC
Setting FAKEROOTKEY=1 allows mpi to function.  This basically tells openmpi not to override the malloc implementation early on via __malloc_initialize_hook.

From the source (./opal/mca/memory/linux/hooks.c:735)

    /* First, check for a FAKEROOT environment.  If we're in a
       fakeroot, then access() (and likely others) have been replaced
       and are not safe to call here in this pre-main environment.  So
       check for the environment markers that we're in a FAKEROOT.
       And if so, return immediately.

       Note that this check was inspired by a problem with Debian's
       "fakeroot" build environment that allocates memory during
       stat() (see http://bugs.debian.org/531522).  It may not be
       necessary any more since we're using access(), not stat().  But
       we'll leave the check, anyway. */
    if (getenv("FAKEROOTKEY") != NULL ||
        getenv("FAKED_MODE") != NULL) {
        return;
    }

@sandbox, I'm not sure how to proceed beyond this.  Is this a bug in sandbox or should we just be setting the environment variable?
Comment 7 Justin Bronder (RETIRED) gentoo-dev 2013-04-04 19:10:43 UTC
Note that the actual hang seems to happen in the next block of code:

    if (access("/dev/ummunotify", F_OK) == 0) {
        return;
    }
Comment 8 SpanKY gentoo-dev 2013-04-04 21:52:39 UTC
(In reply to comment #6)

to workaround the issue, i'd export that env var now

otherwise, this sounds a bit like bug 404013
Comment 9 Helmut Jarausch 2013-04-05 16:45:24 UTC
(In reply to comment #8)
> (In reply to comment #6)
> 
> to workaround the issue, i'd export that env var now
> 
> otherwise, this sounds a bit like bug 404013

Unfortunately, this doesn't help in call cases. While I could emerge openmpi,
emerging (a slight modification of) sci-libs/mumps (from the science overlay)
with the mpi use flag still hangs when compiling graph.c.

I have attached my slightly modified ebuild for anybody who like to reproduce the problem.
Comment 10 Helmut Jarausch 2013-04-05 16:46:34 UTC
Created attachment 344522 [details]
ebuild to emerge sci-libs/mumps
Comment 11 Justin Bronder (RETIRED) gentoo-dev 2013-04-05 18:12:51 UTC
(In reply to comment #10)
> Created attachment 344522 [details]
> ebuild to emerge sci-libs/mumps

It doesn't look like you're exporting FAKEROOTKEY anywhere here?

OpenMPI build fine without it, but the unit tests hang.
Comment 12 Helmut Jarausch 2013-04-06 07:40:52 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > Created attachment 344522 [details]
> > ebuild to emerge sci-libs/mumps
> 
> It doesn't look like you're exporting FAKEROOTKEY anywhere here?
> 
> OpenMPI build fine without it, but the unit tests hang.

cat  /etc/portage/env/sci-libs/mumps
FAKEROOTKEY=1
Comment 13 August Hörandl 2013-04-22 19:00:10 UTC
Just for the records: app-crypt/johntheripper hangs also during call to mpicc
Comment 14 Roman 2013-04-27 22:33:37 UTC
Probably because of this bug
emerge nvidia-cuda-sdk-5.0.35-r1
hangs at some point doing mpicxx of some source file.
The hang is revealed faster when MAKEOPTS="-j1".
emerges fine with 1.4.3 though.
Comment 15 Guy 2013-05-03 00:43:58 UTC
In addition to 'boost', I've had the same problem with:

=sci-libs/hdf5-1.8.10_p1
=sci-libs/fftw-3.3.3-r2
=app-crypt/johntheripper-1.7.9-r7

i.e. emerge hangs - no CPU, no IO - with 'openmpi-1.6.4'.

Combined with 'sci-libs/scotch' and 'sci-libs/mumps', that makes 6 packages. Toss in 'nvidia-cuda-sdk-5.0.35-r1' from another comment here and that makes 7.
Comment 16 Arfrever Frehtes Taifersar Arahesis 2013-05-03 03:52:50 UTC
All packages using sys-cluster/openmpi are affected. No need to specify their names in this bug.
Comment 17 David E. Narváez 2013-05-03 14:04:50 UTC
(In reply to comment #12)
> cat  /etc/portage/env/sci-libs/mumps
> FAKEROOTKEY=1

Have you used this feature before? I haven't so I may be wrong about this but I was having the same problem and apparently the way to have this is

# cat /etc/portage/env/dev-libs/boost 
export FAKEROOTKEY="1"

after that, I would have expected to see FAKEROOTKEY in /var/tmp/portage/dev-libs/boost-1.52.0-r6/temp/environment but I didn't, yet the ebuild is now merging OK.
Comment 18 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2013-05-06 06:57:00 UTC
*** Bug 466982 has been marked as a duplicate of this bug. ***
Comment 19 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2013-05-06 06:58:54 UTC
*** Bug 465836 has been marked as a duplicate of this bug. ***
Comment 20 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2013-05-09 07:49:34 UTC
*** Bug 467182 has been marked as a duplicate of this bug. ***
Comment 21 Alexey 2013-05-11 13:53:27 UTC
Bug is possibly related to https://bugs.gentoo.org/show_bug.cgi?id=464382
I see same strace as here https://bugs.gentoo.org/show_bug.cgi?id=464382#c10 while running this
$ sandbox strace mpicxx -m64 test.c -o test
# ... output skipped ...
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f25a8f58000
mprotect(0x7f25a52e4000, 32768, PROT_READ) = 0
mprotect(0x7f25a6622000, 4096, PROT_READ) = 0
mprotect(0x7f25a6837000, 4096, PROT_READ) = 0
mprotect(0x7f25a885b000, 4096, PROT_READ) = 0
mprotect(0x7f25a8295000, 4096, PROT_READ) = 0
mprotect(0x7f25a6b9c000, 69632, PROT_READ) = 0
mprotect(0x7f25a6dc5000, 4096, PROT_READ) = 0
mprotect(0x7f25a7124000, 32768, PROT_READ) = 0
mprotect(0x7f25a733a000, 4096, PROT_READ) = 0
mprotect(0x7f25a7545000, 4096, PROT_READ) = 0
mprotect(0x7f25a7772000, 4096, PROT_READ) = 0
mprotect(0x7f25a7c71000, 4096, PROT_READ) = 0
mprotect(0x7f25a7e87000, 4096, PROT_READ) = 0
mprotect(0x7f25a8091000, 4096, PROT_READ) = 0
mprotect(0x7f25a8b1e000, 16384, PROT_READ) = 0
mprotect(0x7f25a8d3b000, 4096, PROT_READ) = 0
mprotect(0x604000, 4096, PROT_READ)     = 0
mprotect(0x7f25a8f64000, 4096, PROT_READ) = 0
munmap(0x7f25a8861000, 222112)          = 0
set_tid_address(0x7f25a8f59a10)         = 12227
set_robust_list(0x7f25a8f59a20, 24)     = 0
futex(0x7fff189e1b6c, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fff189e1b6c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f25a8f59740) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7f25a864b6b0, [], SA_RESTORER|SA_SIGINFO, 0x7f25a8654c20}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f25a864b740, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f25a8654c20}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
stat("/proc/self/status", {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
futex(0x7f25a82960c8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f25a8d40360, FUTEX_WAIT_PRIVATE, 2, NULL
Comment 22 Alexey 2013-05-11 14:07:25 UTC
Just saw that there is bunch of similar bugs on the tracker. I'm sorry if previous comment was redundant. Maybe https://bugs.gentoo.org/show_bug.cgi?id=464382 should be marked as a duplicate of subj. since it is the most descriptive one?
Comment 23 Alexey 2013-05-11 20:05:09 UTC
Created attachment 348004 [details]
standalone reproducer

Standalone reproducer which does basically same thing in pre-main as mpicc, and fails in the same way under sandbox.

This is what happens:
1. All shared libraries get loaded
2. libdo-hook.so installs its __initialize_malloc_hook
3. All libaries constructors get called
4. libdo-open.so tries to open file
5. open syscall routed though libsandbox.so fopen_DEFAULT
6. which does some allocations through mmap
7. dlsym("mmap") does allocation through calloc and triggers hook
8.  __initialize_malloc_hook tries to access some file
9. open syscall routed though libsandbox.so access_DEFAULT
BUG!!! and gets double locked here

It is still unclear on which side (openmpi/sandbox) this behavior should be changed.
Comment 24 Andrew Savchenko gentoo-dev 2013-05-13 18:02:00 UTC
I have the same problem with any application in my system which uses mpicc in the compile stage. That's terrible.
Comment 25 Justin Bronder (RETIRED) gentoo-dev 2013-05-16 23:44:25 UTC
(In reply to comment #17)
> (In reply to comment #12)
> > cat  /etc/portage/env/sci-libs/mumps
> > FAKEROOTKEY=1
> 
> Have you used this feature before? I haven't so I may be wrong about this
> but I was having the same problem and apparently the way to have this is
> 
> # cat /etc/portage/env/dev-libs/boost 
> export FAKEROOTKEY="1"
> 
> after that, I would have expected to see FAKEROOTKEY in
> /var/tmp/portage/dev-libs/boost-1.52.0-r6/temp/environment but I didn't, yet
> the ebuild is now merging OK.

@Helmut Jarausch:  Did this change work for you?  We need to either start pushing this to ebuilds using mpi or mask this (and probably successive) versions of openmpi.
Comment 26 Andrew Savchenko gentoo-dev 2013-05-17 11:24:17 UTC
(In reply to comment #25)
> > # cat /etc/portage/env/dev-libs/boost 
> > export FAKEROOTKEY="1"
[...]
> @Helmut Jarausch:  Did this change work for you?  We need to either start
> pushing this to ebuilds using mpi or mask this (and probably successive)
> versions of openmpi.

I added FAKEROOTKEY=1 to /etc/portage/bashrc and this works fine for my MPI packages. Adding this to /etc/portage/make.conf doesn't work.
Comment 27 Helmut Jarausch 2013-05-26 09:00:30 UTC
(In reply to Andrew Savchenko from comment #26)
> (In reply to comment #25)
> > > # cat /etc/portage/env/dev-libs/boost 
> > > export FAKEROOTKEY="1"
> [...]
> > @Helmut Jarausch:  Did this change work for you?  We need to either start
> > pushing this to ebuilds using mpi or mask this (and probably successive)
> > versions of openmpi.
> 
> I added FAKEROOTKEY=1 to /etc/portage/bashrc and this works fine for my MPI
> packages. Adding this to /etc/portage/make.conf doesn't work.

Yes, adding it to /etc/portage/bashrc works here fine, as well.
Thanks,
Helmut
Comment 28 Justin Bronder (RETIRED) gentoo-dev 2013-06-13 23:47:59 UTC
sci-libs/scotch:

+  13 Jun 2013; Justin Bronder <jsbronder@gentoo.org> scotch-6.0.0.ebuild:
+  Don't let openmpi override malloc, works around sandbox issue in #462602
Comment 29 Manuel Rüger (RETIRED) gentoo-dev 2013-06-17 01:25:39 UTC
*** Bug 473294 has been marked as a duplicate of this bug. ***
Comment 30 Justin Bronder (RETIRED) gentoo-dev 2013-06-18 22:42:31 UTC
sci-libs/mumps (sci overlay):
commit 271427dc20189d9ab3e796f0953ad1a1f4ce6850 (HEAD, origin/master, origin/HEAD, master)
Author: Justin Bronder <jbronder@gentoo.org>
Date:   Mon Jun 17 19:20:17 2013 -0400

    Don't let openmpi override malloc, works around sandbox issue in #462602
    
    Package-Manager: portage-2.1.11.62

 sci-libs/mumps/ChangeLog              | 5 ++++-
 sci-libs/mumps/mumps-4.10.0-r2.ebuild | 5 ++++-


app-crypt/johntheripper:
+  18 Jun 2013; Justin Bronder <jsbronder@gentoo.org>
+  johntheripper-1.7.9-r1.ebuild, johntheripper-1.7.9-r2.ebuild,
+  johntheripper-1.7.9-r3.ebuild, johntheripper-1.7.9-r4.ebuild,
+  johntheripper-1.7.9-r5.ebuild, johntheripper-1.7.9-r6.ebuild,
+  johntheripper-1.7.9-r7.ebuild:
+  Workaround sandbox issue in #462602
Comment 31 Yuriy Dmitriev 2013-06-20 22:18:32 UTC
(In reply to David E. Narváez from comment #17)
> (In reply to comment #12)
> > cat  /etc/portage/env/sci-libs/mumps
> > FAKEROOTKEY=1
> 
> Have you used this feature before? I haven't so I may be wrong about this
> but I was having the same problem and apparently the way to have this is
> 
> # cat /etc/portage/env/dev-libs/boost 
> export FAKEROOTKEY="1"
> 
> after that, I would have expected to see FAKEROOTKEY in
> /var/tmp/portage/dev-libs/boost-1.52.0-r6/temp/environment but I didn't, yet
> the ebuild is now merging OK.

Thanks! It work for me:)

But BUG stil remain...
Comment 32 Justin Bronder (RETIRED) gentoo-dev 2013-07-02 02:05:32 UTC
@sandbox:  I'm using the environment variable SANDBOX_PID to detect if we're building from within sandbox.  If this is not reliable, please let me know.

+*openmpi-1.6.4-r1 (02 Jul 2013)
+
+  02 Jul 2013; Justin Bronder <jsbronder@gentoo.org> -openmpi-1.6.4.ebuild,
+  +openmpi-1.6.4-r1.ebuild,
+  +files/hooks-disable-malloc-override-inside-of-Gentoo-sandb.patch:
+  Do not override malloc when in a sandbox environment. Resolves #462602.
Comment 33 Jeff Squyres 2013-07-02 12:43:25 UTC
(In reply to Justin Bronder from comment #32)
> @sandbox:  I'm using the environment variable SANDBOX_PID to detect if we're
> building from within sandbox.  If this is not reliable, please let me know.
> 
> +*openmpi-1.6.4-r1 (02 Jul 2013)
> +
> +  02 Jul 2013; Justin Bronder <jsbronder@gentoo.org> -openmpi-1.6.4.ebuild,
> +  +openmpi-1.6.4-r1.ebuild,
> +  +files/hooks-disable-malloc-override-inside-of-Gentoo-sandb.patch:
> +  Do not override malloc when in a sandbox environment. Resolves #462602.

Just to follow up for the bug: Justin's patch was accepted upstream.

Open MPI 1.6.5 was just recently released, and may be the last release in the 1.6 series.  But if 1.6.6 is ever released, Justin's patch will be included in it.