Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 217290 - sys-apps/coreutils-6.10 cp built with USE=xattr crashes on filesystems with xattr
Summary: sys-apps/coreutils-6.10 cp built with USE=xattr crashes on filesystems with x...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 236866 250882 259242 343075 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-11 12:59 UTC by Jimmy.Jazz
Modified: 2010-11-10 10:35 UTC (History)
6 users (show)

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


Attachments
openoffice 2.4.0 ebuild output (app-office:openoffice-2.4.0:20080330-154400.log,49.90 KB, text/plain)
2008-04-13 11:44 UTC, Jimmy.Jazz
Details
coreutils ebuild output (with xattr) (sys-apps:coreutils-6.10-r1:20080315-160315.log,175.91 KB, text/plain)
2008-04-13 11:46 UTC, Jimmy.Jazz
Details
fstab with user_xattr (fstab,3.26 KB, text/plain)
2008-04-13 11:50 UTC, Jimmy.Jazz
Details
coreutils-xattr.patch (coreutils-xattr.patch,9.33 KB, patch)
2008-04-20 10:17 UTC, SpanKY
Details | Diff
emerge --info (info.txt,4.36 KB, text/plain)
2008-09-24 14:13 UTC, Jimmy.Jazz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jimmy.Jazz 2008-04-11 12:59:53 UTC
If coreutils ebuild is compiled with xattr flag cp command will crash every time it is called from an openoffice ebuild.


Reproducible: Always

Steps to Reproduce:
1.add user_xattr for every fs in /etc/fstab
2.USE=xattr emerge -1 coreutils
3.emerge openoffice-4.3.0




Portage 2.1.5_rc2 (default-linux/amd64/2007.0, gcc-4.2.3, glibc-2.7-r2, 2.6.25-rc8-git7 x86_64)
=================================================================
System uname: 2.6.25-rc8-git7 x86_64 AMD Phenom(tm) 9500 Quad-Core Processor
Timestamp of tree: Fri, 11 Apr 2008 11:45:03 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.1-r5
dev-python/pycrypto: 2.0.1-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.13, 2.62
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
Comment 1 SpanKY gentoo-dev 2008-04-12 19:02:46 UTC
post the actual build logs as well as your /etc/fstab as attachments
Comment 2 Jimmy.Jazz 2008-04-13 11:44:56 UTC
Created attachment 149545 [details]
openoffice 2.4.0 ebuild output

USE flags are:
cups dbus gnome gstreamer gtk pam webdav xulrunner

LINGUAS="fr"
Comment 3 Jimmy.Jazz 2008-04-13 11:46:59 UTC
Created attachment 149547 [details]
coreutils ebuild output (with xattr)
Comment 4 Jimmy.Jazz 2008-04-13 11:50:13 UTC
Created attachment 149549 [details]
fstab with user_xattr
Comment 5 Jimmy.Jazz 2008-04-13 12:05:30 UTC
(In reply to comment #1)
> post the actual build logs as well as your /etc/fstab as attachments
> 

Thx for taking your time to help me to figure out what the problem could be. 

I need xattr because of beagle that use it heavily.

the kernel was compiled with the following flags,
grep XATTR .config
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT4DEV_FS_XATTR=y
CONFIG_REISERFS_FS_XATTR=y
CONFIG_CIFS_XATTR=y

The output line that breaks openoffice ebuild is the one that contains GNUCP
I don't have a config.log anymore but GNUCP was set to cp.

The line in fstab:
/dev/vg/tmp /var/tmp ext3  noatime,acl,data=writeback          0 2
was set with the user_xattr during the tests.

I will try with the new coreutils -r2 again an see if there is any improvements.
Comment 6 Jimmy.Jazz 2008-04-13 12:27:01 UTC
Same problem with coreutils -r2 when xattr flag is set.
Comment 7 Jimmy.Jazz 2008-04-13 12:42:30 UTC
Funny, compiling coreutils-6.10-r2 without xattr again make it abort when it calles cp too (compiled with coreutils-6.10-r2 with xattr flag) :)

mv -f alloca.h-t alloca.h
mv fcntl.h-t fcntl.h
mkdir -p selinux
mv configmake.h-t configmake.h
cp ./se-selinux.in.h selinux/selinux.h-t
make[1]: *** [selinux/selinux.h] Segmentation fault
make[1]: *** Waiting for unfinished jobs....
mv math.h-t math.h
mv inttypes.h-t inttypes.h
make[1]: Leaving directory `/var/tmp/portage/sys-apps/coreutils-6.10-r2/work/coreutils-6.10/lib'
make: *** [all-recursive] Erreur 1
 * 
 * ERROR: sys-apps/coreutils-6.10-r2 failed.
Comment 8 Jimmy.Jazz 2008-04-13 14:03:49 UTC
IMHO, the bug cannot be hidden in the libraries called by cp. 
Indeed, after moving /bin/cp (version 6-10-r2+xattr) to /bin/cp.old, I was able to copy cp (version 6-10-r1 w/o xattr saved with quickpkg earlier) into /bin again. I didn't change the libraries, so cp and cp.old were using the same. 




Comment 9 Jimmy.Jazz 2008-04-13 14:05:19 UTC
(In reply to comment #8)
the same _libraries_ of course :)

Comment 10 SpanKY gentoo-dev 2008-04-13 22:16:49 UTC
so you're saying if you emerge with USE="acl -xattr", cp does not crash ?
Comment 11 Jimmy.Jazz 2008-04-14 09:42:47 UTC
(In reply to comment #10)
> so you're saying if you emerge with USE="acl -xattr", cp does not crash ?
> 

yes.
Comment 12 SpanKY gentoo-dev 2008-04-14 22:53:44 UTC
hrm, i cant reproduce this ...

dd if=/dev/zero of=loop count=1024
mke2fs loop
mkdir mnt
mount -o loop,acl,user_xattr loop mnt
cd mnt
touch a
cp a b

i have xattrs turned on in my kernel for ext2/ext3 ... could you try this test and see if things fail for you ?
Comment 13 Jimmy.Jazz 2008-04-15 12:41:09 UTC
(In reply to comment #12)
> hrm, i cant reproduce this ...
> 
> dd if=/dev/zero of=loop count=1024
> mke2fs loop
> mkdir mnt
> mount -o loop,acl,user_xattr loop mnt
> cd mnt
> touch a
> cp a b
> 

It works but the command "ebuild openoffice-2.4.0.ebuild install" broke again.

I made the same test without xattr_user for /var/tmp(/portage) tree and as surprisingly it is I was unable to emerge openoffice too.

I even tried the test in the /var/tmp/portage/app-office/openoffice-2.4.0/work/ooo/build/OOH680_m12/ directory and it still works.

I changed slightly the test and added a journal (etx3) to a bigger loop file. No go, it works.
I have downgraded the attr package and nothing doing the test works but not openoffice installation as usual.

That's sounded crazy enough to me and made me hesitate to report that stupid bug...

Have you tried to emerge openoffice 2.4.0 ? Has it worked ?

Also, most of the gtk python tools I run as user will return an annoying segmentation fault when I'm not exporting MALLOC_CHECK_=2 or 1. Perhaps that bug has something to do whith how glibc 2.7 malloc is "managed" ?

Actually, I don't overclock my system and the Phenom patch is activated in the bios.

In case that could help,

# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 38912
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 38912
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


Thanks for your fast reply.
Comment 14 Jimmy.Jazz 2008-04-19 22:18:07 UTC
(In reply to comment #12)
> hrm, i cant reproduce this ...

with the line "export MALLOC_CHECK_=2" in /etc/env.d/01glibc, the issue has gone. I'm now sure it is related to the glibc 2.7 version and certainly is correlate with the kernel release too.

Besides, it has corrected the python program crash. 

I suppose you didn't test it with the last glibc 2.7 release if you cannot reproduce it ? 

Comment 15 SpanKY gentoo-dev 2008-04-20 00:24:34 UTC
my systems are all running latest versions of the toolchain

if other things are crashing (like python) and they go away when setting an internal glibc variable, that suggests a lower layer is corrupting things ...
Comment 16 SpanKY gentoo-dev 2008-04-20 10:17:15 UTC
Created attachment 150367 [details, diff]
coreutils-xattr.patch

you can try this patch against coreutils-6.11 (it replaces the existing xattr patch in the patch tarball) ... but i'm not terribly confident that it'll fix your ails ...
Comment 17 Jimmy.Jazz 2008-04-20 12:39:36 UTC
(In reply to comment #15)
> my systems are all running latest versions of the toolchain
> 
> if other things are crashing (like python) and they go away when setting an
> internal glibc variable, that suggests a lower layer is corrupting things ...
> 

I will try to emerge all the system again. Could you suggest me any lower layers that interact with glibc I should take care in particularly ?
Comment 18 SpanKY gentoo-dev 2008-04-20 12:46:45 UTC
Comment on attachment 150367 [details, diff]
coreutils-xattr.patch

actually, ignore this patch ... it requires updates to the attr package which we dont have
Comment 19 Jimmy.Jazz 2008-04-20 13:09:13 UTC
(In reply to comment #16)
> Created an attachment (id=150367) [edit]
> coreutils-xattr.patch
> 
> you can try this patch against coreutils-6.11 (it replaces the existing xattr
> patch in the patch tarball) ... but i'm not terribly confident that it'll fix
> your ails ...
> 
I will give a try.

For now, I just upgraded to the last stable 2.6.25 kernel, linux-header 2.6.25 header, emerge -uDvab --newuse the world and also emerged glibc again. I made some new tests with coreutils 6.11 and the default 004_all_coreutils-acl-xattr.patch.
 
I was able to show the issue with binutils and coreutils.

The USE flags activated for the tests are:
[ebuild   R   ] sys-devel/binutils-2.18-r1  USE="nls -multislot -multitarget -test -vanilla" 0 kB 
[ebuild   R   ] sys-apps/coreutils-6.11  USE="acl nls (-selinux) -static -vanilla -xattr" 0 kB 

Setting LDFLAGS="-Wl,-O1 -Wl,--as-needed" or LDFLAGS="-Wl,-z,now" doesn't change anything. 

MALLOC_CHECK_=2 is set in /etc/profile.env

1) With xattr USE flag desactivated binutils can always be emerged

2) with xattr USE flag activated binutils emerge aborts with a segmentation fault at the cp line,

make[4]: entrant dans le répertoire « /var/tmp/portage/sys-devel/binutils-2.18-r1/work/build/bfd »
rm -f bfd-tmp.h
cp bfd-in3.h bfd-tmp.h
make[4]: *** [stmp-bfd-h] Erreur de segmentation
make[4]: *** Attente des tâches non terminées....

besides, coreutils 2.11 still fails to reemerge.

The bug .. or the misconfiguration is quite severe and it affects now 3 of my machines.

MALLOC_CHECK_ can be moved aside. It doesn't change anything and is just useful with python "binaries".


Comment 20 Jimmy.Jazz 2008-04-20 13:18:07 UTC
(In reply to comment #18)
> (From update of attachment 150367 [details, diff] [edit])
> actually, ignore this patch ... it requires updates to the attr package which
> we dont have
>

Let me know as soon as it is available. For now I will do an emerge -e system again.

Thanks for taking your time on it.
Comment 21 Jimmy.Jazz 2008-09-24 14:12:27 UTC
The bug is still here in sys-apps/coreutils-6.12-r1

I was unable to build glib package when xattr was activated. cp does a nice segmentation fault.

/bin/sh: line 2: 30436 Erreur de segmentation  cp xgen-gmc gmarshal.c

and even when reemerging... coreutils too. 

cp ./se-selinux.in.h selinux/selinux.h-t
mv math.h-t math.h
make[2]: *** [selinux/selinux.h] Segmentation fault

I'm using ext3 filesystems
Comment 22 Jimmy.Jazz 2008-09-24 14:13:58 UTC
Created attachment 166274 [details]
emerge --info
Comment 23 Jimmy.Jazz 2008-09-24 15:53:32 UTC
In case someone hits the bug, just do a 

busybox mv /bin/cp /bin/cp.BUG
ln -s /bin/busybox /bin/cp

and remerge coreutils w/ the -xattr flag again.
Comment 24 SpanKY gentoo-dev 2008-12-30 07:27:29 UTC
*** Bug 250882 has been marked as a duplicate of this bug. ***
Comment 25 SpanKY gentoo-dev 2009-02-20 00:20:46 UTC
*** Bug 259242 has been marked as a duplicate of this bug. ***
Comment 26 SpanKY gentoo-dev 2009-02-22 00:13:09 UTC
*** Bug 236866 has been marked as a duplicate of this bug. ***
Comment 27 SpanKY gentoo-dev 2009-02-22 00:14:18 UTC
should be fixed with coreutils-7.1
Comment 28 SpanKY gentoo-dev 2010-11-10 10:35:53 UTC
*** Bug 343075 has been marked as a duplicate of this bug. ***