Stubbing out the whole file means it has no targets, so recursive makes
fail with "don't know how to make X". We could fix that, but because the
level above is adding it to TESTS_SUBDIRS it'll generate an include line
for the subdirectory in its Kyuafile, which won't work (the problem that
was previously seen on non-aarch64 in CI). Thus we really need to not
even add it to TESTS_SUBDIRS in the first place.
Reported by: Dan Mack <mack@macktronics.com>
Fixes: 28f66935d4 ("tests: Disable sys/compat32 and sys/compat32/aarch64 tests")
test-runner.py orchestrates all of the ZTS executions. The `Cmd` object
manages these process, and its `run` method specifically invokes these
possibly long-running processes, possibly retrying in the event of a
timeout. Since its inception, memory leak detection using the kmemleak
infrastructure [1], and kernel logging [2] have been added to this run
mechanism.
However, the callback to cull a process beyond its timeout threshold,
`kill_cmd`, has evaded modernization by both of these changes. As a
result, this function fails to properly invoke `run`, leading to an
untrapped exception and unreported test failure.
This patch extends `kill_cmd` to receive these kernel devices through
the `options` parameter, and regularizes all the `.run` calls from
`Cmd`, and its subclasses, to accept that parameter.
[1] Commit a69765ea5b
[2] Commit fc2c0256c5
Reviewed-by: John Wren Kennedy <john.kennedy@delphix.com>
Signed-off-by: Antonio Russo <aerusso@aerusso.net>
Closes#14849
The former has build system issues, with missing Kyuafiles, presumably
due to not using TESTS_SUBDIRS and bsd.test.mk (and possibly some issues
on top of that around TESTSDIR and related variables). The latter has
issues with GCC and cut-down LLVM builds.
Requested by: kevans
Fixes: ccb59683b9 ("arm64: add tests for swp/swpb emulation")
While *most* projects need only DEP_MACHINE for host, there is always
an exception. So we allow for TARGET_SPEC_VARS.host to be a subset of
TARGET_SPEC_VARS. The default will *just work* for most projects.
We set DEP_TARGET_SPEC_VARS and hence DEP_TARGET_SPEC based on
DEP_MACHINE. Allow for M_dep_qual_fixes.host to be different too and
take care to apply the right set.
The cylinder group header structure ended with `u_int8_t cg_space[1]'
representing the beginning of the inode bitmap array. Some architectures
like the i386 rounded this up to a 4-byte boundry while other
architectures like the amd64 rounded it up to an 8-byte boundry.
Thus sizeof(struct cg) was four bytes bigger on an amd64 machine
than on an i386 machine. If a filesystem created on an i386 machine
was moved to an amd64 machine, the size of the cylinder group
calculated by the CGSIZE macro would appear to grow by four bytes.
Filesystems whose cylinder groups were exactly equal to the block
size on an i386 machine would appear to have a cylinder group that
was four bytes too big when moved to an amd64 machine. Note that
although the structure appears to be too big, it in fact is fine.
It is just the calaculation of its size that is in error.
The fix is to remove the cg_space element from the cylinder-group
structure so that the calculated size of the structure is the same
size on all architectures.
Reported by: Tijl Coosemans
Tested by: Tijl Coosemans and Peter Holm
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
8eae2d214c caused Coverity to begin
complaining about "Improper use of negative value" in two places in
spa_sync_props() because Coverity correctly inferred from `prop ==
ZPOOL_PROP_INVAL` that prop could be -1 while both zpool_prop_to_name()
and zpool_prop_get_type() use it an array index, which is undefined
behavior.
Assuming that the system does not panic from an attempt to read invalid
memory, the case statement for ZPOOL_PROP_INVAL will ensure that only
user properties will reach this code when prop is ZPOOL_PROP_INVAL, such
that execution will continue safely. However, if we are unlucky enough
to read invalid memory, then the system will panic.
This issue predates the patch that caused coverity to begin complaining.
Thankfully, our userland tools do not pass nonsense to us, so this bug
should not be triggered unless a future userland tool attempts to set a
property that we do not understand.
Reported-by: Coverity (CID-1561129)
Reported-by: Coverity (CID-1561130)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes#14860
6839ec6f10 placed code in
spa_remove_healed_errors() that uses a pointer after the kmem_free()
call that frees it.
Reported-by: Coverity (CID-1562375)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes#14860
!a != !b -> a != b; this part was lifted from NetBSD, and I clearly did
not reconsider that these are bools (I'm guessing they were ints in an
earlier iteration of the NetBSD implementation).
while we're here, it should be easy to see that we've covered all of the
cases but let's add in an __assert_unreachable() to make it easier on
the eyes.
Reported by: jrtc27
One test is suitable to be hooked up to the build, so I've done this
here. The other test lives in tools/regression because failure is a
bit more subjective -- generally, one runs it for some unbounded amount
of time and observe if it eventually exits because two threads acquired
the same mutex.
Reviewed by: imp, mmel
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39668
Add another undefined instruction handler for compat32 and watch out for
SWP/SWPB instructions.
SWP/SWPB were deprecated in ARMv6 and declared obsolete in ARMv7, but
this implementation is motivated by some proprietary software that still
uses SWP/SWPB. Because it's deprecated, emulation is pushed back behind
a sysctl that defaults to OFF in GENERIC so that it doesn't potentially
adversely affect package builds; it's unknown whether software may test
for a functional swp/swpb instruction with the desire of using it later,
so we err on the side of caution to ensure we don't end up with swp/swpb
use in freebsd/arm packages (which are built on aarch64).
The EMUL_SWP config option may be used to enable emulation by default in
environments where emulation is desired and won't really be turned off.
Reviewed by: andrew, mmel (both earlier version)
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39667
This change is a prerequisite for netlink conversion.
No functional changes intended.
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40033
MFC after: 2 weeks
It is primarily used for adding scopeid to the IPv6 link-local
sockaddrs. Having proper sockaddrs after parsing minimises the
possibility of human mistake when using the parsing.
MFC after: 2 weeks
Instead of reyling on locale-sensitive output which can be mangled when e-mailed
use consistently ISO 8601 format which contains the same information as '-T'.
PR: 271240
MFC After: 3 days
tools/tools/epfe/epfe.pl was a perl script that formerly generated some
printing example files from content in a very old version of the handbook.
Reported by: wblock
To avoid clobbering of any registers by the trampoline code use Linux
way to call signal handlers. I.e., we are out from the kernel right into
the signal handler, put return address from the signal handler into the
link register.
The mysterious NOP is required for some unwinders (e.g. libc++) that
unconditionally subtract one from the result of _Unwind_GetIP() in order
to identify the calling function.
MFC after: 1 week
To allow unwinders to go througth a previous to sigreturn frame we should
properly emulate the trampoline frame record which should points to the
previous frame and set the trampoline frame pointer to the emulated frame
before calling signal handler.
MFC after: 1 week
An Aarch64 sigreturn trampoline frame can't currently be described in
a DWARF .eh_frame section, because Aarch64 does not define a register
number for PC and provide no direct way to encode PC of the previous
frame. Instead, unwinders (libgcc, gdb, libunwind) detect the sigreturn
frame by looking for the sigreturn instruction. If a sigreturn frame is
detected, unwinders restores all the gprs, SP and PC by assuming that
sp points to an rt_sigframe Linux kernel struct
When entering the kernel, the link register (lr) contains the return
address of the previous frame, the exception link register (elr) contains
the address of the next instruction after the one which generated the
exception, i.e., PC.
MFC after: 1 week
Add more comments to explain what and why.
Ensure OBJROOT ends in / or - (/ preferred).
Export OBJTOP if level > 0
this avoids the issue with bmake/unit-tests.
Check if we have to override MAKEOBJDIR
and if so, put it into env correctly.
Fixes: df9974197e ("Add description of WITH_META_ERROR_TARGET")
Fixes: 2b519b1707 ("Update description of WITH_DIRDEPS_BUILD")
Fixes: 722cfce5f4 ("Fix typo and use .Fx in WITH_DIRDEPS_BUILD")
Sponsored by: The FreeBSD Foundation
Relevant/interesting changes:
o parse.c: don't print null filename in stack traces
o for.c: skip syntactically wrong .for loops
o var.c: allow for :gmtime=${mtime}
add :mtime[=timestamp] where timestamp is used if stat(2)
fails, if :mtime=error stat(2) failure causes error.
o make.1: fix documentation of .PREFIX to match reality and POSIX
o unit-tests: improved var-scope-local
Rather than define the TARGETS and TARGET_ARCHES in src/Makefile
put them in sys.machine.mk so they can also be leveraged by
non-top-level builds.
We have TARGET_MACHINE_LIST as the list of MACHINES we build for.
For each MACHINE we have a MACHINE_ARCH_LIST_${MACHINE}
and the first entry of each list is used as default for
MACHINE_ARCH_${MACHINE}
We can now remove a bunch of MACHINE_ARCH.* handling from
local.sys.dirdeps*mk
Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D40083
UEFI device path may be path to one device, or concatenated list of instances
to different devices (textually represented as comma separated list).
Provide generic function to get next instance from device path.
Returns next instance or end node.
The use case is like:
EFI_DEVICE_PATH *node = (EFI_DEVICE_PATH *)buf;
while (!IsDevicePathEnd(node)) {
process(node);
node = efi_devpath_next_instance(node);
}
Where buf is pointing to either single device path or
concatenated list of device paths (such as from ConIn or ConOut).
Reviewers: imp
Differential Revision: https://reviews.freebsd.org/D40081
Summary:
The intention of the original author (I assume) was to add this logic
for testing. This removes the debug statement so it no longer shows up
in calls to `status`.
MFC after: 2 weeks
MFC with: 0661f9389
Reviewers: kevans
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D40055
Commit e32fecd0c2 intended to skip installing all but one copy of
each loader variant's help file, but accidentally skipped all copies for
the userboot help file. (Other loaders install help files via the _simp
variant, but there is is no userboot_simp.)
PR: 271178
Fixes: e32fecd0c2 ("loader: install help files only once")
Sponsored by: The FreeBSD Foundation
There is no sense to keep that memory allocated during the flush.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes#14855