libatomic_ops 7.8.2 fails all tests on Solaris 10 SPARC64
This is a Fujitsu SPARC64 server with Solaris 10 and a small collection of GNU tools
already built. I am using GCC ver 9.5.0 also.
The configure looks fine :
hubble $
hubble $ ./configure --prefix=/opt/bw --disable-silent-rules --enable-dependency-tracking --enable-shared --enable-static --without-gnu-ld 2>&1 | tee `pwd`.config.log
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking target system type... sparc-sun-solaris2.10
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether /opt/bw/bin/make sets $(MAKE)... yes
checking whether /opt/bw/bin/make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether /opt/bw/bin/make supports the include directive... yes (GNU style)
checking for gcc... /opt/bw/gcc9/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /opt/bw/gcc9/bin/gcc accepts -g... yes
checking for /opt/bw/gcc9/bin/gcc option to enable C11 features... none needed
checking whether /opt/bw/gcc9/bin/gcc understands -c and -o together... yes
checking dependency style of /opt/bw/gcc9/bin/gcc... gcc3
checking dependency style of /opt/bw/gcc9/bin/gcc... gcc3
checking how to print strings... printf
checking for a sed that does not truncate output... /opt/bw/bin/sed
checking for grep that handles long lines and -e... /opt/bw/bin/grep
checking for egrep... /opt/bw/bin/grep -E
checking for fgrep... /opt/bw/bin/grep -F
checking for ld used by /opt/bw/gcc9/bin/gcc... /usr/ccs/bin/sparcv9/ld
checking if the linker (/usr/ccs/bin/sparcv9/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/xpg4/bin/nm -p
checking the name lister (/usr/xpg4/bin/nm -p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking how to convert sparc-sun-solaris2.10 file names to sparc-sun-solaris2.10 format... func_convert_file_noop
checking how to convert sparc-sun-solaris2.10 file names to toolchain format... func_convert_file_noop
checking for /usr/ccs/bin/sparcv9/ld option to reload object files... -r
checking for file... file
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/xpg4/bin/nm -p output from /opt/bw/gcc9/bin/gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/param.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /opt/bw/gcc9/bin/gcc supports -fno-rtti -fno-exceptions... no
checking for /opt/bw/gcc9/bin/gcc option to produce PIC... -fPIC -DPIC
checking if /opt/bw/gcc9/bin/gcc PIC flag -fPIC -DPIC works... yes
checking if /opt/bw/gcc9/bin/gcc static flag -static works... no
checking if /opt/bw/gcc9/bin/gcc supports -c -o file.o... yes
checking if /opt/bw/gcc9/bin/gcc supports -c -o file.o... (cached) yes
checking whether the /opt/bw/gcc9/bin/gcc linker (/usr/ccs/bin/sparcv9/ld -64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for PIC compiler flag... -fPIC
checking whether -fPIC compiler option causes __PIC__ definition... yes
checking whether compiler supports -Wextra... yes
checking whether compiler supports -Wpedantic... yes
checking for pthread_self in -lpthread... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating pkgconfig/atomic_ops.pc
config.status: creating pkgconfig/atomic_ops-uninstalled.pc
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default commands
hubble $
Compile is fine with only one warning :
atomic_ops_malloc.c: In function 'AO_free_large':
atomic_ops_malloc.c:207:24: warning: passing argument 1 of 'munmap' from incompatible pointer type [-Wincompatible-pointer-types]
207 | if (munmap((AO_t *)p - ALIGNMENT / sizeof(AO_t), (size_t)sz) != 0)
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| size_t * {aka long unsigned int *}
In file included from atomic_ops_malloc.c:99:
/usr/include/sys/mman.h:169:19: note: expected 'caddr_t' {aka 'char *'} but argument is of type 'size_t *' {aka 'long unsigned int *'}
169 | extern int munmap(caddr_t, size_t);
| ^~~~~~~
The testsuite fails badly and I suspect some issue within a script somewhere :
make[4]: Entering directory '/opt/bw/build/libatomic_ops-7.8.2_SunOS_5.10_SPARC64.001/tests'
../test-driver: line 112: 9390 Killed "$@" >> "$log_file" 2>&1
FAIL: test_atomic
../test-driver: line 112: 9408 Killed "$@" >> "$log_file" 2>&1
FAIL: test_atomic_generalized
../test-driver: line 112: 9426 Killed "$@" >> "$log_file" 2>&1
FAIL: test_atomic_pthreads
../test-driver: line 112: 9444 Killed "$@" >> "$log_file" 2>&1
FAIL: test_malloc
../test-driver: line 112: 9462 Killed "$@" >> "$log_file" 2>&1
FAIL: test_stack
============================================================================
Testsuite summary for libatomic_ops 7.8.2
============================================================================
# TOTAL: 5
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 5
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to https://github.com/ivmai/libatomic_ops/issues
============================================================================
Looking into the test-driver script it seems I can run these tests manually :
print_usage ()
{
cat <<END
Usage:
test-driver --test-name NAME --log-file PATH --trs-file PATH
[--expect-failure {yes|no}] [--color-tests {yes|no}]
[--enable-hard-errors {yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
See the GNU Automake documentation for information.
END
}
Looking at README_details.txt causes me to wonder if this software makes sense
on something running on Fujitsu SPARC64 processors.
A quick run of test_atomic seems to suggest this platform is not at all appropriate
for this code :
hubble $ ./test_atomic
Missing: AO_short_fetch_and_add
Missing: AO_short_fetch_and_add1
Missing: AO_short_fetch_and_sub1
Missing: AO_char_fetch_and_add
Missing: AO_char_fetch_and_add1
Missing: AO_char_fetch_and_sub1
Missing: AO_int_fetch_and_add
Missing: AO_int_fetch_and_add1
Missing: AO_int_fetch_and_sub1
Missing: AO_short_compare_and_swap
Missing: AO_short_or
Missing: AO_short_xor
Missing: AO_short_and
Missing: AO_short_fetch_compare_and_swap
Missing: AO_char_compare_and_swap
Missing: AO_char_or
Missing: AO_char_xor
Missing: AO_char_and
Missing: AO_char_fetch_compare_and_swap
Missing: AO_int_compare_and_swap
Missing: AO_int_or
Missing: AO_int_xor
Missing: AO_int_and
Missing: AO_int_fetch_compare_and_swap
Missing: AO_double_load
Missing: AO_double_store
Missing: AO_compare_double_and_swap_double
Missing: AO_compare_and_swap_double
Missing: AO_double_compare_and_swap
Missing: AO_short_fetch_and_add_acquire
Missing: AO_short_fetch_and_add1_acquire
Missing: AO_short_fetch_and_sub1_acquire
Missing: AO_char_fetch_and_add_acquire
Missing: AO_char_fetch_and_add1_acquire
Missing: AO_char_fetch_and_sub1_acquire
Missing: AO_int_fetch_and_add_acquire
Missing: AO_int_fetch_and_add1_acquire
Missing: AO_int_fetch_and_sub1_acquire
Missing: AO_short_compare_and_swap_acquire
Missing: AO_short_or_acquire
Missing: AO_short_xor_acquire
Missing: AO_short_and_acquire
Missing: AO_short_fetch_compare_and_swap_acquire
Missing: AO_char_compare_and_swap_acquire
Missing: AO_char_or_acquire
Missing: AO_char_xor_acquire
Missing: AO_char_and_acquire
Missing: AO_char_fetch_compare_and_swap_acquire
Missing: AO_int_compare_and_swap_acquire
Missing: AO_int_or_acquire
Missing: AO_int_xor_acquire
Missing: AO_int_and_acquire
Missing: AO_int_fetch_compare_and_swap_acquire
Missing: AO_double_load_acquire
Missing: AO_double_store_acquire
Missing: AO_compare_double_and_swap_double_acquire
Missing: AO_compare_and_swap_double_acquire
Missing: AO_double_compare_and_swap_acquire
Missing: AO_short_fetch_and_add_release
Missing: AO_short_fetch_and_add1_release
Missing: AO_short_fetch_and_sub1_release
Missing: AO_char_fetch_and_add_release
Missing: AO_char_fetch_and_add1_release
Missing: AO_char_fetch_and_sub1_release
Missing: AO_int_fetch_and_add_release
Missing: AO_int_fetch_and_add1_release
Missing: AO_int_fetch_and_sub1_release
Missing: AO_short_compare_and_swap_release
Missing: AO_short_or_release
Missing: AO_short_xor_release
Missing: AO_short_and_release
Missing: AO_short_fetch_compare_and_swap_release
Missing: AO_char_compare_and_swap_release
Missing: AO_char_or_release
Missing: AO_char_xor_release
Missing: AO_char_and_release
Missing: AO_char_fetch_compare_and_swap_release
Missing: AO_int_compare_and_swap_release
Missing: AO_int_or_release
Missing: AO_int_xor_release
Missing: AO_int_and_release
Missing: AO_int_fetch_compare_and_swap_release
Missing: AO_double_load_release
Missing: AO_double_store_release
Missing: AO_compare_double_and_swap_double_release
Missing: AO_compare_and_swap_double_release
Missing: AO_double_compare_and_swap_release
Missing: AO_short_fetch_and_add_read
Missing: AO_short_fetch_and_add1_read
Missing: AO_short_fetch_and_sub1_read
Missing: AO_char_fetch_and_add_read
Missing: AO_char_fetch_and_add1_read
Missing: AO_char_fetch_and_sub1_read
Missing: AO_int_fetch_and_add_read
Missing: AO_int_fetch_and_add1_read
Missing: AO_int_fetch_and_sub1_read
Missing: AO_short_compare_and_swap_read
Missing: AO_short_or_read
Missing: AO_short_xor_read
Missing: AO_short_and_read
Missing: AO_short_fetch_compare_and_swap_read
Missing: AO_char_compare_and_swap_read
Missing: AO_char_or_read
Missing: AO_char_xor_read
Missing: AO_char_and_read
Missing: AO_char_fetch_compare_and_swap_read
Missing: AO_int_compare_and_swap_read
Missing: AO_int_or_read
Missing: AO_int_xor_read
Missing: AO_int_and_read
Missing: AO_int_fetch_compare_and_swap_read
Missing: AO_double_load_read
Missing: AO_double_store_read
Missing: AO_compare_double_and_swap_double_read
Missing: AO_compare_and_swap_double_read
Missing: AO_double_compare_and_swap_read
Missing: AO_short_fetch_and_add_write
Missing: AO_short_fetch_and_add1_write
Missing: AO_short_fetch_and_sub1_write
Missing: AO_char_fetch_and_add_write
Missing: AO_char_fetch_and_add1_write
Missing: AO_char_fetch_and_sub1_write
Missing: AO_int_fetch_and_add_write
Missing: AO_int_fetch_and_add1_write
Missing: AO_int_fetch_and_sub1_write
Missing: AO_short_compare_and_swap_write
Missing: AO_short_or_write
Missing: AO_short_xor_write
Missing: AO_short_and_write
Missing: AO_short_fetch_compare_and_swap_write
Missing: AO_char_compare_and_swap_write
Missing: AO_char_or_write
Missing: AO_char_xor_write
Missing: AO_char_and_write
Missing: AO_char_fetch_compare_and_swap_write
Missing: AO_int_compare_and_swap_write
Missing: AO_int_or_write
Missing: AO_int_xor_write
Missing: AO_int_and_write
Missing: AO_int_fetch_compare_and_swap_write
Missing: AO_double_load_write
Missing: AO_double_store_write
Missing: AO_compare_double_and_swap_double_write
Missing: AO_compare_and_swap_double_write
Missing: AO_double_compare_and_swap_write
Missing: AO_short_fetch_and_add_full
Missing: AO_short_fetch_and_add1_full
Missing: AO_short_fetch_and_sub1_full
Missing: AO_char_fetch_and_add_full
Missing: AO_char_fetch_and_add1_full
Missing: AO_char_fetch_and_sub1_full
Missing: AO_int_fetch_and_add_full
Missing: AO_int_fetch_and_add1_full
Missing: AO_int_fetch_and_sub1_full
Missing: AO_short_compare_and_swap_full
Missing: AO_short_or_full
Missing: AO_short_xor_full
Missing: AO_short_and_full
Missing: AO_short_fetch_compare_and_swap_full
Missing: AO_char_compare_and_swap_full
Missing: AO_char_or_full
Missing: AO_char_xor_full
Missing: AO_char_and_full
Missing: AO_char_fetch_compare_and_swap_full
Missing: AO_int_compare_and_swap_full
Missing: AO_int_or_full
Missing: AO_int_xor_full
Missing: AO_int_and_full
Missing: AO_int_fetch_compare_and_swap_full
Missing: AO_double_load_full
Missing: AO_double_store_full
Missing: AO_compare_double_and_swap_double_full
Missing: AO_compare_and_swap_double_full
Missing: AO_double_compare_and_swap_full
Missing: AO_short_fetch_and_add_release_write
Missing: AO_short_fetch_and_add1_release_write
Missing: AO_short_fetch_and_sub1_release_write
Missing: AO_char_fetch_and_add_release_write
Missing: AO_char_fetch_and_add1_release_write
Missing: AO_char_fetch_and_sub1_release_write
Missing: AO_int_fetch_and_add_release_write
Missing: AO_int_fetch_and_add1_release_write
Missing: AO_int_fetch_and_sub1_release_write
Missing: AO_short_compare_and_swap_release_write
Missing: AO_short_or_release_write
Missing: AO_short_xor_release_write
Missing: AO_short_and_release_write
Missing: AO_short_fetch_compare_and_swap_release_write
Missing: AO_char_compare_and_swap_release_write
Missing: AO_char_or_release_write
Missing: AO_char_xor_release_write
Missing: AO_char_and_release_write
Missing: AO_char_fetch_compare_and_swap_release_write
Missing: AO_int_compare_and_swap_release_write
Missing: AO_int_or_release_write
Missing: AO_int_xor_release_write
Missing: AO_int_and_release_write
Missing: AO_int_fetch_compare_and_swap_release_write
Missing: AO_double_load_release_write
Missing: AO_double_store_release_write
Missing: AO_compare_double_and_swap_double_release_write
Missing: AO_compare_and_swap_double_release_write
Missing: AO_double_compare_and_swap_release_write
Missing: AO_short_fetch_and_add_acquire_read
Missing: AO_short_fetch_and_add1_acquire_read
Missing: AO_short_fetch_and_sub1_acquire_read
Missing: AO_char_fetch_and_add_acquire_read
Missing: AO_char_fetch_and_add1_acquire_read
Missing: AO_char_fetch_and_sub1_acquire_read
Missing: AO_int_fetch_and_add_acquire_read
Missing: AO_int_fetch_and_add1_acquire_read
Missing: AO_int_fetch_and_sub1_acquire_read
Missing: AO_short_compare_and_swap_acquire_read
Missing: AO_short_or_acquire_read
Missing: AO_short_xor_acquire_read
Missing: AO_short_and_acquire_read
Missing: AO_short_fetch_compare_and_swap_acquire_read
Missing: AO_char_compare_and_swap_acquire_read
Missing: AO_char_or_acquire_read
Missing: AO_char_xor_acquire_read
Missing: AO_char_and_acquire_read
Missing: AO_char_fetch_compare_and_swap_acquire_read
Missing: AO_int_compare_and_swap_acquire_read
Missing: AO_int_or_acquire_read
Missing: AO_int_xor_acquire_read
Missing: AO_int_and_acquire_read
Missing: AO_int_fetch_compare_and_swap_acquire_read
Missing: AO_double_load_acquire_read
Missing: AO_double_store_acquire_read
Missing: AO_compare_double_and_swap_double_acquire_read
Missing: AO_compare_and_swap_double_acquire_read
Missing: AO_double_compare_and_swap_acquire_read
Missing: AO_short_fetch_and_add_dd_acquire_read
Missing: AO_short_fetch_and_add1_dd_acquire_read
Missing: AO_short_fetch_and_sub1_dd_acquire_read
Missing: AO_char_fetch_and_add_dd_acquire_read
Missing: AO_char_fetch_and_add1_dd_acquire_read
Missing: AO_char_fetch_and_sub1_dd_acquire_read
Missing: AO_int_fetch_and_add_dd_acquire_read
Missing: AO_int_fetch_and_add1_dd_acquire_read
Missing: AO_int_fetch_and_sub1_dd_acquire_read
Missing: AO_short_compare_and_swap_dd_acquire_read
Missing: AO_short_or_dd_acquire_read
Missing: AO_short_xor_dd_acquire_read
Missing: AO_short_and_dd_acquire_read
Missing: AO_short_fetch_compare_and_swap_dd_acquire_read
Missing: AO_char_compare_and_swap_dd_acquire_read
Missing: AO_char_or_dd_acquire_read
Missing: AO_char_xor_dd_acquire_read
Missing: AO_char_and_dd_acquire_read
Missing: AO_char_fetch_compare_and_swap_dd_acquire_read
Missing: AO_int_compare_and_swap_dd_acquire_read
Missing: AO_int_or_dd_acquire_read
Missing: AO_int_xor_dd_acquire_read
Missing: AO_int_and_dd_acquire_read
Missing: AO_int_fetch_compare_and_swap_dd_acquire_read
Missing: AO_double_load_dd_acquire_read
Missing: AO_double_store_dd_acquire_read
Missing: AO_compare_double_and_swap_double_dd_acquire_read
Missing: AO_compare_and_swap_double_dd_acquire_read
Missing: AO_double_compare_and_swap_dd_acquire_read
Testing add1/sub1
Succeeded
Testing store_release_write/load_acquire_read
Succeeded
Testing test_and_set
Succeeded
hubble $
A quick run of test_atomic seems to suggest this platform is not at all appropriate for this code : $ ./test_atomic Missing: AO_short_fetch_and_add ...
All test passed formally. It is OK if some primitives are missing. But, this means there is a room for improvement. Patches are welcomed!
Is the same reproduced on master?
atomic_ops_malloc.c: In function 'AO_free_large': atomic_ops_malloc.c:207:24: warning: passing argument 1 of 'munmap' from incompatible pointer type [-Wincompatible-pointer-types]
Okay, could you please make a PR (to master)? I think it could be fixed like this:
p = (AO_uintptr_t *)p - ALIGNMENT / sizeof(AO_uintptr_t);
if (munmap(p, sz) ...
The testsuite fails badly and I suspect some issue within a script somewhere : make[4]: Entering directory '/opt/bw/build/libatomic_ops-7.8.2_SunOS_5.10_SPARC64.001/tests' ../test-driver: line 112: 9390 Killed "$@" >> "$log_file" 2>&1 FAIL: test_atomic ... Looking into the test-driver script it seems I can run these tests manually
It looks like an issue in test-driver (or in other autoconf/automake parts) - could you please figure the root cause and "whom to blame"? If a workaround in libatomic_ops is possible, I'm ready to review the PR.
The testsuite fails badly and I suspect some issue within a script somewhere : make[4]: Entering directory '/opt/bw/build/libatomic_ops-7.8.2_SunOS_5.10_SPARC64.001/tests' ../test-driver: line 112: 9390 Killed "$@" >> "$log_file" 2>&1 FAIL: test_atomic ... Looking into the test-driver script it seems I can run these tests manually
It looks like an issue in test-driver (or in other autoconf/automake parts) - could you please figure the root cause and "whom to blame"? If a workaround in libatomic_ops is possible, I'm ready to review the PR.
I am not interested in fixing this. Suffice it to say the platform is mostly dead and I do not expect code to "just work" there anymore.
Okay, I will check it on a Solaris 11 Sparc64 host some time later.
atomic_ops_malloc.c: In function 'AO_free_large': atomic_ops_malloc.c:207:24: warning: passing argument 1 of 'munmap' from incompatible pointer type [-Wincompatible-pointer-types]
I think it could be fixed like this:
p = (AO_uintptr_t *)p - ALIGNMENT / sizeof(AO_uintptr_t); if (munmap(p, sz) ...
Fixed in commit https://github.com/bdwgc/libatomic_ops/pull/71/commits/f11c73f414552f3120aa2dded95533bdc54ac3ac