Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Before this fix NDA_LLADDR attributes used to be printed
as inet addresses, not as mac addresses.
* rtnl_neigh.c (decode_neigh_lladdr): New function.
(ndmsg_nla_decoders): Use it for NDA_LLADDR decoding.
* NEWS: Mention this fix.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: v4.19~33 "rtnl_neigh: decode ndmsg netlink attributes"
configure.ac: do not copy CFLAGS to CFLAGS_FOR_{M32,MX32}
As result, CFLAGS is no longer passed to mpers.sh,
reintroducing the traditional behaviour changed by commit v5.4~32.
The copying behaviour in it's current form was problematic because some
of compiler options may break mpers.sh; for example, if CFLAGS includes
-flto, then mpers.sh breaks, since intermediate *.o files created by
mpers.sh do not contain any real code.
* configure.ac [$arch != aarch64]: Initialize CFLAGS_FOR_M32 and
CFLAGS_FOR_MX32 to empty strings by default.
* NEWS: Mention this fix.
Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Reported-by: Thomas Deutschmann <whissi@gentoo.org>
Resolves: https://github.com/strace/strace/issues/114
Fixes: v5.4~32 "Add support for per-mpers compiler settings"
tests: tweak restart_syscall test to workaround nanosleep changes
nanosleep function in glibc used to be implemented as a simple syscall
wrapper around __NR_nanosleep, but starting with glibc commit
glibc-2.30.9000-234-g3537ecb49c, it is implemented on top of
__clock_nanosleep function which in turn is implemented on top of
__clock_nanosleep_time64 function.
These functions do not forward the last argument written by the kernel
when the underlying syscall succeeds, breaking the expected output.
Besides that, these proxy functions pass garbage in the upper 32-bits
of tv_nsec on 32-bit architectures .
Rather than changing restart_syscall test to use __NR_nanosleep syscall
directly, relax the expected output with regards to the remaining time
written by the kernel as this not what is being tested by
restart_syscall test.
* tests/restart_syscall.c: Stop including <assert.h>.
(main): Do not use assert. Change the initial value of rem variable.
Use regexps instead of specific values of rem.tv_sec and rem.tv_nsec
in the expected output.
* NEWS: Mention this change.
Indent the C preprocessor directives to reflect their nesting
using the following script:
$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
done
tests: tweak restart_syscall test to break in a more obvious way in case of faulty libc
If libc implements nanosleep on top of clock_nanosleep, there is
a chance of struct timespec translation bugs in libc breaking this test.
Tweak the test to make this breakage more obvious.
* tests/restart_syscall.c (main): Initialize rem variable with invalid
timespec data.
tests: fix restart_syscall test on systems with emulated nanosleep
When libc emulates nanosleep on top of clock_nanosleep, the address
of the structure passed to the kernel is not the same as the address
of the structure passed to nanosleep.
* tests/restart_syscall.c (main): Update expected output.
Use an LFS version of fcntl function when available
glibc-2.28 introduced fcntl64 as an LFS version of fcntl function,
use this new function when available.
* configure.ac (AC_CHECK_FUNCS): Add fcntl64.
* largefile_wrappers.h (fcntl_fd): New macro.
* strace.c (set_cloexec_flag): Use it instead of fcntl.
* bpf_attr.h (BPF_MAP_LOOKUP_ELEM_struct): New field introduced by Linux
commit v5.1-rc1~178^2~375^2~4^2~3.
* xlat/bpf_map_lookup_elem_flags.in: New file.
* bpf.c: Include "xlat/bpf_map_lookup_elem_flags.h".
(BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM)): Decode the new field.
* tests/bpf.c (BPF_MAP_LOOKUP_ELEM_checks): Update expected outputs.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
* xlat/ipc_msg_flags.in: Provide fallback definitions for constants.
(MSG_COPY): New constant introduced by Linux kernel commit
v3.8-rc3~16^2~30.
* NEWS: Mention this.
tests: change status-unfinished-threads test to use __NR_nanosleep
Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
nanosleep function in glibc is implemented on top of clock_nanosleep,
which makes it unsuitable for this test that is based on nanosleep
syscall.
* tests/status-unfinished-threads.c: Skip the test if __NR_nanosleep
is not defined, include "kernel_old_timespec.h".
(thread, main): Change the type of ts variable to kernel_old_timespec_t,
invoke nanosleep syscall using __NR_nanosleep.
tests: change threads-execve test to use __NR_nanosleep
Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
nanosleep function in glibc is implemented on top of clock_nanosleep,
which makes it unsuitable for this test that uses both nanosleep
and clock_nanosleep syscalls for different purposes.
* tests/threads-execve.c: Skip the test if __NR_nanosleep is not defined.
Include "kernel_old_timespec.h".
(thread, main): Invoke nanosleep syscall using __NR_nanosleep.
tests: robustify umoven-illptr test against undefined __NR_nanosleep
* tests/umoven-illptr.c: Skip the test if __NR_nanosleep is not defined.
Include "kernel_old_timespec.h" instead of <time.h>, use
kernel_old_timespec_t instead of struct timespec.
Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
nanosleep function in glibc is implemented on top of clock_nanosleep,
which makes it unsuitable for the sleep helper that is expected to
invoke nanosleep syscall.
* tests/sleep.c: Skip the test if __NR_nanosleep is not defined.
Include "kernel_old_timespec.h" instead of <time.h>.
(main): Change the type of ts variable to kernel_old_timespec_t,
invoke nanosleep syscall using __NR_nanosleep.
tests: consistently check before use that sleep executable works
Add the required check to those few tests that miss it.
* tests/status-detached.test: Invoke "run_prog ../sleep 0".
* tests/strace-DD.test: Likewise.
* tests/strace-ff.test: Likewise.
tests: change restart_syscall test not to assume nanosleep syscall
Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
nanosleep function in glibc is implemented on top of clock_nanosleep,
which makes any code relying on the old behaviour fragile.
Resolve this issue by allowing other syscalls from the nanosleep family.
* tests/restart_syscall.c (NANOSLEEP_NAME_RE, NANOSLEEP_CALL_RE): New
macros.
(main): Use them to extend regular expressions to allow clock_nanosleep
and clock_nanosleep_time64 syscalls.
* tests/restart_syscall.test: Replace nanosleep with /nanosleep in the
list of matched syscalls.
tests: change nanosleep test to use __NR_nanosleep
Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
nanosleep function in glibc is implemented on top of clock_nanosleep,
which makes it unsuitable for the test of nanosleep decoder.
* tests/nanosleep.c: Skip the test if __NR_nanosleep is not defined.
Include "kernel_old_timespec.h" instead of <time.h>.
(k_nanosleep): New function.
(main): Change the type of ts variable to kernel_old_timespec_t,
use k_nanosleep to invoke nanosleep syscall using __NR_nanosleep.
This header file defines kernel_old_timespec_t type that is going to be
used to define objects passed to such system calls as nanosleep.
* tests/kernel_old_timespec.h: New file.
* tests/Makefile.am (EXTRA_DIST): Add kernel_old_timespec.h.
Starting with glibc commit glibc-2.30.9000-215-gc81aa64e81,
adjtimex function in glibc is implemented on top of clock_adjtime,
which makes it unsuitable for the test of adjtimex decoder.
* configure.ac (AC_CHECK_MEMBERS): Remove struct timex.tai.
* tests/adjtimex.c: Skip the test if __NR_adjtimex is not defined.
Include "kernel_old_timex.h".
(k_adjtimex): New function.
(main): Change the type of tx pointer to kernel_old_timex_t,
use k_adjtimex to invoke adjtimex syscall.
This header file defines kernel_old_timex_t type that is going to be
used to define objects passed to such system calls as adjtimex.
* tests/kernel_old_timex.h: New file.
* tests/Makefile.am (EXTRA_DIST): Add kernel_old_timex.h.
Starting with glibc commit glibc-2.30.9000-169-g765cdd0bff,
semop function in glibc is implemented on top of semtimedop,
which makes it unsuitable for the test of semop decoder.
Resolve this issue by creating two tests: one that checks decoding
of __NR_semop, and another that checks decoding of __NR_ipc SEMOP.
* tests/semop-common.c: New file.
* tests/Makefile.am (EXTRA_DIST): Add semop-common.c.
* tests/semop-indirect.c: New file.
* tests/semop.c: Rewrite using __NR_semop.
* tests/pure_executables.list: Add semop-indirect.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (semop): Update.
(semop-indirect): New entry.
The semop test is going to be changed soon, so create a separate
semtimedop test based on the test we have.
* tests/semtimedop.c: New file.
* tests/pure_executables.list: Add semtimedop.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (semtimedop): New entry.
* .travis.yml (matrix): Switch all gcc-8 builds except arm64 ones
to gcc-9. gcc-8 arm64 builds have to remain until gcc-9 arm64 builds
are fixed, currently they error out because of missing
gcc-9-multilib-arm-linux-gnueabihf package.
travis: switch some stack trace enabled builds from libunwind to libdw
Switch to Bionic allows to use libdw instead of libunwind.
* .travis.yml (matrix): Change STACKTRACE from libunwind to libdw
in most of Bionic-based builds.
Ideally, all builds have to be switched, but coverage build,
unfortunately, errors out by Travis CI with a build timeout,
musl-gcc x86 build fails with
"undefined reference to `__stack_chk_fail_local'" error, and gcc-8 arm64
builds error out because of missing gcc-8-multilib-arm-linux-gnueabihf
package.
* .travis.yml (dist): Change to bionic.
(matrix): Add "dist: trusty" to coverage, musl-gcc x86, and gcc-8 arm64
builds.
Travis CI now supports aarch64 builds, launched with the new "arch: arm64"
tag. These builds are running inside LXD only for the moment.
The aarch64 builds tend to be a lot slower than their x86_64 counterparts,
so several timeout values need to be increased.
Some tests occasionally take more than 10 minutes, hitting Travis CI's
timeout on output inactivity. Using "travis_wait 40" disables that
timeout; it delays the start time for the output inactivity timeout by 40
minutes, bringing it to the maximum build timeout of 50 minutes.
* .travis.yml (matrix): Add aarch64 builds and mark previous builds as
amd64.
* ci/install-dependencies.sh: Install packages for aarch64 builds.
* ci/run-build-and-tests.sh: Check mpers for aarch64.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
debian/control: add build dependencies for aarch64 mpers
* debian/control (Build-Depends): Add gcc-arm-linux-gnueabi,
libc6-dev-armel-cross, linux-libc-dev-armel-cross as additional
dependencies on arm64 in order to build proper mpers support.
configure.ac: use a separate compiler for ARM EABI on AArch64
As gcc on AArch64 doesn't support compat ABI target, we have to find
and use a separate compiler in order to get proper compat personality
support on AArch64.
* configure.ac (arch == aarch64): Try to find a compiler for ARM EABI
based on known names for it in various distributions.
As some very special architectures require a separate compiler
in order to compile binaries for additional supported personalities,
we have to introduce such support.
* Makefile.am (mpers_CPPFLAGS): Move $(strace_CPPFLAGS) ...
(mpers_sh_opts): ... here.
(mpers-m%.stamp:): Use $(mpers_CC) instead of $(CC) for compiler,
pass $(mpers_CC_FLAGS) in quotes as it might be empty or contain spaces.
($(mpers_m32_targets)): Add @CFLAGS_FOR_M32@ to mpers_CC_FLAGS, set
mpers_CPPFLAGS and mpers_CC.
($(mpers_mx32_targets)): Add @CFLAGS_FOR_MX32@ to mpers_CC_FLAGS, set
mpers_CPPFLAGS and mpers_CC.
* bootstrap (m_upper): Derive uppercase personality name.
Set CC for mpers Makefile.am, add @CFLAGS_FOR_{M32,MX32}@ to
MPERS_CC_FLAGS definition.
* configure.ac: Derive default values for
{CC,CPP,CFLAGS,CPPFLAGS}_FOR_{M32,MX32} from the respective CC, CPP,
CFLAGS, and CPPFLAGS values.
* m4/mpers.m4 (AC_DEFUN([st_MPERS])): Use
{CC,CPP,CFLAGS,CPPFLAGS}_FOR_<$1> as CC, CPP, CFLAGS, and CPPFLAGS,
respectively. Enclose MPERS_CFLAGS in quotes in mpers.sh call. Provide
information about compiler in the AC_CACHE_CHECK message.
* tests/Makefile.am (CC): New variable.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
tests: fix invalid copyright years range in a few tests
* maint/update_copyright_years.sh (process_file): When updating
copyright years, if there is existing notice and its starting year is
earlier than the year of the first commit, the former takes precedence.
* tests/filter_seccomp-flag.c: Fix copyright years range.
* tests/filter_seccomp-perf.c: Likewise.
* tests/filter_seccomp-perf.test: Likewise.
* tests/filter_seccomp.sh: Likewise.
* tests/status-none-f.c: Likewise.
* xlat/ptp_flags_options.in: Rename to ...
* xlat/ptp_extts_flags.in: ... new file, add fallback definitions
for constants.
* xlat/ptp_perout_flags.in: New file.
* ptp.c: Include "xlat/ptp_extts_flags.h" and "xlat/ptp_perout_flags.h"
instead of "xlat/ptp_flags_options.h".
(ptp_ioctl): Use ptp_extts_flags and ptp_perout_flags instead of
ptp_flags_options.
* tests/ioctl_ptp.c: Include "xlat/ptp_extts_flags.h" and
"xlat/ptp_perout_flags.h" instead of "xlat/ptp_flags_options.h".
(test_no_device): Use ptp_extts_flags and ptp_perout_flags instead of
ptp_flags_options.
* xlat/kvm_cap.in (KVM_CAP_ARM_IRQ_LINE_LAYOUT_2): New constant
introduced by Linux kernel commit v5.4-rc1~138^2~20^2.
(KVM_CAP_HYPERV_DIRECT_TLBFLUSH): New constant introduced by Linux
kernel commit v5.4-rc1~26^2~53.
* NEWS: Mention this.