Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure with test_add_ra_header on aarch64 #200

Closed
alexhaydock opened this issue Jan 6, 2023 · 12 comments · Fixed by #201
Closed

Build failure with test_add_ra_header on aarch64 #200

alexhaydock opened this issue Jan 6, 2023 · 12 comments · Fixed by #201

Comments

@alexhaydock
Copy link

Issue Overview

With the lack of release for a while (noted in #185), I'm trying to build a release of radvd which is new enough to include at least #179.

I can get this to work on x86_64, including using the latest 5482717 commit, but I'm having an issue with the test_add_ra_header test failing when I try and build it on aarch64 - specifically Alpine Linux Edge on a Raspberry Pi 4.

The following test seems to be the one that fails according to test-suite.log:

test/send.c:53:F:build:test_add_ra_header:0: Assertion '0 == memcmp(expected, sb.buffer, sb.used)' failed: 0 == 0, memcmp(expected, sb.buffer, sb.used) == -255

If anyone is interested in the APKBUILD I am using to try and build this on Alpine, along with the source package, I uploaded it here: https://github.com/alexhaydock/radvd-git

I've tried building both the latest commit, as well as the commit that merged #179, but both fail with the same error on aarch64.

Full test-suite.log output

==================================
   radvd 2.19: ./test-suite.log
==================================

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

.. contents:: :depth: 2

FAIL: check_all
===============

Running suite(s): util
 send
96%: Checks: 27, Failures: 1, Errors: 0
test/util.c:23:P:safe_buffer:test_safe_buffer:0: Passed
test/util.c:33:P:safe_buffer:test_safe_buffer_resize:0: Passed
test/util.c:45:P:safe_buffer:test_safe_buffer_append:0: Passed
test/util.c:58:P:safe_buffer:test_safe_buffer_append2:0: Passed
test/util.c:71:P:safe_buffer:test_safe_buffer_pad:0: Passed
test/util.c:83:P:safe_buffer:test_safe_buffer_list:0: Passed
test/util.c:102:P:safe_buffer:test_safe_buffer_list_to_safe_buffer:0: Passed
test/util.c:118:P:str:test_addrtostr:0: Passed
test/util.c:131:P:str:test_addrtostr_overflow:0: Passed
test/util.c:139:P:str:test_strdupf:0: Passed
test/util.c:160:P:ion:test_readn:0: Passed
test/util.c:177:P:ion:test_writen:0: Passed
test/util.c:206:P:presence:test_check_dnssl_presence:0: Passed
test/util.c:231:P:presence:test_check_rdnss_presence:0: Passed
test/util.c:257:P:misc:test_rand_between:0: Passed
test/util.c:272:P:misc:test_cfg_removal_with_sighup:0: Passed
test/send.c:17:P:update:test_decrement_lifetime:0: Passed
test/send.c:53:F:build:test_add_ra_header:0: Assertion '0 == memcmp(expected, sb.buffer, sb.used)' failed: 0 == 0, memcmp(expected, sb.buffer, sb.used) == -255
test/send.c:87:P:build:test_add_ra_options_prefix:0: Passed
test/send.c:119:P:build:test_add_ra_options_route:0: Passed
test/send.c:149:P:build:test_add_ra_options_rdnss:0: Passed
test/send.c:182:P:build:test_add_ra_options_rdnss2:0: Passed
test/send.c:221:P:build:test_add_ra_options_dnssl:0: Passed
test/send.c:245:P:build:test_add_ra_option_mtu:0: Passed
test/send.c:292:P:build:test_add_ra_option_sllao:0: Passed
test/send.c:316:P:build:test_add_ra_option_lowpanco:0: Passed
test/send.c:341:P:build:test_add_ra_option_abro:0: Passed
FAIL check_all (exit status: 1)

Alpine abuild terminal output

+ doas -u builder abuild -r
>>> radvd: Building opt/radvd 9000-r1 (using abuild 3.10.0-r0) started Fri, 06 Jan 2023 21:11:56 +0000
>>> radvd: Checking sanity of /opt/radvd-git/APKBUILD...
>>> radvd: Analyzing dependencies...
>>> radvd: Installing for build: build-base flex bison libdaemon-dev linux-headers check-dev libbsd-dev autoconf automake
WARNING: Ignoring /home/builder/packages//opt: No such file or directory
(1/19) Installing m4 (1.4.19-r2)
(2/19) Installing flex (2.6.4-r3)
(3/19) Installing bison (3.8.2-r0)
(4/19) Installing libdaemon-dev (0.14-r3)
(5/19) Installing linux-headers (6.1.0-r0)
(6/19) Installing check (0.15.2-r1)
(7/19) Installing check-dev (0.15.2-r1)
(8/19) Installing bsd-compat-headers (0.7.2-r3)
(9/19) Installing libmd (1.0.4-r0)
(10/19) Installing libmd-dev (1.0.4-r0)
(11/19) Installing libbsd (0.11.7-r0)
(12/19) Installing libbsd-dev (0.11.7-r0)
(13/19) Installing perl (5.36.0-r0)
(14/19) Installing autoconf (2.71-r2)
(15/19) Installing automake (1.16.5-r1)
(16/19) Installing .makedepends-radvd (20230106.211157)
(17/19) Installing perl-error (0.17029-r1)
(18/19) Installing perl-git (2.39.0-r0)
(19/19) Installing git-perl (2.39.0-r0)
Executing busybox-1.35.0-r29.trigger
OK: 349 MiB in 155 packages
>>> radvd: Cleaning up srcdir
>>> radvd: Cleaning up pkgdir
>>> radvd: Checking sha512sums...
radvd-git-548271773fe66dd7b636071faa196a4bc0ef256d.tar.gz: OK
radvd.initd: OK
radvd.confd: OK
>>> radvd: Unpacking /opt/radvd-git/radvd-git-548271773fe66dd7b636071faa196a4bc0ef256d.tar.gz...
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /usr/bin/autoconf --force
configure.ac:18: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.ac:18: You should run autoupdate.
./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:18: the top level
configure.ac:50: warning: The macro `AC_PROG_CC_C99' is obsolete.
configure.ac:50: You should run autoupdate.
./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
configure.ac:50: the top level
configure.ac:67: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:67: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:67: the top level
configure.ac:112: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete
./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from...
./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from...
aclocal.m4:1074: AM_PROG_LEX is expanded from...
configure.ac:112: the top level
configure.ac:162: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:162: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:162: the top level
configure.ac:177: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:177: You should run autoupdate.
./lib/autoconf/headers.m4:743: AC_HEADER_TIME is expanded from...
configure.ac:177: the top level
configure.ac:181: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:181: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:181: the top level
configure.ac:188: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:188: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:188: the top level
configure.ac:245: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:245: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:1169: AM_CONFIG_HEADER is expanded from...
configure.ac:245: the top level
configure.ac:246: warning: AC_OUTPUT should be used without arguments.
configure.ac:246: You should run autoupdate.
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:52: installing './ar-lib'
configure.ac:50: installing './compile'
configure.ac:18: installing './config.guess'
configure.ac:18: installing './config.sub'
configure.ac:19: installing './install-sh'
configure.ac:19: installing './missing'
Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'
parallel-tests: installing './test-driver'
autoreconf: Leaving directory '.'
checking build system type... aarch64-alpine-linux-musl
checking host system type... aarch64-alpine-linux-musl
checking target system type... aarch64-alpine-linux-musl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking architecture... linux
checking whether make supports the include directive... yes (GNU style)
checking for aarch64-alpine-linux-musl-gcc... 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 gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for aarch64-alpine-linux-musl-ranlib... no
checking for ranlib... ranlib
checking for aarch64-alpine-linux-musl-ar... no
checking for aarch64-alpine-linux-musl-lib... no
checking for aarch64-alpine-linux-musl-link... no
checking for ar... ar
checking the archiver (ar) interface... ar
checking for aarch64-alpine-linux-musl-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for check >= 0.9.4... yes
checking netlink... yes
checking for library containing clock_gettime... none required
checking for library containing strlcpy... none required
checking for rm... /bin/rm
checking for sed... /bin/sed
checking for ln... /bin/ln
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... no
checking whether yytext is a pointer... yes
checking for tar... /usr/bin/tar
checking for gzip... /bin/gzip
checking where to put logfile... /var/log/radvd.log
checking where to put pidfile... /run/radvd/radvd.pid
checking where to find configfile... /etc/radvd.conf
checking which syslog facility to use... LOG_DAEMON
checking for inet_ntop in -lc... yes
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/time.h... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for getopt.h... yes
checking for ifaddrs.h... yes
checking for linux/if_arp.h... yes
checking for machine/limits.h... no
checking for machine/param.h... no
checking for net/if_arp.h... yes
checking for net/if_dl.h... no
checking for net/if_types.h... no
checking for sys/param.h... yes
checking for sys/sockio.h... no
checking for sys/time.h... (cached) yes
checking for time.h... yes
checking whether struct sockaddr_in6 has sin6_scope_id... yes
checking whether struct in6_addr has u6_addrXX and defines s6_addrXX... yes
checking for getopt_long... yes
checking for ppoll... yes
checking for sysctl... no
checking for aarch64-alpine-linux-musl-pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating radvd.service
config.status: creating redhat/systemd/radvd.spec
config.status: creating redhat/SysV/radvd.spec
config.status: creating config.h
config.status: executing depfiles commands

Your build configuration:

        CPPFLAGS = -Os -fomit-frame-pointer
        CFLAGS = -Os -fomit-frame-pointer
        LDFLAGS = -Wl,--as-needed,-O1,--sort-common
        Arch = linux
        Extras: privsep-linux.o device-linux.o netlink.o
        prefix: /usr
        PID file: /run/radvd/radvd.pid
        Log file: /var/log/radvd.log
        Config file: /etc/radvd.conf
        Radvd version: 2.19

  YACC     gram.c
updating gram.h
make  all-am
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
  CC       log.o
  CC       recv.o
  CC       socket.o
  CC       util.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from recv.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from socket.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from util.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from log.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       device-common.o
  CC       interface.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-common.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from interface.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       process.o
  CC       radvd.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from process.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from radvd.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       send.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from send.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       timer.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from timer.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       privsep-linux.o
  CC       device-linux.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from privsep-linux.c:18:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-linux.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       netlink.o
  CC       gram.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from netlink.h:18,
                 from netlink.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from gram.y:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  LEX      scanner.c
  CC       radvdump.o
  GEN      radvd.8
  GEN      radvd.conf.5
  GEN      radvdump.8
  CC       scanner.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from radvdump.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from scanner.l:20:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CCLD     radvdump
  AR       libradvd-parser.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     radvd
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make: Entering directory '/opt/radvd-git/src/radvd-9000'
make  check_all
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
  CC       check_all-device-common.o
  CC       check_all-interface.o
  CC       check_all-log.o
  CC       check_all-send.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-common.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from send.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from log.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from interface.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       check_all-timer.o
  CC       check_all-util.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from timer.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from util.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       test/check_all-print_safe_buffer.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from test/../includes.h:30,
                 from test/../defaults.h:19,
                 from test/../radvd.h:19,
                 from test/print_safe_buffer.h:5,
                 from test/print_safe_buffer.c:2:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       test/check_all-check.o
  CCLD     check_all
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make  check-TESTS
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
make[2]: Entering directory '/opt/radvd-git/src/radvd-9000'
FAIL: check_all
============================================================================
Testsuite summary for radvd 2.19
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================
make[2]: *** [Makefile:1338: test-suite.log] Error 1
make[2]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make[1]: *** [Makefile:1446: check-TESTS] Error 2
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make: *** [Makefile:1661: check-am] Error 2
make: Leaving directory '/opt/radvd-git/src/radvd-9000'
>>> ERROR: radvd: check failed
@stappersg
Copy link
Member

stappersg commented Jan 6, 2023 via email

@alexhaydock
Copy link
Author

Hi @stappersg

Thanks for the reply. I'm struggling to see any comments you added so it's possible that GitHub didn't preserve them too well from the email.

There's definitely a number of warnings produced during the build process which I think(?) you've highlighted here, though the main thing I would note is that the same code (and APKBUILD) does build and test successfully on amd64 including the same warning output, so I am mostly interested in what might be different between aarch64 and amd64 that's causing the ARM build to fail during the test phase.

@robbat2
Copy link
Member

robbat2 commented Jan 8, 2023

Can you do this on your Alpine AArch64 env? I wonder if we've got a subtle host byte ordering bug that crept in.

$ ./configure --with-check ; make clean all ; make check_all CFLAGS="-DPRINT_SAFE_BUFFER=1" ; ./check_all  |grep test_add_ra_header -A20
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
...
test/send.c:46:F:build:test_add_ra_header:0: 
unsigned char expected[] = 
        0x86 0x00 0x00 0x00 0x40 0x00 0x00 0x00
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
};

test/send.c:75:F:build:test_add_ra_options_prefix:0: 
unsigned char expected[] = 
        0x03 0x04 0x40 0xe0 0xff 0xff 0xff 0xff
        0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00
        0xfe 0x80 0x00 0x01 0x00 0x00 0x00 0x00
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        0x03 0x04 0x30 0x80 0x00 0x00 0x27 0x10
        0x00 0x00 0x03 0xe8 0x00 0x00 0x00 0x00
        0xfe 0x80 0x00 0x02 0x00 0x00 0x00 0x00
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        0x03 0x04 0x40 0xc0 0x00 0x01 0x51 0x80
        0x00 0x00 0x38 0x40 0x00 0x00 0x00 0x00
        0xfe 0x80 0x00 0x02 0x00 0x00 0x00 0x00
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
};

@robbat2
Copy link
Member

robbat2 commented Jan 8, 2023

As for the cdefs warning, that's clearly something musl-specific. I can't reproduce on glibc and I don't have a musl env handy right now to compare.

@robbat2
Copy link
Member

robbat2 commented Jan 8, 2023

Ah, FUN. radvd itself doesn't include cdefs.h, but libbsd does. So we're getting a warning because somebody else hasn't fixed their code for musl. We can't fix it in radvd.

@alexhaydock
Copy link
Author

Can you do this on your Alpine AArch64 env? I wonder if we've got a subtle host byte ordering bug that crept in.

Thanks for looking into this!

Full output from that command below:

$ ./configure --with-check ; make clean all ; make check_all CFLAGS="-DPRINT_SAFE_BUFFER=1" ; ./check_all  |grep test_add_ra_header -A20
checking build system type... aarch64-unknown-linux-musl
checking host system type... aarch64-unknown-linux-musl
checking target system type... aarch64-unknown-linux-musl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking architecture... linux
checking whether make supports the include directive... yes (GNU style)
checking for gcc... 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 gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for ar... ar
checking the archiver (ar) interface... ar
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for check >= 0.9.4... yes
checking netlink... yes
checking for library containing clock_gettime... none required
checking for library containing strlcpy... none required
checking for rm... /bin/rm
checking for sed... /bin/sed
checking for ln... /bin/ln
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... no
checking whether yytext is a pointer... yes
checking for tar... /usr/bin/tar
checking for gzip... /bin/gzip
checking where to put logfile... /var/log/radvd.log
checking where to put pidfile... /var/run/radvd.pid
checking where to find configfile... /etc/radvd.conf
checking which syslog facility to use... LOG_DAEMON
checking for inet_ntop in -lc... yes
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/time.h... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for getopt.h... yes
checking for ifaddrs.h... yes
checking for linux/if_arp.h... yes
checking for machine/limits.h... no
checking for machine/param.h... no
checking for net/if_arp.h... yes
checking for net/if_dl.h... no
checking for net/if_types.h... no
checking for sys/param.h... yes
checking for sys/sockio.h... no
checking for sys/time.h... (cached) yes
checking for time.h... yes
checking whether struct sockaddr_in6 has sin6_scope_id... yes
checking whether struct in6_addr has u6_addrXX and defines s6_addrXX... yes
checking for getopt_long... yes
checking for ppoll... yes
checking for sysctl... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating radvd.service
config.status: creating redhat/systemd/radvd.spec
config.status: creating redhat/SysV/radvd.spec
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

Your build configuration:

        CPPFLAGS =
        CFLAGS = -g -O2
        LDFLAGS =
        Arch = linux
        Extras: privsep-linux.o device-linux.o netlink.o
        prefix: /usr/local
        PID file: /var/run/radvd.pid
        Log file: /var/log/radvd.log
        Config file: /etc/radvd.conf
        Radvd version: 2.19

test -z "check_all" || rm -f check_all
test -z "radvd.8 radvd.conf.5 radvdump.8 gram.c gram.h gram.dot scanner.c scanner.h gram.dot" || rm -f radvd.8 radvd.conf.5 radvdump.8 gram.c gram.h gram.dot scanner.c scanner.h gram.dot
test -z "libradvd-parser.a" || rm -f libradvd-parser.a
test -z "radvd radvdump" || rm -f radvd radvdump
rm -f *.o
rm -f test/*.o
test -z "check_all.log" || rm -f check_all.log
test -z "check_all.trs" || rm -f check_all.trs
test -z "test-suite.log" || rm -f test-suite.log
make  all-am
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
  CC       log.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from log.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       recv.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from recv.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       socket.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from socket.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       util.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from util.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       device-common.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-common.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       interface.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from interface.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       process.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from process.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       radvd.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from radvd.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       send.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from send.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       timer.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from timer.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       privsep-linux.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from privsep-linux.c:18:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       device-linux.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-linux.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       netlink.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from netlink.h:18,
                 from netlink.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  YACC     gram.c
updating gram.h
  CC       gram.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from gram.y:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  LEX      scanner.c
  CC       scanner.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from scanner.l:20:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  AR       libradvd-parser.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     radvd
  CC       radvdump.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from radvdump.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CCLD     radvdump
  GEN      radvd.8
  GEN      radvd.conf.5
  GEN      radvdump.8
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
  CC       test/check_all-print_safe_buffer.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from test/../includes.h:30,
                 from test/../defaults.h:19,
                 from test/../radvd.h:19,
                 from test/print_safe_buffer.h:5,
                 from test/print_safe_buffer.c:2:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       test/check_all-check.o
  CC       check_all-device-common.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-common.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       check_all-interface.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from interface.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       check_all-log.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from log.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       check_all-send.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from send.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from test/send.c:3,
                 from send.c:72:
test/send.c: In function 'test_add_ra_header_fn':
test/send.c:46:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
   46 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:46:30: note: format string is defined here
   46 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_options_prefix_fn':
test/send.c:75:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
   75 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:75:30: note: format string is defined here
   75 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_options_route_fn':
test/send.c:109:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  109 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:109:30: note: format string is defined here
  109 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_options_rdnss_fn':
test/send.c:140:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  140 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:140:30: note: format string is defined here
  140 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_options_rdnss2_fn':
test/send.c:174:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  174 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:174:30: note: format string is defined here
  174 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_options_dnssl_fn':
test/send.c:204:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  204 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:204:30: note: format string is defined here
  204 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_option_mtu_fn':
test/send.c:238:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  238 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:238:30: note: format string is defined here
  238 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_option_sllao_fn':
test/send.c:264:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  264 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:264:30: note: format string is defined here
  264 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c:285:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  285 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:285:30: note: format string is defined here
  285 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_option_lowpanco_fn':
test/send.c:309:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  309 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:309:30: note: format string is defined here
  309 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
test/send.c: In function 'test_add_ra_option_abro_fn':
test/send.c:333:26: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[4096]' [-Wformat=]
  333 |         ck_assert_msg(0, "\n%s", &buf);
      |                          ^~~~~~  ~~~~
      |                                  |
      |                                  char (*)[4096]
test/send.c:333:30: note: format string is defined here
  333 |         ck_assert_msg(0, "\n%s", &buf);
      |                             ~^
      |                              |
      |                              char *
  CC       check_all-timer.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from timer.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       check_all-util.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from util.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CCLD     check_all
test/send.c:46:F:build:test_add_ra_header:0:
unsigned char expected[] =
        0x86 0x00 0x00 0x00 0x40 0x00 0xff 0xff
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
};

test/send.c:75:F:build:test_add_ra_options_prefix:0:
unsigned char expected[] =
        0x03 0x04 0x40 0xe0 0xff 0xff 0xff 0xff
        0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00
        0xfe 0x80 0x00 0x01 0x00 0x00 0x00 0x00
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        0x03 0x04 0x30 0x80 0x00 0x00 0x27 0x10
        0x00 0x00 0x03 0xe8 0x00 0x00 0x00 0x00
        0xfe 0x80 0x00 0x02 0x00 0x00 0x00 0x00
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        0x03 0x04 0x40 0xc0 0x00 0x01 0x51 0x80
        0x00 0x00 0x38 0x40 0x00 0x00 0x00 0x00
        0xfe 0x80 0x00 0x02 0x00 0x00 0x00 0x00
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
};

Ah, FUN. radvd itself doesn't include cdefs.h, but libbsd does. So we're getting a warning because somebody else hasn't fixed their code for musl. We can't fix it in radvd.

That's fair. I'll see if I can report the bug upstream or at least notify the maintainer of libbsd-dev in Alpine, but I suspect I might not know enough about the issue to produce a helpful bug report, so might just have to direct them to this thread and hope.

What's interesting though is that the cdefs.h compiler warning disappears if I build the older commit that merged the code I want (#179). Building a646066 doesn't produce that warning, but building the latest 5482717 does. So it seems that although the issue might belong to libbsd upstream, something changed in radvd somewhere between those two commits to cause it to start manifesting.

@stappersg
Copy link
Member

something changed in radvd somewhere between those two commits to cause it to start manifesting.

FWIW: In #199 is a change with libbsd-dev.

@robbat2
Copy link
Member

robbat2 commented Jan 8, 2023

That's weird. The expected output is exactly what it should be. I'm wondering what else is going on.
I need to find an AArch64 env to test this in.
Can you easily compare a glibc-based run on your RPi? Maybe in a docker container. Just want to try rule out architecture vs libc implementation.

@robbat2
Copy link
Member

robbat2 commented Jan 9, 2023

Ok, I think I have a reproduction, and it's lack of isolation in testing that is causing the failure.

In your environment, does changing net.ipv6.conf.all.forwarding impact the test results? Please test with values 0/1

@alexhaydock
Copy link
Author

Ah I think you've found it here!

hostname:/opt/radvd-git$ doas sysctl -w net.ipv6.conf.all.forwarding=0
net.ipv6.conf.all.forwarding = 0

All my previous tests have been with IPv6 forwarding enabled (predictably, this host is intended for routing so I've been testing it in this build environment). Once I disabled it as above, the package builds successfully. We still get the cdefs.h warnings but I'll test whether the built package is actually usable and report back.

+ doas -u builder abuild -r
>>> radvd: Building opt/radvd 9000-r1 (using abuild 3.10.0-r0) started Mon, 09 Jan 2023 09:54:38 +0000
>>> radvd: Checking sanity of /opt/radvd-git/APKBUILD...
>>> radvd: Analyzing dependencies...
>>> radvd: Installing for build: build-base flex bison libdaemon-dev linux-headers check-dev libbsd-dev autoconf automake
WARNING: Ignoring /home/builder/packages//opt: No such file or directory
(1/1) Installing .makedepends-radvd (20230109.095439)
OK: 349 MiB in 155 packages
>>> radvd: Cleaning up srcdir
>>> radvd: Cleaning up pkgdir
>>> radvd: Checking sha512sums...
radvd-git-548271773fe66dd7b636071faa196a4bc0ef256d.tar.gz: OK
radvd.initd: OK
radvd.confd: OK
>>> radvd: Unpacking /opt/radvd-git/radvd-git-548271773fe66dd7b636071faa196a4bc0ef256d.tar.gz...
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /usr/bin/autoconf --force
configure.ac:18: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.ac:18: You should run autoupdate.
./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:18: the top level
configure.ac:50: warning: The macro `AC_PROG_CC_C99' is obsolete.
configure.ac:50: You should run autoupdate.
./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
configure.ac:50: the top level
configure.ac:67: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:67: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:67: the top level
configure.ac:112: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete
./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from...
./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from...
aclocal.m4:1074: AM_PROG_LEX is expanded from...
configure.ac:112: the top level
configure.ac:162: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:162: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:162: the top level
configure.ac:177: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:177: You should run autoupdate.
./lib/autoconf/headers.m4:743: AC_HEADER_TIME is expanded from...
configure.ac:177: the top level
configure.ac:181: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:181: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:181: the top level
configure.ac:188: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:188: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:188: the top level
configure.ac:245: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:245: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:1169: AM_CONFIG_HEADER is expanded from...
configure.ac:245: the top level
configure.ac:246: warning: AC_OUTPUT should be used without arguments.
configure.ac:246: You should run autoupdate.
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:52: installing './ar-lib'
configure.ac:50: installing './compile'
configure.ac:18: installing './config.guess'
configure.ac:18: installing './config.sub'
configure.ac:19: installing './install-sh'
configure.ac:19: installing './missing'
Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'
parallel-tests: installing './test-driver'
autoreconf: Leaving directory '.'
checking build system type... aarch64-alpine-linux-musl
checking host system type... aarch64-alpine-linux-musl
checking target system type... aarch64-alpine-linux-musl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking architecture... linux
checking whether make supports the include directive... yes (GNU style)
checking for aarch64-alpine-linux-musl-gcc... 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 gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for aarch64-alpine-linux-musl-ranlib... no
checking for ranlib... ranlib
checking for aarch64-alpine-linux-musl-ar... no
checking for aarch64-alpine-linux-musl-lib... no
checking for aarch64-alpine-linux-musl-link... no
checking for ar... ar
checking the archiver (ar) interface... ar
checking for aarch64-alpine-linux-musl-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for check >= 0.9.4... yes
checking netlink... yes
checking for library containing clock_gettime... none required
checking for library containing strlcpy... none required
checking for rm... /bin/rm
checking for sed... /bin/sed
checking for ln... /bin/ln
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... no
checking whether yytext is a pointer... yes
checking for tar... /usr/bin/tar
checking for gzip... /bin/gzip
checking where to put logfile... /var/log/radvd.log
checking where to put pidfile... /run/radvd/radvd.pid
checking where to find configfile... /etc/radvd.conf
checking which syslog facility to use... LOG_DAEMON
checking for inet_ntop in -lc... yes
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/time.h... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for getopt.h... yes
checking for ifaddrs.h... yes
checking for linux/if_arp.h... yes
checking for machine/limits.h... no
checking for machine/param.h... no
checking for net/if_arp.h... yes
checking for net/if_dl.h... no
checking for net/if_types.h... no
checking for sys/param.h... yes
checking for sys/sockio.h... no
checking for sys/time.h... (cached) yes
checking for time.h... yes
checking whether struct sockaddr_in6 has sin6_scope_id... yes
checking whether struct in6_addr has u6_addrXX and defines s6_addrXX... yes
checking for getopt_long... yes
checking for ppoll... yes
checking for sysctl... no
checking for aarch64-alpine-linux-musl-pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating radvd.service
config.status: creating redhat/systemd/radvd.spec
config.status: creating redhat/SysV/radvd.spec
config.status: creating config.h
config.status: executing depfiles commands

Your build configuration:

        CPPFLAGS = -Os -fomit-frame-pointer
        CFLAGS = -Os -fomit-frame-pointer
        LDFLAGS = -Wl,--as-needed,-O1,--sort-common
        Arch = linux
        Extras: privsep-linux.o device-linux.o netlink.o
        prefix: /usr
        PID file: /run/radvd/radvd.pid
        Log file: /var/log/radvd.log
        Config file: /etc/radvd.conf
        Radvd version: 2.19

  YACC     gram.c
updating gram.h
make  all-am
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
  CC       log.o
  CC       recv.o
  CC       socket.o
  CC       util.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from log.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from recv.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from socket.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from util.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       device-common.o
  CC       interface.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-common.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       process.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from interface.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from process.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       radvd.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from radvd.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       send.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from send.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       timer.o
  CC       privsep-linux.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from timer.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from privsep-linux.c:18:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       device-linux.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-linux.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       netlink.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from netlink.h:18,
                 from netlink.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       gram.o
  LEX      scanner.c
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from gram.y:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       radvdump.o
  GEN      radvd.8
  GEN      radvd.conf.5
  GEN      radvdump.8
  CC       scanner.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from radvdump.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from scanner.l:20:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CCLD     radvdump
  AR       libradvd-parser.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     radvd
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make: Entering directory '/opt/radvd-git/src/radvd-9000'
make  check_all
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
  CC       check_all-device-common.o
  CC       check_all-interface.o
  CC       check_all-send.o
  CC       check_all-log.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from device-common.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from interface.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from log.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from send.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       check_all-timer.o
  CC       check_all-util.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from defaults.h:19,
                 from radvd.h:19,
                 from timer.c:17:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from includes.h:30,
                 from util.c:16:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CC       test/check_all-print_safe_buffer.o
  CC       test/check_all-check.o
In file included from /usr/include/bsd/sys/cdefs.h:51,
                 from /usr/include/bsd/string.h:39,
                 from test/../includes.h:30,
                 from test/../defaults.h:19,
                 from test/../radvd.h:19,
                 from test/print_safe_buffer.h:5,
                 from test/print_safe_buffer.c:2:
/usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    1 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
  CCLD     check_all
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make  check-TESTS
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
make[2]: Entering directory '/opt/radvd-git/src/radvd-9000'
PASS: check_all
============================================================================
Testsuite summary for radvd 2.19
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[2]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
make: Leaving directory '/opt/radvd-git/src/radvd-9000'
>>> radvd: Entering fakeroot...
make[1]: Entering directory '/opt/radvd-git/src/radvd-9000'
 ./install-sh -c -d '/opt/radvd-git/pkg/radvd/usr/sbin'
  /usr/bin/install -c radvd radvdump '/opt/radvd-git/pkg/radvd/usr/sbin'
 ./install-sh -c -d '/opt/radvd-git/pkg/radvd/usr/share/man/man5'
 /usr/bin/install -c -m 644 radvd.conf.5 '/opt/radvd-git/pkg/radvd/usr/share/man/man5'
 ./install-sh -c -d '/opt/radvd-git/pkg/radvd/usr/share/man/man8'
 /usr/bin/install -c -m 644 radvd.8 radvdump.8 '/opt/radvd-git/pkg/radvd/usr/share/man/man8'
make[1]: Leaving directory '/opt/radvd-git/src/radvd-9000'
>>> radvd-doc*: Running split function doc...
>>> radvd-doc*: Preparing subpackage radvd-doc...
>>> radvd-doc*: Running postcheck for radvd-doc
>>> radvd-openrc*: Running split function openrc...
>>> radvd-openrc*: Preparing subpackage radvd-openrc...
>>> radvd-openrc*: Running postcheck for radvd-openrc
>>> radvd*: Running postcheck for radvd
>>> radvd*: Preparing package radvd...
>>> radvd*: Stripping binaries
>>> radvd*: Script found. /bin/sh added as a dependency for radvd-9000-r1.apk
>>> radvd*: Adding .pre-install
>>> radvd-doc*: Scanning shared objects
>>> radvd-openrc*: Scanning shared objects
>>> radvd*: Scanning shared objects
>>> radvd-doc*: Tracing dependencies...
>>> radvd-doc*: Package size: 24.0 KB
>>> radvd-doc*: Compressing data...
>>> radvd-doc*: Create checksum...
>>> radvd-doc*: Create radvd-doc-9000-r1.apk
>>> radvd-openrc*: Tracing dependencies...
>>> radvd-openrc*: Package size: 8.0 KB
>>> radvd-openrc*: Compressing data...
>>> radvd-openrc*: Create checksum...
>>> radvd-openrc*: Create radvd-openrc-9000-r1.apk
>>> radvd*: Tracing dependencies...
        /bin/sh
        so:libc.musl-aarch64.so.1
>>> radvd*: Package size: 200.0 KB
>>> radvd*: Compressing data...
>>> radvd*: Create checksum...
>>> radvd*: Create radvd-9000-r1.apk
>>> radvd: Build complete at Mon, 09 Jan 2023 09:55:10 +0000 elapsed time 0h 0m 32s
>>> radvd: Cleaning up srcdir
>>> radvd: Cleaning up pkgdir
>>> radvd: Uninstalling dependencies...
(1/1) Purging .makedepends-radvd (20230109.095439)
OK: 349 MiB in 154 packages
>>> radvd: Updating the opt/aarch64 repository index...
>>> radvd: Signing the index...

@alexhaydock
Copy link
Author

alexhaydock commented Jan 9, 2023

Great success! Thanks @robbat2 👍

Fully built and working on aarch64 musl Alpine with the latest 5482717 commit. I didn't actually need to change anything from the original build attempt in my first post, apart from building with the net.ipv6.conf.all.forwarding sysctl disabled.

The built package installs happily, and is working as expected to send the pref64 that I've been wanting, as I've validated on-the-wire with Wireshark:

image

@robbat2
Copy link
Member

robbat2 commented Jan 9, 2023

Yup, so false positive because the testcase didn't properly isolate itself from the system state. I'll improve the tests.

robbat2 added a commit to robbat2/radvd that referenced this issue Jan 9, 2023
The add_ra_header function had a hidden dependency on system state:
If cease_adv was not set, the outcome was dependent on the sysctl knob
"net.ipv6.conf.all.forwarding".

This was visible only during testing with
net.ipv6.conf.all.forwarding=1. If tested with
net.ipv6.conf.all.forwarding=0, the tests passed.

Hoist the sysctl dependency out of the add_ra_header function, to enable
testing of both code paths, and add the extra test to validate both
states of the cease_adv input.

Closes: radvd-project#200
Signed-off-by: Robin H. Johnson <[email protected]>
robbat2 added a commit to robbat2/radvd that referenced this issue Jan 9, 2023
The add_ra_header function had a hidden dependency on system state:
If cease_adv was not set, the outcome was dependent on the sysctl knob
"net.ipv6.conf.all.forwarding".

This was visible only during testing with
net.ipv6.conf.all.forwarding=1. If tested with
net.ipv6.conf.all.forwarding=0, the tests passed.

Hoist the sysctl dependency out of the add_ra_header function, to enable
testing of both code paths, and add the extra test to validate both
states of the cease_adv input.

Closes: radvd-project#200
Signed-off-by: Robin H. Johnson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants