Re: [coreutils] testsuite failures on Fedora
Eric Blake wrote: I'm seeing the following two failures on 'make check' on a SELinux-enforcing Fedora 13 system: Hi Eric, Thanks for the report. FAIL: misc/runcon-no-reorder (exit: 1) ... -runcon: failed to create security context: unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023: Operation not supported +runcon: runcon may be used only on a SELinux kernel ... I'm not sure why that failed during the test run, since on the command line, I see: $ runcon unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 true -j $ echo $? 0 Odd indeed. Is there something unusual about your partition or system? That test does not fail for me on x86_64 Fedora 13 with SELinux in enforcing mode. But since the test already maps other failures to a common message, perhaps all that is needed is an additional mapping if 'Operation not supported' results from the attempt? Before adding a work-around it'd be good to determine what is going wrong, especially since SELinux is implicated. FAIL: misc/stat-mount (exit: 1) === ... + stat_mnt=/shared/home + test /shared = /shared/home + fail=1 ... Here, the failure is that I have /home bind-mounted on /shared/home, and since I ran the test under /home, the mount location reported by df is different than the one reported by stat -c%m. This is a new test, and I'm not sure what to do about the issue (whether stat needs fixing to deal with bind mounts, or whether the test is at fault). If there's a reliable mechanism to determine that there is a potentially interfering bind mount, I'd like to skip this test.
[coreutils] [PATCH] maint: update to latest gnulib
* gnulib: Update to latest. * src/copy.c (copy_reg): Use fdutimens instead of gl_futimens. * src/touch.c (touch): Adjust parameter order. * tests/init.sh: Resync from upstream. --- There's been some upstream churn, for the better. I'm pushing this to match. gnulib|2 +- src/copy.c|2 +- src/touch.c |2 +- tests/init.sh | 117 ++--- 4 files changed, 98 insertions(+), 25 deletions(-) diff --git a/gnulib b/gnulib index 18aae5b..e196f90 16 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 18aae5b74420237d8c827e7c68312c5b71d659dc +Subproject commit e196f905d7673c9c9bfc951e1f3f6204cb7cc1eb diff --git a/src/copy.c b/src/copy.c index 6d11ed8..df31592 100644 --- a/src/copy.c +++ b/src/copy.c @@ -803,7 +803,7 @@ copy_reg (char const *src_name, char const *dst_name, timespec[0] = get_stat_atime (src_sb); timespec[1] = get_stat_mtime (src_sb); - if (gl_futimens (dest_desc, dst_name, timespec) != 0) + if (fdutimens (dest_desc, dst_name, timespec) != 0) { error (0, errno, _(preserving times for %s), quote (dst_name)); if (x-require_preserve) diff --git a/src/touch.c b/src/touch.c index 290f743..6358b89 100644 --- a/src/touch.c +++ b/src/touch.c @@ -163,7 +163,7 @@ touch (const char *file) t = NULL; } - ok = (fdutimensat (AT_FDCWD, (fd == STDOUT_FILENO ? NULL : file), fd, t, + ok = (fdutimensat (fd, AT_FDCWD, (fd == STDOUT_FILENO ? NULL : file), t, (no_dereference fd == -1) ? AT_SYMLINK_NOFOLLOW : 0) == 0); diff --git a/tests/init.sh b/tests/init.sh index bc82d69..d655fbb 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -79,6 +79,19 @@ fail_() { warn_ $ME_: failed test: $@; Exit 1; } skip_() { warn_ $ME_: skipped test: $@; Exit 77; } framework_failure_() { warn_ $ME_: set-up failure: $@; Exit 99; } +# Sanitize this shell to POSIX mode, if possible. +DUALCASE=1; export DUALCASE +if test -n ${ZSH_VERSION+set} (emulate sh) /dev/null 21; then + emulate sh + NULLCMD=: + alias -g '${1+$@}'='$@' + setopt NO_GLOB_SUBST +else + case `(set -o) 2/dev/null` in +*posix*) set -o posix ;; + esac +fi + # We require $(...) support unconditionally. # We require a few additional shell features only when $EXEEXT is nonempty, # in order to support automatic $EXEEXT emulation: @@ -90,44 +103,90 @@ framework_failure_() { warn_ $ME_: set-up failure: $@; Exit 99; } # shells until we find one that passes. If one is found, re-exec it. # If no acceptable shell is found, skip the current test. # +# The ...set -x; P=1 true 2err... test is to disqualify any shell that +# emits P=1 into err, as /bin/sh from SunOS 5.11 and OpenBSD 4.7 do. +# # Use 9 to indicate success (rather than 0), in case some shell acts # like Solaris 10's /bin/sh but exits successfully instead of with status 2. +# Eval this code in a subshell to determine a shell's suitability. +# 10 - passes all tests; ok to use +# 9 - ok, but enabling set -x corrupts application stderr; prefer higher score +# ? - not ok gl_shell_test_script_=' test $(echo y) = y || exit 1 -test -z $EXEEXT exit 9 +score_=10 +if test $VERBOSE = yes; then + test -n $( (exec 31; set -x; P=1 true 23) 2 /dev/null) score_=9 +fi +test -z $EXEEXT exit $score_ shopt -s expand_aliases alias a-b=echo zoo v=abx test ${v%x} = ab \ test ${v#a} = bx \ test $(a-b) = zoo \ - exit 9 + exit $score_ ' if test x$1 = x--no-reexec; then shift else - # 'eval'ing the above code makes Solaris 10's /bin/sh exit with $? set to 2. - # It does not evaluate any of the code after the unexpected `('. Thus, - # we must run it in a subshell. - ( eval $gl_shell_test_script_ ) /dev/null 21 - if test $? = 9; then -: # The current shell is adequate. No re-exec required. - else -# Search for a shell that meets our requirements. -for re_shell_ in ${CONFIG_SHELL:-no_shell} /bin/sh bash dash zsh pdksh fail -do - test $re_shell_ = no_shell continue - test $re_shell_ = fail skip_ failed to find an adequate shell + # Assume a working shell. Export to subshells (setup_ needs this). + gl_set_x_corrupts_stderr_=false + export gl_set_x_corrupts_stderr_ + + # Record the first marginally acceptable shell. + marginal_= + + # Search for a shell that meets our requirements. + for re_shell_ in __current__ ${CONFIG_SHELL:-no_shell} \ + /bin/sh bash dash zsh pdksh fail + do +test $re_shell_ = no_shell continue + +# If we've made it all the way to the sentinel, fail without +# finding even a marginal shell, skip this test. +if test $re_shell_ = fail; then + test -z $marginal_ skip_ failed to find an adequate shell + re_shell_=$marginal_ + break +fi + +# When testing the current shell, simply eval the test code. +# Otherwise, run it via $re_shell_ -c ... +if test $re_shell_ = __current__; then + # 'eval'ing
[coreutils] [PATCH] tests: fix a printf portability issue
not all printf commands support \xhh diff --git a/tests/misc/sort-debug-keys b/tests/misc/sort-debug-keys index 57a52a6..4e8beff 100755 --- a/tests/misc/sort-debug-keys +++ b/tests/misc/sort-debug-keys @@ -275,7 +275,7 @@ printf 2.,,3\n2.4\n | sort -s -k1n --debug printf 2,,3\n2.4\n | sort -s -k1n --debug # -z means we convert \0 to \n -printf 1a\x002b\x00 | sort -s -n -z --debug +printf 1a\0002b\000 | sort -s -n -z --debug # Check that \0 and \t intermix. printf \0\ta\n | sort -s -k2b,2 --debug | tr -d '\0'
bug#7042: df --help does not show `-m' option
On 16/09/10 23:34, Paul Eggert wrote: On 09/16/10 11:21, Eric Blake wrote: document -m, with --block-size=M as the long-option spelling add -g, with --block-size=G as the long-option spelling This doesn't sound like a good idea. Multi-terabyte disks are already here, and df -t is already taken. Also, df -g already means something different in Solaris. Is it really that hard to type df -Bg? Yes I agree the current unit selection options are fine. If we're going to make incompatible changes, I suggest that we solve the problem once and for all, by having df choose the default blocksize dynamically, based on the size of the output line describing the smallest disk. For example, where df currently outputs this: Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda111620338002 1437021 11618900981 1% /r/opt /dev/sda2 20971520 1335871 19635650 7% /home/eggert df would notice that the smallest file system is between 1GB and 1TB, so it would default to 1 GB blocks, as follows: Filesystem 1GB-blocks Used Available Use% Mounted on /dev/sda1 11900GB 2GB 11898GB 1% /r/opt /dev/sda2 22GB 2GB 21GB 7% /home/eggert This is much more useful as an output format, because one can visually see which file systems are larger by seeing how many digits are there. Contrast this to the output of df --si: Filesystem Size Used Avail Use% Mounted on /dev/sda1 12T 1.5G12T 1% /r/opt /dev/sda2 22G 1.4G21G 7% /home/eggert which is harder to visually parse that way. That would break lots of scripts I'd say (they should use -P, but many don't). In any case I don't think there is enough benefit in such a format change given the common wide range of device sizes attached to systems. Personally I find the `df -h` format easiest to read. While we're at it, we should fix df so that its columns line up better; that would be another incompatible change, but it'd be worth it on hosts where the file system names are long. We definitely should do this to support languages with side column headings, and `df -B\'1` I've an unfinished local branch to do this with mbsalign() cheers, Pádraig.
bug#6402: [PATCH] rm: remove no-op -d option
Eric Blake wrote: * src/rm.c (long_opts, main): Resolve a fixme. * NEWS: Document the change. Based on a report by William Plusnick. --- Jim, what do you think of this alternative patch, which avoids the issue of a new translation string by instead letting getopt parsing reject -d like any other unknown option? I like it. Thank you. ... --- a/NEWS ... + rm -d now issues an error rather than being silently ignored. How about a slight change in wording to make clear that the entire rm command was not being ignored. rm's -d now evokes an error; before, it was silently ignored.
bug#7042: df --help does not show `-m' option
Hi, On Fri, Sep 17, 2010 at 09:56:57AM +0100, Pádraig Brady wrote: On 16/09/10 23:34, Paul Eggert wrote: If we're going to make incompatible changes, I suggest that we solve the problem once and for all, by having df choose the default blocksize dynamically, based on the size of the output line describing the smallest disk. For example, where df currently outputs this: Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda111620338002 1437021 11618900981 1% /r/opt /dev/sda2 20971520 1335871 19635650 7% /home/eggert df would notice that the smallest file system is between 1GB and 1TB, so it would default to 1 GB blocks, as follows: Filesystem 1GB-blocks Used Available Use% Mounted on /dev/sda1 11900GB 2GB 11898GB 1% /r/opt /dev/sda2 22GB 2GB 21GB 7% /home/eggert This is much more useful as an output format, because one can visually see which file systems are larger by seeing how many digits are there. Contrast this to the output of df --si: Filesystem Size Used Avail Use% Mounted on /dev/sda1 12T 1.5G12T 1% /r/opt /dev/sda2 22G 1.4G21G 7% /home/eggert which is harder to visually parse that way. Yes, especially 1.5G of the 12T disk used looks a lot like 1.5T of 1.5T used. That would break lots of scripts I'd say (they should use -P, but many don't). That's obvious (all three points, sadly). In any case I don't think there is enough benefit in such a format change given the common wide range of device sizes attached to systems. I like Paul's suggestion. Of course there are corner cases (mounting an older USB stick with e.g. 128MB). The base could be selected by the smallest mounted fixed disk. Erik -- [T]he essence of XML is this: the problem it solves is not hard, and it does not solve the problem well. -- The Essence of XML by Jérôme Siméon, Philip Wadler
bug#6402: [PATCH] rm: remove no-op -d option
On 09/17/2010 03:13 AM, Jim Meyering wrote: Jim, what do you think of this alternative patch, which avoids the issue of a new translation string by instead letting getopt parsing reject -d like any other unknown option? I like it. Thank you. ... --- a/NEWS ... + rm -d now issues an error rather than being silently ignored. How about a slight change in wording to make clear that the entire rm command was not being ignored. rm's -d now evokes an error; before, it was silently ignored. Pushed with that change. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org
bug#7042: df --help does not show `-m' option
Pádraig Brady p...@draigbrady.com writes: On 16/09/10 23:34, Paul Eggert wrote: If we're going to make incompatible changes, I suggest that we solve the problem once and for all, by having df choose the default blocksize dynamically, based on the size of the output line describing the smallest disk. For example, where df currently outputs this: Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda111620338002 1437021 11618900981 1% /r/opt /dev/sda2 20971520 1335871 19635650 7% /home/eggert df would notice that the smallest file system is between 1GB and 1TB, so it would default to 1 GB blocks, as follows: Filesystem 1GB-blocks Used Available Use% Mounted on /dev/sda1 11900GB 2GB 11898GB 1% /r/opt /dev/sda2 22GB 2GB 21GB 7% /home/eggert That would break lots of scripts I'd say (they should use -P, but many don't). You could use `df -Bauto' for that. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.
bug#7057: Use of JOIN with tab as delimiter
I would like to use JOIN on tab delimited files in a Windows console window (with GNUwin32 CoreUtils), but I'm not able to specify tab as delimiter (-t switch). With the default settings, all tabs are replaced by spaces in my output file. Any solution for this problem? Kind regards, Tom Magerman
bug#7057: Use of JOIN with tab as delimiter
On 09/17/2010 12:22 PM, Magerman, Tom wrote: I would like to use JOIN on tab delimited files in a Windows console window (with GNUwin32 CoreUtils), but I'm not able to specify tab as delimiter (-t switch). With the default settings, all tabs are replaced by spaces in my output file. Any solution for this problem? What have you tried (that is, show us the command line you typed)? Are you sure you are quoting tab correctly for the shell you are using? Based on your comment about a Windows console window, I'm assuming you are using cmd (rather than a more traditional Unix-y shell like sh) as your shell, you are probably more likely to get a good answer from the GNUwin32 folks rather than here, since most readers of this list don't use cmd. Might I suggest instead trying the cygwin environment, where bash is pre-built for Windows, and which has traditional Unix quoting and is thus something that more readers of this list can help you with. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org
bug#7061: loop on touch (fdutimens)
Hello, I just built ran a quick test on coreutils GIT. I received a SEGV on touch, and ran it under GDB. Looks like a loop. Cheers, cer...@xango2:/build/buildd/coreutils$ gdb --args src/touch test GNU gdb (GDB) 7.2-ubuntu Copyright (C) 2010 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. Type show copying and show warranty for details. This GDB was configured as x86_64-linux-gnu. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /src/buildd/coreutils/src/touch...done. (gdb) set pagination off (gdb) r Starting program: /src/buildd/coreutils/src/touch test [Thread debugging using libthread_db enabled] Program received signal SIGSEGV, Segmentation fault. 0x004073dc in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:193 193 if (dup2 (fd, fd) != fd) (gdb) bt 3 full #0 0x004073dc in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:193 adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 0}} ts = 0x0 adjustment_needed = 0 st = error reading variable st (Cannot access memory at address 0x7f5fef70) #1 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:269 result = value optimized out adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 0}} ts = 0x0 adjustment_needed = value optimized out st = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {0, 0, 0}} #2 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:269 result = value optimized out adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 0}} ts = 0x0 adjustment_needed = value optimized out st = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {0, 0, 0}} (More stack frames follow...) (gdb) bt -5 full #38527 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:269 result = value optimized out adjusted_timespec = {{tv_sec = 8589924528, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 4197073}} ts = 0x0 adjustment_needed = value optimized out st = {st_dev = 4197129, st_ino = 140737354130624, st_nlink = 140737488345056, st_mode = 4160562656, st_uid = 32767, st_gid = 4294957064, __pad0 = 32767, st_rdev = 140737354129768, st_size = 255564379, st_blksize = 140737351936210, st_blocks = 0, st_atim = {tv_sec = 140737353950688, tv_nsec = 140733193388033}, st_mtim = {tv_sec = 0, tv_nsec = 1}, st_ctim = {tv_sec = 140737354129768, tv_nsec = 0}, __unused = {140737353950688, 1, 0}} #38528 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:269 result = value optimized out adjusted_timespec = {{tv_sec = 5, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 140737351981093}} ts = 0x0 adjustment_needed = value optimized out st = {st_dev = 29848917, st_ino = 2, st_nlink = 140737349750208, st_mode = 0, st_uid = 0, st_gid = 4152746968, __pad0 = 32767, st_rdev = 140737354115432, st_size = 0, st_blksize = 4294967295, st_blocks = 24, st_atim = {tv_sec = 1, tv_nsec = 6336552}, st_mtim = {tv_sec = 0, tv_nsec = 1}, st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {140737351953297, 1, 0}} #38529 0x004024e2 in fdutimensat (fd=0, dir=-100, file=0x7fffde74 test, ts=0x0, atflag=0) at fdutimensat.c:48 result = 1 #38530 0x00401f21 in touch (argc=2, argv=0x7fffdad8) at touch.c:166 ok = value optimized out fd = 0 open_errno = 0 t = 0x77929f97 #38531 main (argc=2, argv=0x7fffdad8) at touch.c:432 c = value optimized out date_set = value optimized out ok = true flex_date = value optimized out (gdb) list 188 if (fd 0) 189 { 190 errno = EBADF; 191 return -1; 192 } 193 if (dup2 (fd, fd) != fd) 194 return -1; 195 } 196 197 /* Some Linux-based NFS clients are buggy, and mishandle time stamps (gdb) cer...@xango2:/build/buildd/coreutils$ src/touch --version touch (GNU coreutils) 8.5.154-2dd21 Copyright (C) 2010 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
bug#7061: loop on touch (fdutimens)
On 09/17/2010 05:49 PM, C de-Avillez wrote: I just built ran a quick test on coreutils GIT. I received a SEGV on touch, and ran it under GDB. I don't observe the problem. I just now grabbed a fresh copy of coreutils. I ran your test on Ubuntu 10.04 x86 and on RHEL 5 x86-64. My guess is that you are running coreutils with a slightly out-of-date gnulib, or vice versa. You need to have either both of the following patches, or neither of them. http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=2dd21704d63c4e7567695a9e43dc1631b930efe2 http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=89b0db35db10a8beccaf83909c7f62f127fb5821
bug#7061: loop on touch (fdutimens)
On Fri, 17 Sep 2010 19:03:30 -0700 Paul Eggert egg...@cs.ucla.edu wrote: On 09/17/2010 05:49 PM, C de-Avillez wrote: I just built ran a quick test on coreutils GIT. I received a SEGV on touch, and ran it under GDB. I don't observe the problem. I just now grabbed a fresh copy of coreutils. I ran your test on Ubuntu 10.04 x86 and on RHEL 5 x86-64. I am running it on Ubuntu Maverick (soon to-be 10.10). I do not have another Linux distro to test right now, but I will build a 10.04 on KVM. My guess is that you are running coreutils with a slightly out-of-date gnulib, or vice versa. You need to have either both of the following patches, or neither of them. http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=2dd21704d63c4e7567695a9e43dc1631b930efe2 http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=89b0db35db10a8beccaf83909c7f62f127fb5821 Both are applied on my git copy. Hum. I will go and redo it from a fresh git copy. Thanks, Paul. I will post what I find. -- C de-Avillez IRC: hggdh This email (and any attachments) is digitally signed using GNUpg (http://gnupg.org). The public key is available at http://pgp.mit.edu. The key Id is 0xD3133E56. signature.asc Description: PGP signature