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

Bug 64439

Summary: net-misc/nx-x11-1.4.0-r2 fails to compile w/ premission denied on tmp file (different from previous bugs)
Product: Gentoo Linux Reporter: Mike Nerone <mike>
Component: Current packagesAssignee: Gentoo NX Server project <nx>
Status: RESOLVED FIXED    
Severity: normal CC: sgtphou, stian
Priority: High    
Version: 2004.2   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 63757, 76387    

Description Mike Nerone 2004-09-17 11:52:22 UTC
I have a feeling I'm missing something simple here, but I can't find it. In addition to the emerge info below, I also tried it with stripped FEATURES. On top of that, I tried suspending the compile after the temp file had been changed and making the perms on that file 777 and then continuing, but it still failed with the same error.

#################################################################
# emerge nx-x11
Calculating dependencies ...done!
>>> emerge (1 of 1) net-misc/nx-x11-1.4.0-r2 to /
>>> md5 src_uri ;-) nx-X11-1.4.0-3.tar.gz
>>> md5 src_uri ;-) nxagent-1.4.0-47.tar.gz
>>> md5 src_uri ;-) nxauth-1.4.0-1.tar.gz
>>> md5 src_uri ;-) nxcomp-1.4.0-23.tar.gz
>>> md5 src_uri ;-) nxcompext-1.4.0-3.tar.gz
>>> md5 src_uri ;-) nxviewer-1.4.0-2.tar.gz
>>> md5 src_uri ;-) nxdesktop-1.4.0-36.tar.gz
>>> md5 src_uri ;-) nxesd-1.4.0-1.tar.gz
>>> Unpacking source...
>>> Unpacking nx-X11-1.4.0-3.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
>>> Unpacking nxagent-1.4.0-47.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
>>> Unpacking nxauth-1.4.0-1.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
>>> Unpacking nxcomp-1.4.0-23.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
>>> Unpacking nxcompext-1.4.0-3.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
>>> Unpacking nxviewer-1.4.0-2.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
>>> Unpacking nxdesktop-1.4.0-36.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
>>> Unpacking nxesd-1.4.0-1.tar.gz to /var/tmp/portage/nx-x11-1.4.0-r2/work
 * Applying nx-x11-1.4.0.xprint.patch...                                                                                                               [ ok ]
>>> Source unpacked.

Building XFree86 version 4.3.0 (27 February 2003).

I hope you checked the configuration parameters in ./config/cf
to see if you need to pass BOOTSTRAPCFLAGS.

Fri Sep 17 13:34:48 CDT 2004

cd ./config/imake && make - --jobserver-fds=3,5 -j -f Makefile.ini BOOTSTRAPCFLAGS="" CC="gcc" clean
make[1]: Entering directory `/var/tmp/portage/nx-x11-1.4.0-r2/work/nx-X11/config/imake'
rm -f ccimake imake.o imake
rm -f *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a tags TAGS make.log \#*
rm -f -r Makefile.proto Makefile Makefile.dep bootstrap
rm -f imakemdep_cpp.h
make[1]: Leaving directory `/var/tmp/portage/nx-x11-1.4.0-r2/work/nx-X11/config/imake'
make - --jobserver-fds=3,5 -j Makefile.boot
make[1]: Entering directory `/var/tmp/portage/nx-x11-1.4.0-r2/work/nx-X11'
cd ./config/imake && make -w --jobserver-fds=3,5 - --jobserver-fds=3,5 -j -f Makefile.ini BOOTSTRAPCFLAGS="" CC="gcc"
make[2]: Entering directory `/var/tmp/portage/nx-x11-1.4.0-r2/work/nx-X11/config/imake'
making imake with BOOTSTRAPCFLAGS= and CROSSCOMPILEFLAGS=-DCROSSCOMPILEDIR="" in config/imake
gcc -o ccimake -DCROSSCOMPILEDIR=\"\"  -O -I../../include -I../../imports/x11/include/X11 ccimake.c
if [ -n "" ] ; then \
/cc -E `./ccimake` \
-DCROSSCOMPILE_CPP imakemdep.h > imakemdep_cpp.h; \
else touch imakemdep_cpp.h; fi
gcc -c  -O -I../../include -I../../imports/x11/include/X11 `./ccimake` imake.c
gcc -o imake  -O -I../../include -I../../imports/x11/include/X11 imake.o
make[2]: Leaving directory `/var/tmp/portage/nx-x11-1.4.0-r2/work/nx-X11/config/imake'
rm -f ./config/makedepend/Makefile.proto
./config/imake/imake -I./config/cf  -s ./config/makedepend/Makefile.proto -f ./config/makedepend/Imakefile -DTOPDIR=../.. -DCURDIR=./config/makedepend
sh: line 1: /tmp/imakeXGT5b4: Permission denied
make[1]: *** [config/makedepend/Makefile.proto] Aborted
make[1]: *** Deleting file `config/makedepend/Makefile.proto'
make[1]: Leaving directory `/var/tmp/portage/nx-x11-1.4.0-r2/work/nx-X11'
make: *** [World] Error 2

!!! ERROR: net-misc/nx-x11-1.4.0-r2 failed.
!!! Function src_compile, Line 47, Exitcode 2
!!! unable to build nx-11

#################################################################

# emerge info
Portage 2.0.50-r11 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.8-gentoo-r3)
=================================================================
System uname: 2.6.8-gentoo-r3 i686 Pentium III (Coppermine)
Gentoo Base System version 1.4.16
distcc[4646] (dcc_mkdir) ERROR: mkdir /var/tmp/portage/.distcc/state failed: No such file or directory [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer -fstack-protector"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer -fstack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache collision-protect digest distcc fixpackages sandbox userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://mirrors.tds.net/gentoo ftp://linux.thai.net/pub/mirrors/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa apache2 apm avi bidi bitmap-fonts crypt cups dga directfb divx4linux encode faad fbcon flash foomaticdb gd ggi gnome gtk gtk2 imagemagick imap imlib jpeg lcms libcaca libg++ libwww mad matroska mcal memlimit mikmod mmap mmx mmx2 motif mozilla mpeg mysql ncurses nls nntp oggvorbis opengl pam pdflib perl png postgres ppds python quicktime readline samba sasl sdl slang slp spell sse ssl svga tcltk threads tiff truetype unicode usb vhosts wxwindows x86 xml xml2 xmms xprint xv xvid zlib"
Comment 1 Stuart Herbert (RETIRED) gentoo-dev 2005-01-02 01:06:00 UTC
Please try nx-x11-1.4.0-r3.  It should appear on your local rsync mirror in about an hour.

Best regards,
Stu
Comment 2 Charles N. Burns 2005-01-24 20:46:11 UTC
Not resolved-
The problem appears to be that the build requires executing something from /tmp, but many systems have /tmp mounted noexec. This is a common best-practice and I believe Gentoo's own security guide recommends this.
The workaround is of course to remount /tmp exec. The build continues on its marry way. Hopefully there's an easy way to allow the build to continue without this workaround.

Emerge info:
------------------------------------------------------
Portage 2.0.51-r15 (default-linux/x86/2004.0, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.9 i686)
=================================================================
System uname: 2.6.9 i686 AMD Athlon(tm) XP 1800+
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.2.3-r5,dev-lang/python-2.3.4 [2.3.4 (#1, Oct 19 2004, 22:11:53)]
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.2.3-r5, 2.3.4
sys-devel/autoconf:  2.59-r5
sys-devel/automake:  1.8.5-r1
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.2-r7
virtual/os-headers:  2.4.19-r1, 2.4.21-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X apache2 apm arts avi berkdb bitmap-fonts cdr crypt cscope cups encode f77 fam flac font-server foomaticdb fortran gdbm gif gpm imlib innodb ipv6 java jpeg junit kde libg++ libwww mad mikmod mpeg mysql ncurses nls ogg oggvorbis opengl pam pdflib perl png python qt quicktime readline samba sdl slang spell ssl svga tcpd tiff truetype truetype-fonts type1-fonts xml2 xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LDFLAGS, PORTDIR_OVERLAY
-------------------------------------------------------
Comment 3 Stuart Herbert (RETIRED) gentoo-dev 2005-02-17 02:31:37 UTC
Re-opening the bug.
Comment 4 FieldySnuts 2005-06-10 09:50:10 UTC
I also see this issue. I have /tmp mounted noexec for the same reasons. If this
had been done in /var/tmp/portage or some such like other things that I have
seen, this wouldn't be an issue.

As far as I know, /tmp is for temp files, not executables.

Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110,
glibc-2.3.5-r0, 2.6.11.9-grsec-20050512 i686)
=================================================================
System uname: 2.6.11.9-grsec-20050512 i686 AMD Athlon(TM) XP 1800+
Gentoo Base System version 1.6.9
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.8
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.16-r1
sys-devel/libtool:   1.5.18
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache distlocks notitles sandbox sfperms
strict"
GENTOO_MIRRORS="ftp://gentoo.netnitco.net/pub/mirrors/gentoo/source/
http://gentoo.blueyonder.co.uk
ftp://mirror.iawnet.sandia.gov/pub/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 3dnow X aalib alsa apm avi berkdb bitmap-fonts cdr chroot crypt
curl dv dvd dvdr eds emboss encode fam flac foomaticdb fortran gdbm gif
gnome gpm gstreamer gtk gtk2 hal imagemagick imlib java jpeg kde ldap
libg++ libwww mad mikmod mmx motif mozilla mp3 mpeg ncurses nls ogg
oggvorbis opengl oss pam pdflib perl png pwdb python qt quicktime
readline samba sdl slang snmp spell sse ssl svga tcltk tcpd tiff
truetype truetype-fonts type1-fonts vorbis xine xml2 xmms xv zlib
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS,
PORTDIR_OVERLAY
Comment 5 Stian Skjelstad 2005-07-01 04:09:41 UTC
Couldn't this be solved by making a tmp directory inside the work dir and set
$TMP to point at it?

And if Makefile doesn't use $TMP, replace all /tmp entries with $TMP using sed.
Comment 6 Stuart Herbert (RETIRED) gentoo-dev 2006-11-04 17:36:56 UTC
Hi,

This has been fixed in the NX packages in the NX overlay.  These packages will be added to Portage once they have been tested.

Best regards,
Stu