Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 479416 - dev-java/ant-core-1.9.1 - /usr/bin/ant: Permission denied with jfs filesystem and FEATURES=xattr
Summary: dev-java/ant-core-1.9.1 - /usr/bin/ant: Permission denied with jfs filesystem...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 505532 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-01 15:06 UTC by Tomáš Mózes
Modified: 2014-10-20 09:01 UTC (History)
3 users (show)

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


Attachments
build21122.log (build21122.log,390.13 KB, text/x-log)
2013-08-08 09:18 UTC, Tomáš Mózes
Details
build21135.log (build21135.log,405.18 KB, text/x-log)
2013-08-08 09:18 UTC, Tomáš Mózes
Details
portage21122.log (portage21122.log,402.08 KB, text/x-log)
2013-08-08 09:19 UTC, Tomáš Mózes
Details
portage21135.log (portage21135.log,417.12 KB, text/x-log)
2013-08-08 09:19 UTC, Tomáš Mózes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2013-08-01 15:06:59 UTC
The ant script is installed as:

# ls -la /usr/bin/ant
-rw-r--r-- 1 root root 6290 Aug  1 17:04 /usr/bin/ant

So apps that rely on it will fail (for example junit, libreoffice with java enabled, etc.).
Comment 1 Tomáš Mózes 2013-08-01 15:10:55 UTC
An example of building xjavac:

>>> Emerging (1 of 37) dev-java/xjavac-20110814
 * xjavac-20110814.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                                                                                                                          [ ok ]
 * Using: sun-jdk-1.6
>>> Unpacking source...
>>> Unpacking xjavac-20110814.tar.gz to /var/tmp/portage/dev-java/xjavac-20110814/work
>>> Source unpacked in /var/tmp/portage/dev-java/xjavac-20110814/work
>>> Preparing source in /var/tmp/portage/dev-java/xjavac-20110814/work/xjavac-20110814 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-java/xjavac-20110814/work/xjavac-20110814 ...
Rewriting attributes
Rewriting ./build.xml
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-java/xjavac-20110814/work/xjavac-20110814 ...
 * Disabling all optional ANT_TASKS
/var/tmp/portage/dev-java/xjavac-20110814/temp/environment: line 553: /usr/bin/ant: Permission denied
 * ERROR: dev-java/xjavac-20110814::gentoo failed (compile phase):
 *   eant failed
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 4096:  Called eant 'jar' '-Dclasspath=/usr/share/ant-core/lib/ant.jar:/usr/share/ant-core/lib/ant-bootstrap.jar:/usr/share/ant-core/lib/ant-launcher.jar'
 *   environment, line  553:  Called die
 * The specific snippet of code:
 *       ant ${antflags} "${@}" || die "eant failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-java/xjavac-20110814::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-java/xjavac-20110814::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=sun-jdk-1.6  CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.6.0.45"
JAVACFLAGS="-source 1.4 -target 1.4" COMPILER="javac"
and of course, the output of emerge --info =xjavac-20110814
 * The complete build log is located at '/var/tmp/portage/dev-java/xjavac-20110814/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-java/xjavac-20110814/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-java/xjavac-20110814/work/xjavac-20110814'
 * S: '/var/tmp/portage/dev-java/xjavac-20110814/work/xjavac-20110814'


After running 'chmod +x /usr/bin/ant' it compiles fine.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-02 12:55:53 UTC
It runs dobin "${WORKDIR}/ant" quite nicely, so the problem isn't in the ebuild but on your system. What type of filesystem/options did you emerge ant-core on?
Comment 3 Tomáš Mózes 2013-08-02 13:17:14 UTC
Hello Jeroen, it's jfs with options rw,noatime.
Comment 4 Tomáš Mózes 2013-08-02 13:58:09 UTC
Portage 2.1.13.2 (default/linux/amd64/13.0/desktop, gcc-4.7.3, glibc-2.17, 3.10.4-gentoo x86_64)
=================================================================
System uname: Linux-3.10.4-gentoo-x86_64-Intel-R-_Core-TM-_i5-3570_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16333016 total,  14825960 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Thu, 01 Aug 2013 00:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r1, 3.2.5-r1, 3.3.2-r1
dev-util/cmake:           2.8.11.1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.12.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3, 4.7.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo x-hydra
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-mtune=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bindist branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk iconv jpeg lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support qt4 readline sdl session sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml 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" 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 author" 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" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="intel i128" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-04 13:19:48 UTC
I can't reproduce this and it is highly unlikely this was in any way caused by the build system.
Comment 6 Tomáš Mózes 2013-08-04 16:47:44 UTC
Thanks for trying out Jeroen. I've tried several times with the same result. I'll try with some other portage version. The strange thing is, that the other applications I use work just fine..
Comment 7 Tomáš Mózes 2013-08-05 06:10:58 UTC
I've just tried with the newest 2.1.13.5 and ended up with the same result (no executable flag). However, it works fine with 2.1.12.2.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-06 13:11:37 UTC
Please attach the entire build log to this bug report.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-06 21:32:17 UTC
(In reply to Tomas Mozes from comment #7)
> I've just tried with the newest 2.1.13.5 and ended up with the same result
> (no executable flag). However, it works fine with 2.1.12.2.

When attaching the build log, you would have to use `emerge --debug' to record what is actually happening.
Comment 10 Tomáš Mózes 2013-08-08 09:18:41 UTC
Created attachment 355384 [details]
build21122.log
Comment 11 Tomáš Mózes 2013-08-08 09:18:54 UTC
Created attachment 355386 [details]
build21135.log
Comment 12 Tomáš Mózes 2013-08-08 09:19:07 UTC
Created attachment 355388 [details]
portage21122.log
Comment 13 Tomáš Mózes 2013-08-08 09:19:18 UTC
Created attachment 355390 [details]
portage21135.log
Comment 14 Zac Medico gentoo-dev 2013-08-08 17:26:17 UTC
The `dobin /var/tmp/portage/dev-java/ant-core-1.9.1/work/ant` calls appear normal in the build logs.

You might try mounting a different filesystem on /var/tmp/portage, like tmpfs, to see if that makes any difference.
Comment 15 Tomáš Mózes 2013-08-09 14:20:21 UTC
Layout:
/ ext4
/var jfs
/usr jfs
/tmp jfs
/opt jfs
/home jfs

Portage version 2.1.12.2 produces a correct ant executable. Portage version 2.1.13.5 fails to do so. However, when mounting and ext4 under /var/tmp/portage, even the new version works fine.

Now my question is - how come the old version worked ok even on jfs? And next, what is the difference between using jfs/ext4 for compilation?

Thank you
Comment 16 Zac Medico gentoo-dev 2013-08-09 16:09:19 UTC
The difference in portage versions could be due to the new install wrapper located at /usr/lib/portage/bin/ebuild-helpers/xattr/install. You can test with FEATURES="-xattr" to avoid using the wrapper.
Comment 17 Tomáš Mózes 2013-08-14 09:52:22 UTC
Hello Zac, yes I can confirm that's the cause. With FEATURES="-xattr", even portage 2.2 works fine.

What can be done about this?
Comment 18 Zac Medico gentoo-dev 2013-08-14 10:19:17 UTC
Let's see what extended attributes the ant executable has when it's on jfs. You can use a command like this to see the extended attributes of a file as portage's install wrapper sees them:

  echo -n /usr/bin/ant | /usr/lib/portage/bin/xattr-helper.py --dump

You should run that command on the ant executable that has lost its executable bit.
Comment 19 Tomáš Mózes 2013-08-14 11:13:35 UTC
# ls -la /usr/bin/ant
-rw-r--r-- 1 root root 6290 Aug 14 13:09 /usr/bin/ant

#  echo -n /usr/bin/ant | /usr/lib/portage/bin/xattr-helper.py --dump
# file: /usr/bin/ant
system.posix_acl_access="\000\000\000\000\000ÿÿÿÿ\000\000ÿÿÿÿ \000\000ÿÿÿÿ"
Comment 20 Zac Medico gentoo-dev 2013-08-14 18:55:25 UTC
Now, we should test if adding and removing that system.posix_acl_access attribute affects the executable bit. Something like this would be a useful test:

  chmod a+x /usr/bin/ant
  echo -n /usr/bin/ant | 
    /usr/lib/portage/bin/xattr-helper.py --dump | \
    /usr/lib/portage/bin/xattr-helper.py --restore
  ls -l /usr/bin/ant
Comment 21 Tomáš Mózes 2013-08-15 05:55:12 UTC
# emerge -v1 ant-core
# ls -l /usr/bin/ant
-rw-r--r-- 1 root root 6290 Aug 15 07:53 /usr/bin/ant

# chmod a+x /usr/bin/ant

# ls -l /usr/bin/ant
-rwxr-xr-x 1 root root 6290 Aug 15 07:53 /usr/bin/ant

# echo -n /usr/bin/ant | 
    /usr/lib/portage/bin/xattr-helper.py --dump | \
    /usr/lib/portage/bin/xattr-helper.py --restore

# ls -l /usr/bin/ant
-rwxr-xr-x 1 root root 6290 Aug 15 07:53 /usr/bin/ant
Comment 22 Zac Medico gentoo-dev 2013-08-15 06:14:48 UTC
Do you still have jfs on /usr as noted in comment #15?

Maybe you can reproduce it if you remove the system.posix_acl_access attribute first, like this:

  chmod a+x /usr/bin/ant
  attributes=$(echo -n /usr/bin/ant | \
    /usr/lib/portage/bin/xattr-helper.py --dump)
  attr -r system.posix_acl_access /usr/bin/ant
  /usr/lib/portage/bin/xattr-helper.py --restore <<< "${attributes}"
  ls -l /usr/bin/ant
Comment 23 Tomáš Mózes 2013-08-15 08:58:10 UTC
# chmod a+x /usr/bin/ant

# attributes=$(echo -n /usr/bin/ant | \
>     /usr/lib/portage/bin/xattr-helper.py --dump)

# attr -r system.posix_acl_access /usr/bin/ant
attr_remove: No data available
Could not remove "system.posix_acl_access" for /usr/bin/ant

# /usr/lib/portage/bin/xattr-helper.py --restore <<< "${attributes}"

# ls -l /usr/bin/ant
-rwxr-xr-x 1 root root 6290 Aug 15 10:01 /usr/bin/ant
Comment 24 Zac Medico gentoo-dev 2013-08-15 18:10:42 UTC
(In reply to Tomas Mozes from comment #23)
> # attr -r system.posix_acl_access /usr/bin/ant
> attr_remove: No data available
> Could not remove "system.posix_acl_access" for /usr/bin/ant

I get the same message here because /usr/bin/ant has no extended attributes. Does yours still have extended attributes? Please check again like you did in comment #19.
Comment 25 Tomáš Mózes 2013-08-16 06:14:26 UTC
# emerge -1 ant-core

# chmod a+x /usr/bin/ant

# attributes=$(echo -n /usr/bin/ant | /usr/lib/portage/bin/xattr-helper.py --dump)

# attr -r system.posix_acl_access /usr/bin/ant
attr_remove: No data available
Could not remove "system.posix_acl_access" for /usr/bin/ant

# /usr/lib/portage/bin/xattr-helper.py --restore <<< "${attributes}"

# echo -n /usr/bin/ant | /usr/lib/portage/bin/xattr-helper.py --dump
# file: /usr/bin/ant
system.posix_acl_access="\000\000\000\000\000ÿÿÿÿ\000\000ÿÿÿÿ \000\000ÿÿÿÿ"
Comment 26 Pavel Goran 2013-10-24 10:43:25 UTC
I just run into this issue with portage 2.2.7, ant-core 1.9.2, jfs filesystem. xattr was enabled by default, explicitly disabling it solved the problem.
Comment 27 Tomáš Mózes 2014-03-25 12:10:49 UTC
Can anything be done on this? Or I should migrate to other filesystem / turn of xattr in FEATURES?
Comment 28 Tomáš Mózes 2014-10-08 11:38:51 UTC
Still valid issue for portage-2.2.8-r2.
Comment 29 Zac Medico gentoo-dev 2014-10-08 21:49:24 UTC
I can't reproduce this using sys-kernel/gentoo-sources-3.14.20 with the following jfs config options:

CONFIG_JFS_FS=m
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y

If you can reproduce this, then please post your kernel version, jfs config options, and any special mkfs.jfs or mount options that you may be using.
Comment 30 Francisco Blas Izquierdo Riera (RETIRED) gentoo-dev 2014-10-08 23:24:17 UTC
Output from /proc/mounts or particular mountpoints will also be helpful in debugging
Comment 31 Zac Medico gentoo-dev 2014-10-16 20:44:34 UTC
*** Bug 505532 has been marked as a duplicate of this bug. ***
Comment 32 Tomáš Mózes 2014-10-20 09:01:51 UTC
Sorry, seems like I didn't emerge ant-core, just portage when trying this, shame on me!

I've tried with portage 2.2.8-r2 (also 2.2.14_rc1) with xattr, works ok now, thank you.