Bug 1263341 - FTBFS: coreutils on xfs buildroot
FTBFS: coreutils on xfs buildroot
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: coreutils (Show other bugs)
7.1
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Ondrej Vasik
Jakub Prokes
: EasyFix, Patch
Depends On:
Blocks: 1289025 1305230
  Show dependency treegraph
 
Reported: 2015-09-15 11:13 EDT by Pat Riehecky
Modified: 2016-11-04 03:39 EDT (History)
6 users (show)

See Also:
Fixed In Version: coreutils-8.22-17.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-04 03:39:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
mockroot (90.76 KB, text/plain)
2015-09-17 10:29 EDT, Pat Riehecky
no flags Details

  None (edit)
Description Pat Riehecky 2015-09-15 11:13:47 EDT
Description of problem:
coreutils-8.22-12.el7_1.2.src.rpm does not self-test correctly on an XFS filesystem.

Version-Release number of selected component (if applicable):coreutils-8.22-12.el7_1.2.src.rpm


How reproducible:100%


Steps to Reproduce:
1.Attempt package rebuild on a RHEL7.1 system with XFS as the filesystem
2.
3.

Actual results:
FAIL: tests/ls/stat-free-color
==============================
++ initial_cwd_=/builddir/build/BUILD/coreutils-8.22
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /builddir/build/BUILD/coreutils-8.22 gt-stat-free-color.sh.XXXX
+++ case $# in
+++ destdir_=/builddir/build/BUILD/coreutils-8.22
+++ template_=gt-stat-free-color.sh.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
++++ unset TMPDIR
+++ d=/builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
+++ case $d in
+++ test -d /builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
++++ ls -dgo /builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
++++ tr S -
+++ perms='drwx------. 2 6 -ep 15 08:23 /builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO'
+++ case $perms in
+++ test 0 = 0
+++ echo /builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
+++ return
++ test_dir_=/builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
++ cd /builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/builddir/build/BUILD/coreutils-8.22/./src
+ case $abs_path_dir_ in
+ PATH=/builddir/build/BUILD/coreutils-8.22/./src:/builddir/build/BUILD/coreutils-8.22/src:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
+ create_exe_shims_ /builddir/build/BUILD/coreutils-8.22/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ ls
+ test yes = yes
+ local i
+ for i in '$*'
+ env ls --version
ls (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
+ stats=stat,lstat,stat64,lstat64,newfstatat
+ require_strace_ stat,lstat,stat64,lstat64,newfstatat
+ test 1 = 1
+ strace -V
+ strace -qe stat,lstat,stat64,lstat64,newfstatat echo
+ strace -o log-help ls --help
++ wc -l
+ n_lines_help=121
+ rm -f log-help
+ test 121 = 0
+ test 121 = 1
+ require_dirent_d_type_
+ python
+ df -x xfs .
+ python /builddir/build/BUILD/coreutils-8.22/tests/d_type-check
+ ln -s nowhere dangle
+ cat
++ dircolors -b color-without-stat
+ eval 'LS_COLORS='\''rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=00:su=00:sg=00:ca=00:tw=00:ow=00:st=00:ex=00:mh=00:'\'';' export LS_COLORS
++ LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=00:su=00:sg=00:ca=00:tw=00:ow=00:st=00:ex=00:mh=00:'
++ export LS_COLORS
+ strace -o log-help -e stat,lstat,stat64,lstat64,newfstatat ls --help
++ wc -l
+ n_lines_help=1
+ strace -o log -e stat,lstat,stat64,lstat64,newfstatat ls --color=always .
color-without-stat
[0m[01;36mdangle[0m
log
log-help
++ wc -l
+ n_lines=6
++ expr 6 - 1
+ n_stat=5
+ case $n_stat in
+ fail=1
+ head -n30 log log-help
==> log <==
stat(".", {st_mode=S_IFDIR|0700, st_size=69, ...}) = 0
lstat("dangle", {st_mode=S_IFLNK|0777, st_size=7, ...}) = 0
lstat("color-without-stat", {st_mode=S_IFREG|0644, st_size=210, ...}) = 0
lstat("log-help", {st_mode=S_IFREG|0644, st_size=22, ...}) = 0
lstat("log", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
+++ exited with 0 +++
==> log-help <==
+++ exited with 0 +++
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ cd /builddir/build/BUILD/coreutils-8.22
+ chmod -R u+rwx /builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
+ rm -rf /builddir/build/BUILD/coreutils-8.22/gt-stat-free-color.sh.aohO
+ exit 1

Expected results:
%check completes successfully

Additional info:
Builds just fine on EXT4
Comment 2 Kamil Dudka 2015-09-17 05:04:50 EDT
I am not able to reproduce the bug.  coreutils-8.22-12.el7_1.2 builds just fine on my VM with fresh RHEL-7.2 Beta installation and the XFS file system.  We have a bug about failing dd/sparse test on an XFS file system, which is going to be fixed in RHEL-7.2 (bug #1223041) but it does not seem to be related to this bug report.
Comment 3 Pádraig Brady 2015-09-17 07:50:38 EDT
This test should be skipped on XFS due to no dirent->d_type support.
The test does this (in init.cfg): df -x xfs . || skip ...
Is the file system not tagged as 'xfs' or something?
Comment 4 Pat Riehecky 2015-09-17 10:14:10 EDT
/etc/mtab shows:
/dev/sda6 /var/lib/mock xfs rw 0 0

The host builder is EL6, not EL7 though.  Is it possible that the difference in behavior is hiding there?
Comment 5 Kamil Dudka 2015-09-17 10:18:36 EDT
(In reply to Pat Riehecky from comment #4)
> The host builder is EL6, not EL7 though.

Does it mean the steps to reproduce in comment #0 are not valid?

> Is it possible that the difference in behavior is hiding there?

How exactly do you build the package?
Comment 6 Pat Riehecky 2015-09-17 10:28:53 EDT
Blast, I made a typo in the reproduction steps (s/7.1/6.7)....  Sorry about that.

Correct steps (in more detail):
1. Init a mock root on an EL6.7 system with /var/lib/mock as an XFS volume.  The buildroot should consist of EL7.1 packages.
2. Resolve all EL7 build deps within the buildroot for coreutils
3. attempt rebuild

I'll attach my mock root log, in case it is helpful.
Comment 7 Pat Riehecky 2015-09-17 10:29:12 EDT
Created attachment 1074470 [details]
mockroot
Comment 8 Pádraig Brady 2015-09-17 15:13:21 EDT
The mock root might explain why df is not detecting 'xfs' correctly.
What's the output from `df -T .` and `cat /proc/self/mounts` from within the mock?
Comment 9 Pat Riehecky 2015-09-17 15:18:31 EDT
The output looks like:

<mock-chroot>[root@sl7 /]# df -T
df: ‘/selinux’: No such file or directory
df: ‘/mnt/koji’: No such file or directory
df: ‘/var/lib/mock’: No such file or directory
df: ‘/export/disk5’: No such file or directory
df: ‘/export/linux’: No such file or directory
df: ‘/mnt/disk5’: No such file or directory
df: ‘/mnt/src’: No such file or directory
Filesystem        Type     1K-blocks    Used Available Use% Mounted on
/dev/sda1         ext4     157935264 2365316 155569948   2% /
devtmpfs          devtmpfs 157935264 2365316 155569948   2% /dev
/dev/sda5         xfs      157935264 2365316 155569948   2% /tmp
tmpfs             tmpfs      8156508       0   8156508   0% /dev/shm
mock_chroot_shmfs tmpfs      8156508       0   8156508   0% /dev/shm
/dev/sda3         ext4      30106576 7857368  20713208  28% /var/cache/yum
/dev/sda5         xfs       25587500   41376  25546124   1% /proc/filesystems
<mock-chroot>[root@sl7 /]# cat /proc/self/mounts
rootfs / rootfs rw 0 0
/dev/sda1 / ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
none /selinux selinuxfs rw,relatime 0 0
devtmpfs /dev devtmpfs rw,seclabel,relatime,size=8145364k,nr_inodes=2036341,mode=755 0 0
devtmpfs /dev devtmpfs rw,seclabel,relatime,size=8145364k,nr_inodes=2036341,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,seclabel,relatime 0 0
proc /proc proc rw,relatime 0 0
/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
/dev/sdb1 /mnt/koji xfs rw,seclabel,relatime,attr2,delaylog,noquota 0 0
/dev/sda5 /tmp xfs rw,seclabel,relatime,attr2,delaylog,noquota 0 0
/dev/sda3 /var ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
/dev/sda6 /var/lib/mock xfs rw,seclabel,relatime,attr2,delaylog,noquota 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
blue1.fnal.gov:/sl-dev /export/disk5 nfs rw,noatime,nodiratime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=131.225.111.89,mountvers=3,mountport=4048,mountproto=tcp,local_lock=none,addr=131.225.111.89 0 0
blue1.fnal.gov:/export/linux /export/linux nfs ro,nosuid,nodev,noexec,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=131.225.111.89,mountvers=3,mountport=4048,mountproto=tcp,local_lock=all,addr=131.225.111.89 0 0
blue1.fnal.gov:/sl-dev /mnt/disk5 nfs rw,noatime,nodiratime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=131.225.111.89,mountvers=3,mountport=4048,mountproto=tcp,local_lock=none,addr=131.225.111.89 0 0
blue1.fnal.gov:/sl-dev /mnt/src nfs rw,noatime,nodiratime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=131.225.111.89,mountvers=3,mountport=4048,mountproto=tcp,local_lock=none,addr=131.225.111.89 0 0
proc /proc proc rw,relatime 0 0
mock_chroot_sys /sys sysfs rw,seclabel,relatime 0 0
mock_chroot_shmfs /dev/shm tmpfs rw,rootcontext=unconfined_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
mock_chroot_devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=666 0 0
/dev/sda3 /var/cache/yum ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
/dev/sda3 /var/run/pesign ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
/dev/sda5 /proc/filesystems xfs rw,seclabel,relatime,attr2,delaylog,noquota 0 0
<mock-chroot>[root@sl7 /]#
Comment 10 Kamil Dudka 2015-09-18 07:06:09 EDT
(In reply to Pat Riehecky from comment #6)
> Correct steps (in more detail):
> 1. Init a mock root on an EL6.7 system with /var/lib/mock as an XFS volume. 
> The buildroot should consist of EL7.1 packages.
> 2. Resolve all EL7 build deps within the buildroot for coreutils
> 3. attempt rebuild

Thanks for the update!  I can confirm the build fails using the steps above.
Comment 11 Kamil Dudka 2015-09-18 07:45:19 EDT
(In reply to Pat Riehecky from comment #9)
> The output looks like:
> 
> <mock-chroot>[root@sl7 /]# df -T

Pádraig suggested to run 'df -T .' -- you are missing the dot in your command!

> /dev/sda3         ext4      30106576 7857368  20713208  28% /var/cache/yum

The above line is the only important since /builddir/build/BUILD/coreutils-8.22 resolves to / which is an ext4 file system according to /proc/self/mounts whose entries are not valid inside the chroot.

I am not sure how to improve the skip condition to make it work inside chroot.
Comment 12 Pádraig Brady 2015-11-06 12:36:55 EST
I improved the test upstream which should avoid this issue
http://lists.gnu.org/archive/html/coreutils/2015-11/msg00020.html
Comment 13 Ondrej Vasik 2015-11-07 02:14:38 EST
Thanks, Pádraig.
Comment 23 errata-xmlrpc 2016-11-04 03:39:10 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2497.html

Note You need to log in before you can comment on or make changes to this bug.