bug#22487: tests failures for coreutils-8.25 on AIX-7.1

2016-01-28 Thread Assaf Gordon

Hello,

The following tests fail on AIX-7.1:

FAIL: tests/misc/kill.sh

...
++ env kill -l 15
+ test EXIT = TERM
+ fail=1


FAIL: tests/misc/stdbuf.sh
==
...
*** exp Thu Jan 28 10:06:22 2016
--- out Thu Jan 28 10:06:25 2016
***
*** 1 
--- 1,2 
  1
+ 2
+ rm -f diff.out
+ false
+ time_fail=1
++ expr 6 + 1
+ attempt=7
++ expr 32 '*' 2
+ num_sleeps=64
+ test 7 -le 6
+ test 1 = 0
+ fail=1

(related to failed 7 attempts)


FAIL: tests/misc/sync.sh

...
*** exp Thu Jan 28 10:06:33 2016
--- err Thu Jan 28 10:06:33 2016
***
*** 1 
! sync: error opening 'norw': Permission denied
--- 1 
! sync: error opening 'norw': Is a directory
+ rm -f diff.out
+ false
+ fail=1

(seems like different error message running 'sync' on a directory without 
permissions).



FAIL: tests/touch/trailing-slash

...
+ returns_ 1 touch no-file/
touch: setting times of 'no-file/': No such file or directory
+ returns_ 1 touch file/
+ fail=1
+ returns_ 1 touch dangling/
touch: setting times of 'dangling/': No such file or directory
+ returns_ 1 touch loop/
touch: setting times of 'loop/': Too many levels of symbolic links
+ returns_ 1 touch link1/
+ fail=1
+ touch dir/
+ touch -c no-file/
+ returns_ 1 touch -c file/
+ fail=1
+ touch -c dangling/
+ returns_ 1 touch -c loop/
touch: setting times of 'loop/': Too many levels of symbolic links
+ returns_ 1 touch -c link1/
+ fail=1




Lastly,
   tests/cp/parent-perm-race.sh
hangs and never terminates.
The log contains this error:

   $ cat tests/cp/parent-perm-race.log
   ...
   + for attr in mode ownership
   + mkfifo_or_skip_ mode/fifo
   + test 1 = 1
   + mkfifo mode/fifo
   + pid=35324056
   + cp --preserve=mode -R --copy-contents --parents mode d
   cp: cannot open 'mode/fifo' for reading: Invalid argument



logs attached.

regards,
 - assaf

   GNU coreutils 8.25: ./tests/test-suite.log


# TOTAL: 4
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  4
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/misc/kill
=

++ initial_cwd_=/home/agn/sources/coreutils-8.25
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /home/agn/sources/coreutils-8.25 gt-kill.sh.
+++ case $# in
+++ destdir_=/home/agn/sources/coreutils-8.25
+++ template_=gt-kill.sh.
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
 unset TMPDIR
+++ d=/home/agn/sources/coreutils-8.25/gt-kill.sh.kpaQ
+++ case $d in
+++ test -d /home/agn/sources/coreutils-8.25/gt-kill.sh.kpaQ
 ls -dgo /home/agn/sources/coreutils-8.25/gt-kill.sh.kpaQ
 tr S -
+++ perms='drwx-- 2 256 Jan 28 10:06 /home/agn/sources/coreutils-8.25/gt-kill.sh.kpaQ'
+++ case $perms in
+++ test 0 = 0
+++ echo /home/agn/sources/coreutils-8.25/gt-kill.sh.kpaQ
+++ return
++ test_dir_=/home/agn/sources/coreutils-8.25/gt-kill.sh.kpaQ
++ cd /home/agn/sources/coreutils-8.25/gt-kill.sh.kpaQ
++ 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_=/home/agn/sources/coreutils-8.25/./src
+ case $abs_path_dir_ in
+ PATH=/home/agn/sources/coreutils-8.25/./src:/home/agn/sources/coreutils-8.25/src:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/agn/bin:/home/agn/usr/bin:/usr/bin/X11:/sbin:.
+ create_exe_shims_ /home/agn/sources/coreutils-8.25/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ kill
+ require_built_ kill
+ skip_=no
+ for i in '"$@"'
+ case " $built_programs " in
+ test no = yes
+ test yes = yes
+ local i
+ for i in '$*'
+ env kill --version
kill (GNU coreutils) 8.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Eggert.
+ returns_ 1 env kill
kill: no process ID specified
Try 'kill --help' for more information.
+ returns_ 1 env kill -TERM
kill: no process ID specified
Try 'kill --help' for more information.
+ returns_ 1 env kill -l -l
kill: multiple -l or -t options specified
Try 'kill --help' for more information.
+ returns_ 1 env kill -l -t
kill: multiple -l or -t options specified
Try 'kill --help' for more information.
+ returns_ 1 env 

bug#22464: compilation fails on AIX-7 (undefined symbol .rpl_malloc)

2016-01-28 Thread Assaf Gordon

Hello,

On 01/25/2016 11:57 AM, Assaf Gordon wrote:

compiling 8.25 on AIX-7 fails with "undefined symbol .rpl_malloc".

I'll be able to investigate further a bit later, but this seems similar to:
   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12841
===
   $ ./configure
   $ make V=1
   ...
   ...
 gcc -std=gnu99  -I. -I./lib  -Ilib -I./lib -Isrc -I./src 
-D_THREAD_SAFE -fPIC  -g -O2 -MT src/src_libstdbuf_so-libstdbuf.o -MD -MP -MF 
src/.deps/src_libstdbuf_so-libstdbuf.Tpo -c -o src/src_libstdbuf_so-libstdbuf.o 
`test -f 'src/libstdbuf.c' || echo './'`src/libstdbuf.c
 mv -f src/.deps/src_libstdbuf_so-libstdbuf.Tpo 
src/.deps/src_libstdbuf_so-libstdbuf.Po
 gcc -std=gnu99 -fPIC  -g -O2  -shared  -o src/libstdbuf.so 
src/src_libstdbuf_so-libstdbuf.o
ld: 0711-317 ERROR: Undefined symbol: .rpl_malloc
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status


The attached patch avoids the error, though I'm not sure if it's optimal (it adds 
"#undef malloc" as suggested in the above bug report).

Compilation then succeeds, but make still fails due to some strange dependency 
issue with man-page generation:


$ make V=1
make  all-recursive
Making all in po
Target "all" is up to date.
Making all in .
name=`echo man/test.1 | sed 's|.*/||; s|\.1$||'` || exit 1;  case $name in   install) prog='ginstall'; argv=$name;;  test) prog='['; argv='[';;  *) prog=$name; argv=$prog;; esac;   rm -f man/test.1 man/test.1-t   && t=man/test.td&& rm -rf $t&& /home/agn/usr/bin/gmkdir -p $t   && (cd $t && ln -s '/home/agn/sources/coreutils-8.25/src/'$prog  $argv) && : ${SOURCE_DATE_EPOCH=`cat ./.timestamp 2>/dev/null || :`}  && export SOURCE_DATE_EPOCH && perl -- ./man/help2man--source='GNU coreutils 8.25'   --include=./man/$name.x 
 
  --output=$t/$name.1 --info-page='\(aq(coreutils) '$name' invocation\(aq'  $t/$argv  && sed  -e 's|man/test\.td/||g'  -e '/For complete documentation/d'  $t/$name.1 > man/test.1-t  && rm -rf $t&& chmod a-w man/test.1-t   && mv man/test.1-t man/test.1

help2man: can't get `--help' info from man/test.td/[
Try `--no-discard-stderr' if option outputs to stderr
make: 1254-004 The error code from the last command is 127.


Seems like "src/[" is not automatically built ?

===
$ ls -l ./man/test.td/\[
lrwxrwxrwx1 agn  usr  38 Jan 28 07:25 ./man/test.td/[ -> 
/home/agn/sources/coreutils-8.25/src/[

$ ls -l ./src/[
ls: 0653-341 The file ./src/[ does not exist.
===

To solve it, I built "/src/[" explicitly, then "make" completes successfully.

===
$ make src/[
  CC   src/lbracket.o
  CCLD src/[
$ make
(( completes successfully ))
===

After that few tests fail with 'make check', I'll send in a separate message.


regards,
 - assaf
>From d915acd0224105c3c7cb5057f61361eb452be83c Mon Sep 17 00:00:00 2001
From: Assaf Gordon 
Date: Wed, 27 Jan 2016 23:11:02 -0500
Subject: [PATCH] stdbuf: fix compliation issue AIX 7.1

* src/libstdbuf.c: #undef 'malloc' to avoid
'undefined symbol .rpl_malloc' errors.
  See: https://bugs.gnu.org/22464 .
---
 src/libstdbuf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/libstdbuf.c b/src/libstdbuf.c
index 885377a..2141f88 100644
--- a/src/libstdbuf.c
+++ b/src/libstdbuf.c
@@ -20,6 +20,9 @@
 #include 
 #include "system.h"
 
+/* Deactivate config.h's "rpl_"-prefixed definitions of this symbol.  */
+#undef malloc
+
 /* Note currently for glibc (2.3.5) the following call does not change
the buffer size, and more problematically does not give any indication
that the new size request was ignored:
-- 
1.9.1