| History log of /src/tests/lib/libc/sys/Makefile |
| Revision | | Date | Author | Comments |
| 1.80 |
| 10-Oct-2025 |
christos | Commit GSoC 2025 aio project by Ethan Miller: https://blog.netbsd.org/tnf/entry/gsoc2025_asynchronous_i_o_framework
|
| 1.79 |
| 09-May-2025 |
riastradh | tests/lib/libc/sys/Makefile: Fix truncate_test.root_owned output.
Announce the creation of this file with ${_MKTARGET_CREATE}, not with cryptic dd(1) output. And just use touch(1) instead of dd from /dev/null, simpler and clearer what's going on.
No functional change intended, other than to the cosmetics of build output.
|
| 1.78 |
| 09-Feb-2025 |
riastradh | t_poll: Expand tests of polling when other endpoint is closed.
This covers fifos, pipes, and sockets; reads and writes; and polling when the endpoint is already closed as well as sleeping until the endpoint is closed after a delay.
Unfortunately, there is disagreement right now between:
(a) POSIX, (b) our poll(2) man page, and (c) our implementation,
for many of these cases. And we recently changed the behaviour of poll(2) on fifos between 9 and 10 (PR kern/56429: poll(2) should yield POLLHUP when last writer to a fifo close()'s it) but didn't get it quite right.
So I've annotated these test cases with xfails for all the cases I think we're currently doing wrong -- under a justification from some combination of POSIX, our own documentation, and/or a reasonable interpretation of what the semantics _should_ be based on how read(2) and write(2) will behave. These are mostly edge cases:
1. [pollclosed_pipe_*_write*] When the read side of a pipe is closed, poll(2) on the write side currently returns POLLHUP|POLLOUT, which POSIX forbids because it requires POLLHUP to be mutually exclusive with POLLOUT. And our man page concurs with POSIX on this rule, and has for a long time (going as far back as NetBSD 1.3 or earlier, judging by https://man.NetBSD.org/NetBSD-1.3/poll.2).
=> Fixing this won't change whether anything wakes up earlier or later -- it will only change which bits are set when the wakeups happen.
2. [pollclosed_fifo*_immediate_readsome] When the write side of a fifo was previously open with the read side, and has since been closed before calling poll(2), poll(2) on the read side returns 0 instead of POLLHUP|POLLIN as it is expected to, even though read(2) will return EOF without blocking.
=> Fixing this may lead to more wakeups than before, but only in cases where read(2) would actually return immediately anyway.
3. [pollclosed_fifo*_delayed_*_read] When the write side of a fifo is closed, poll(2) on the read side returns POLLHUP|POLLIN, as it is expected to. But this state currently isn't persistent, even though the behaviour of read(2) in returning EOF without blocking is persistent.
=> Fixing this may lead to more wakeups than before, but only in cases where read(2) would actually return immediately anyway.
That said, it turns out that we are correct, according to POSIX, in not setting POLLHUP on a socket whose peer has been closed: POLLHUP is only for devices, pipes, and FIFOs. So one of the issues I reported in PR 59056 turns out to be bogus. (Also POLLHUP is only for the reader side anyway, not for the writer side.)
https://pubs.opengroup.org/onlinepubs/9799919799/functions/poll.html
PR kern/59056: poll POLLHUP bugs
|
| 1.77 |
| 17-Dec-2024 |
christos | PR/58896: Martin Husemann: Demonstrate that a PT_STOPed process could not be PT_KILLed.
|
| 1.76 |
| 07-Dec-2023 |
riastradh | branches: 1.76.2; t_setrlimit: Narrow the scope of stack-protector warning suppression.
|
| 1.75 |
| 24-Nov-2023 |
christos | t_setrlimit uses alloca now
|
| 1.74 |
| 08-Aug-2023 |
mrg | introduce new GCC 12 warning disables and use them in a few places
this introduces 4 new warning disable flags:
CC_WNO_MISSING_TEMPLATE_KEYWORD CC_WNO_REGISTER CC_WNO_STRINGOP_OVERREAD CC_WNO_ARRAY_BOUNDS
and documents them in README.warnings. of these, the string op and array bounds are both problematic (real bugs) and also spurious (not real bugs), and the other 2 are mostly temporary for older 3rd party code.
add some new uses of CC_WNO_STRINGOP_OVERFLOW.
fix m68k build for gallium and GCC 12.
|
| 1.73 |
| 03-Jun-2023 |
lukem | bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER
Provide a single variable CC_WNO_ADDRESS_OF_PACKED_MEMBER with options for both clang and gcc, to replace CLANG_NO_ADDR_OF_PACKED_MEMBER CC_NO_ADDR_OF_PACKED_MEMBER GCC_NO_ADDR_OF_PACKED_MEMBER
Using the convention CC_compilerflag, where compilerflag is based on the full compiler flag name.
|
| 1.72 |
| 01-Aug-2022 |
kre | branches: 1.72.2;
Provide _GNU_SOURCE for t_clone now that is required to make clone() visible.
|
| 1.71 |
| 06-Apr-2022 |
gson | Add a regression test for PR kern/52239, "Changing protections of already mmap'ed region can fail", based on the test program in the PR.
|
| 1.70 |
| 01-Nov-2021 |
hannken | Test lib/libc/sys/t_timerfd often fails when run on QEMU because QEMU misses clock interrupts.
Always check values against [ lower, upper ] bounds and use "4 * upper" when run under QEMU.
Now becomes part of PR kern/43997 "Kernel timer discrepancies".
|
| 1.69 |
| 19-Sep-2021 |
thorpej | Add native implementations of eventfd(2) and timerfd(2), compatible with the Linux interfaces of the same name.
|
| 1.68 |
| 06-Sep-2020 |
mrg | branches: 1.68.2; add support for new GCC 9 warnings that may be too much to fix right now. new address-of-packed-member and format-overflow warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.
apply to a bunch of the tree. mostly, these are real bugs that should be fixed, but in many cases, only by removing the 'packed' attribute from some structure that doesn't really need it. (i looked at many different ones, and while perhaps 60-80% were already properly aligned, it wasn't clear to me that the uses were always coming from sane data vs network alignment, so it doesn't seem safe to remove packed without careful research for each affect struct.) clang already warned (and was not erroring) for many of these cases, but gcc picked up dozens more.
|
| 1.67 |
| 14-Aug-2020 |
riastradh | New system call getrandom() compatible with Linux and others.
Three ways to call:
getrandom(p, n, 0) Blocks at boot until full entropy. Returns up to n bytes at p; guarantees up to 256 bytes even if interrupted after blocking. getrandom(0,0,0) serves as an entropy barrier: return only after system has full entropy.
getrandom(p, n, GRND_INSECURE) Never blocks. Guarantees up to 256 bytes even if interrupted. Equivalent to /dev/urandom. Safe only after successful getrandom(...,0), getrandom(...,GRND_RANDOM), or read from /dev/random.
getrandom(p, n, GRND_RANDOM) May block at any time. Returns up to n bytes at p, but no guarantees about how many -- may return as short as 1 byte. Equivalent to /dev/random. Legacy. Provided only for source compatibility with Linux.
Can also use flags|GRND_NONBLOCK to fail with EWOULDBLOCK/EAGAIN without producing any output instead of blocking.
- The combination GRND_INSECURE|GRND_NONBLOCK is the same as GRND_INSECURE, since GRND_INSECURE never blocks anyway.
- The combinations GRND_INSECURE|GRND_RANDOM and GRND_INSECURE|GRND_RANDOM|GRND_NONBLOCK are nonsensical and fail with EINVAL.
As proposed on tech-userlevel, tech-crypto, tech-security, and tech-kern, and subsequently adopted by core (minus the getentropy part of the proposal, because other operating systems and participants in the discussion couldn't come to an agreement about getentropy and blocking semantics):
https://mail-index.netbsd.org/tech-userlevel/2020/05/02/msg012333.html
|
| 1.66 |
| 17-Jul-2020 |
kamil | Add ppoll() a compatibility wrapper around pollts(2)
Submitted by Apurva Nandan.
|
| 1.65 |
| 17-Jun-2020 |
rin | Fix build for vax; Compile t_ptrace_sigchld.c with -D__TEST_FENV.
|
| 1.64 |
| 30-Apr-2020 |
ryo | Add a test for sigaltstack(2) and SA_ONSTACK
|
| 1.63 |
| 26-Apr-2020 |
thorpej | Add a NetBSD native futex implementation, mostly written by riastradh@. Map the COMPAT_LINUX futex calls to the native ones.
|
| 1.62 |
| 18-Apr-2020 |
christos | PR/55177: Carlo Arenas: mremap(MAP_REMAPDUP) fails after fork()
|
| 1.61 |
| 06-Mar-2020 |
kamil | Add new ptrace(2) test file
t_ptrace_sigchld - for SIGCHLD handler + ptrace(2).
Right now a single test is enabled (raise(SIGKILL)) and marked as failed as it never finishes as the child is never collected before exiting the parent uninterested about its child (SA_NOCLDWAIT).
|
| 1.60 |
| 01-Mar-2020 |
christos | fix variable name
|
| 1.59 |
| 01-Mar-2020 |
christos | Centralize the base rump libraries into a variable used by all the other Makefiles so that we can make changes to it centrally as needed and have less mess. Fixes the sun2 build that needs rumpvfs after librump after the latest changes.
|
| 1.58 |
| 22-Feb-2020 |
kamil | Disable t_ptrace_wait* tests for MKSANITIZER/MKLIBCSANITIZER
A subset of tests is not compatible with the sanitizers.
|
| 1.57 |
| 30-Jun-2019 |
mgorny | branches: 1.57.2; Add a test for verifying procinfo note inside coredumps.
Add a first test for triggering a core dump in the debugged process (via PT_DUMPCORE) and verifying it. The test finds procinfo note and checks its contents.
The core dump is processed through libelf. However, it only provides for finding all note segments (or sections?). I had to implement finding and processing individual notes myself. I've added a core_find_note() function that will be reused in future tests.
Reviewed by kamil.
|
| 1.56 |
| 26-Apr-2019 |
maya | Use LDADD, which apparently puts the libraries at the end of the command, and makes static builds (aka sun2) happier.
|
| 1.55 |
| 25-Apr-2019 |
kamil | Introduce check for the support of FPU exceptions
If FPU exceptions are unsupported, skip the SIGFPE crash tests.
Reuse code from tests/kernel/h_segv.c
|
| 1.54 |
| 10-Feb-2019 |
kamil | Link t_ptrace_wait* tests with -pthread
While there, bump (c) for ATF ptrace(2) tests.
Add __used in infinite_thread() for consistency with other functions in the file.
|
| 1.53 |
| 21-Aug-2018 |
christos | more tests
|
| 1.52 |
| 25-May-2018 |
martin | branches: 1.52.2; Add a test to verify syscall() and/or __syscall() are working. This used to trigger a panic (see PR kern/53261) on arm.
|
| 1.51 |
| 18-May-2018 |
kamil | Add new ATF tests: t_fork and t_vfork
Test behavior of raise(signal) in either fork(2)ed or vfork(2)ed child.
Tests: - raise1 SIGKILL - raise2 SIGSTOP - raise3 SIGTSTP - raise4 SIGTTIN - raise5 SIGTTOU - raise6 SIGABRT - raise7 SIGHUP - raise8 SIGCONT
t_vfork:raise2 fails ignoring non-maskable SIGSTOP.
The remaining ones pass.
Sponsored by <The NetBSD Foundation>
|
| 1.50 |
| 25-Feb-2018 |
kamil | branches: 1.50.2; Add new tests in lib/libc/sys/t_ucontext
New tests: - ucontext_sp - ucontext_fp - ucontext_pc - ucontext_intrv
They test respectively: - _UC_MACHINE_SP - _UC_MACHINE_FP - _UC_MACHINE_PC - _UC_MACHINE_INTRV
These tests attempt to access and print the values from ucontext, without interpreting the values.
This is a follow up of the _UC_MACHINE_FP() introduction.
These tests use PRIxREGISTER, and require to be built with -D_KERNTYPES.
Sponsored by <The NetBSD Foundation>
|
| 1.49 |
| 02-Apr-2017 |
kamil | branches: 1.49.4; Import ptrace(2) tests into appropriate directory tests/lib/libc/sys/
This is the correct directory documented in tests/README for such tests.
Discussed with <martin>
Sponsored by <The NetBSD Foundation>
|
| 1.48 |
| 01-Feb-2017 |
martin | Restrict special mode/owner settings to truncate_test.root_owned; otherwise the Atffile will be generated unreadable for group/others as well.
|
| 1.47 |
| 14-Jan-2017 |
pgoyette | branches: 1.47.2; Set FILESBUILD=yes to actually run the creation script for the file.
Should fix the build by creating a file which install can then find.
|
| 1.46 |
| 13-Jan-2017 |
christos | PR/51844: Ngie Cooper: use root-owned file created during build instead of /usr/bin/fpr
|
| 1.45 |
| 11-Nov-2016 |
njoly | New clock_nanosleep(2) testcase.
|
| 1.44 |
| 06-Nov-2016 |
kamil | Add new tests: tests/lib/libc/sys/t_wait_noproc and t_wait_noproc_wnohang
The t_wait_noproc test checks whether wait(2)-family of functions return error and set ECHILD for lack of childs.
The t_wait_noproc_wnohang adds to options (except wait(2), wait3(2)) new parameter WNOHANG and verifies that error is still signaled and errno set to ECHILD.
Currently t_wait_noproc_wnohang reports failures, these have been marked as expected and referenced to PR standards/51606.
The problem report is authored by Robert Elz, and the initial regression has been notified by Nicolas Joly.
Remove redundant test in tests/lib/libc/sys/t_wait for wait6(2) with no WNOHANG specified.
Sponsored by <The NetBSD Foundation>.
|
| 1.43 |
| 30-Jul-2016 |
njoly | New getsockname(2) testcase for UNIX domain sockets.
|
| 1.42 |
| 06-Apr-2016 |
christos | branches: 1.42.2; Add wait6(2) tests.
|
| 1.41 |
| 24-Jan-2016 |
christos | t_lwp_create needs kernel types.
|
| 1.40 |
| 23-Jan-2016 |
christos | Define _KERNTYPES for things that need it.
|
| 1.39 |
| 22-Jun-2015 |
matt | Don't build tests that depend on RUMP if BSD_MK_COMPAT_FILE is defined.
|
| 1.38 |
| 05-Apr-2015 |
martin | New test program for bind(2), with a single (currently eroneously failing) test case from Tyler Retzlaff.
|
| 1.37 |
| 31-Jan-2015 |
christos | PR/49617: Kirk Russell: posix_fallocate() should be returning an error on failure, without setting errno.
|
| 1.36 |
| 18-Jul-2014 |
christos | Add new minherit test.
|
| 1.35 |
| 10-Jun-2014 |
he | Fix static linking for the tests: -lrump is also used by -lrumpuser, so we also need -lrump after -lrumpuser. Fixes build for sun2.
|
| 1.34 |
| 24-Jul-2013 |
skrll | branches: 1.34.2; There wasn't a codegen bug - the test program itself was buggy.
Nothing to see hear... move along.
|
| 1.33 |
| 23-Jul-2013 |
skrll | Compile tests/lib/libc/sys/t_msgrcv with -O0 on hppa to avoid compiler bug.
|
| 1.32 |
| 08-Mar-2013 |
martin | branches: 1.32.4; Rename testprogram and make it more general by adding other testcases. One commented out, I didn't manage to get all signal handling correct for now.
|
| 1.31 |
| 08-Mar-2013 |
martin | Add a test program for PR kern/47625, based on the sample code provided by anthony mallet.
|
| 1.30 |
| 04-Dec-2012 |
jruoho | Move the bitmap(3) test to the "right" place. Note it in bitops(3). Xrefs.
|
| 1.29 |
| 01-Dec-2012 |
christos | Add a bitops test
|
| 1.28 |
| 12-Sep-2012 |
manu | branches: 1.28.2; setcontext() used to be incompatible with -lpthread since it affected the TLS pointer, therefore wrecking the pthread environement.
Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha) that controlled whether setcontext() would change the TLS pointer. This change let libpthread override setcontext() with its own version that unsets _UC_TLSBASE, enabling safe usage of setcontext() with -lpthread.
We also have the following required changes here: - rename alpha's _UC_UNIQUE into _UC_TLSBASE - add _UC_TLSBASE definition in header file for all ports (powerpc, sh3, sparc and sparc64 lack the implementation for now) - introduce a libc stub that can be overriden for setcontext() - modify MD libcs swapcontext() implementations so that they use the setcontext() libc stub instead of doing a plain system call.
While we are there: - document various MD _UC_* flags in header file - add libc and libpthread tests for swapcontext() behavior (hopefully helpful to spot MD problems introduced with this change)
Future work: - Deciding whether kernel support or _UC_TLSBASE should be added for powerpc, sh3, sparc and sparc64 is left to portmasters sparc64
Approved by core@
|
| 1.27 |
| 08-Aug-2012 |
christos | Exclude tests that use rump
|
| 1.26 |
| 22-Jun-2012 |
christos | tests for recvmmsg
|
| 1.25 |
| 07-Jun-2012 |
martin | Revert previous - instead of guessing the amount of needed memory locked limits (often way too high) and skipping the test case if in doubt, raise the limits as far as we can, and fix a few places in the test where we could run into the limits and either skip or fail with a reasonable message.
|
| 1.24 |
| 05-Jun-2012 |
martin | Try to estimate the number of locked pages the mincore() test will need and check it against resource limits, skipping the tests if it probably is too low.
|
| 1.23 |
| 21-May-2012 |
martin | Calling _lwp_create() with a bogus ucontext could trigger a kernel assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently discovered by YAMAMOTO Takashi and Joel Sing.
To avoid this, introduce a cpu_mcontext_validate() function and move all sanity checks from cpu_setmcontext() there. Also untangle the netbsd32 compat mess slightly and add a cpu_mcontext32_validate() cousin there.
Add an exhaustive atf test case, based partly on code from Joel Sing.
Should finally fix the remaining open part of PR kern/43903.
|
| 1.22 |
| 20-Apr-2012 |
jruoho | Add few unit tests for mlock(2), including a case for PR kern/44788.
|
| 1.21 |
| 17-Mar-2012 |
jruoho | Move the _lwp_ctl(2) preemption counter check to the right place.
|
| 1.20 |
| 17-Nov-2011 |
christos | branches: 1.20.2; Add a test for PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller timeout value makes kernel busy or panic
|
| 1.19 |
| 05-Nov-2011 |
jruoho | Move connect(2), listen(2) and socketpair(2) tests to the right place.
|
| 1.18 |
| 05-Nov-2011 |
jruoho | Add 21 unit tests for the XSI message queues.
|
| 1.17 |
| 31-Oct-2011 |
christos | branches: 1.17.2; Move all pipe2 tests to a separate file.
|
| 1.16 |
| 15-Oct-2011 |
jruoho | Move the sigaction(2) test to the right place.
|
| 1.15 |
| 15-Oct-2011 |
jruoho | Move the ucontext(2) test to the right place.
|
| 1.14 |
| 15-Oct-2011 |
jruoho | Move the writev(2) test to the right place.
|
| 1.13 |
| 15-Oct-2011 |
jruoho | Move the clock_gettime(2) timer test to the right place.
|
| 1.12 |
| 15-Oct-2011 |
jruoho | Move the mkdir(2) test to the right place.
|
| 1.11 |
| 15-Oct-2011 |
jruoho | Move the pipe(2) test to the right place.
|
| 1.10 |
| 15-Oct-2011 |
jruoho | Move the posix_fadvise(2) test to the right place.
|
| 1.9 |
| 17-Sep-2011 |
jruoho | Remove ptrace(2) tests that are not yet ready but were accidentally committed.
|
| 1.8 |
| 17-Sep-2011 |
jruoho | Simplify.
|
| 1.7 |
| 18-Jul-2011 |
jym | Add a simple test case to check executable mapping rights for mprotect(2).
- provide an exec_prot_support() routine so $ARCH can indicate whether it supports execution protection or not, and skip test accordingly.
- have a trivial 'return_one' shellcode to copy anywhere in a page, and call it. The decision to keep the assembly solution is mine, reasons are twofold:
- all pure-C implementations cannot be controlled easily: bounds detection (beginning/end) of return_one is unpredictable, or requires the use of overkill solutions like libelf. Using dlsym(3) was a good proposal, however I can't use it to know the end address of the payload. It makes copying of the shellcode a bit more difficult: using a constant may be too small (code has not been entirely copied, and can lead to errors that can be erroneously detected as "test passed"), or too big (depending on where it is mapped in memory, copying past the end of the function may trigger SIGSEGV).
- I have to ensure that the resulting assembly is the most compact possible, especially as it will be reused to test other parts of memory (stack, data, rodata, etc.).
Only i386 and amd64 are implemented so far. Others will come in due time. FWIW, writing the exec_prot_support() callback and the return_one payload should be enough. Writing callback requires good knowledge of the platform, depending on chip revision, CPU, board, MMU... the protection level may vary.
Current files are put under lib/libc/arch/* and lib/libc/common/. Feel free to move them around the tests/ tree. Keep in mind that the common/ and arch/ code will be used outside of libc, so please do not hide them too deep in the tree.
I checked a few architectures via build.sh cross-compile, and will keep an eye on buildbot for potential build breakage. Feel free to contact me in case you see any, of course.
|
| 1.6 |
| 07-Jul-2011 |
jruoho | Fix previous.
|
| 1.5 |
| 07-Jul-2011 |
jruoho | Remove 't_cerror' (this is tested by numerous individual tests). Rename 't_context' to 't_getcontext' for consistency.
|
| 1.4 |
| 07-Jul-2011 |
jruoho | Add the syscall tests back. Couple of files and tests were also renamed for consistency. All of these now mimic the libc structure.
|
| 1.3 |
| 13-Jan-2011 |
pgoyette | Make sure we build all of thests, not just the last one (use += vs =)
|
| 1.2 |
| 13-Jan-2011 |
pgoyette | Continuing the (re)organization of the lib/libc atf regression tests
|
| 1.1 |
| 10-Jan-2011 |
christos | test for sigqueue
|
| 1.17.2.5 |
| 22-May-2014 |
yamt | sync with head.
for a reference, the tree before this commit was tagged as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments")
|
| 1.17.2.4 |
| 30-Oct-2012 |
yamt | sync with head
|
| 1.17.2.3 |
| 23-May-2012 |
yamt | sync with head.
|
| 1.17.2.2 |
| 17-Apr-2012 |
yamt | sync with head
|
| 1.17.2.1 |
| 10-Nov-2011 |
yamt | sync with head
|
| 1.20.2.1 |
| 21-May-2012 |
riz | Pull up following revision(s) (requested by martin in ticket #274): sys/arch/amd64/amd64/process_machdep.c: revision 1.20 sys/kern/sys_lwp.c: revision 1.54 sys/arch/sparc64/sparc64/machdep.c: revision 1.267 sys/arch/mips/mips/cpu_subr.c: revision 1.16 sys/arch/vax/vax/machdep.c: revision 1.188 sys/sys/lwp.h: revision 1.161 sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.98 sys/arch/alpha/alpha/machdep.c: revision 1.339 sys/compat/sys/ucontext.h: revision 1.6 sys/arch/hppa/hppa/hppa_machdep.c: revision 1.28 distrib/sets/lists/tests/mi: revision 1.469 sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.42 tests/lib/libc/sys/t_lwp_create.c: revision 1.1 tests/lib/libc/sys/Makefile: revision 1.23 sys/arch/arm/arm/sig_machdep.c: revision 1.42 sys/arch/amd64/include/mcontext.h: revision 1.15 sys/arch/amd64/amd64/machdep.c: revision 1.183 sys/arch/sh3/sh3/sh3_machdep.c: revision 1.99 sys/arch/i386/i386/machdep.c: revision 1.727 sys/compat/netbsd32/netbsd32_lwp.c: revision 1.13 sys/arch/sparc/sparc/machdep.c: revision 1.319 sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.76 sys/arch/m68k/m68k/sig_machdep.c: revision 1.49 sys/sys/ucontext.h: revision 1.16 sys/arch/mips/mips/netbsd32_machdep.c: revision 1.9 lib/libc/sys/_lwp_create.2: revision 1.5 Calling _lwp_create() with a bogus ucontext could trigger a kernel assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently discovered by YAMAMOTO Takashi and Joel Sing. To avoid this, introduce a cpu_mcontext_validate() function and move all sanity checks from cpu_setmcontext() there. Also untangle the netbsd32 compat mess slightly and add a cpu_mcontext32_validate() cousin there. Add an exhaustive atf test case, based partly on code from Joel Sing. Should finally fix the remaining open part of PR kern/43903.
|
| 1.28.2.2 |
| 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
| 1.28.2.1 |
| 23-Jun-2013 |
tls | resync from head
|
| 1.32.4.1 |
| 23-Jul-2013 |
riastradh | sync with HEAD
|
| 1.34.2.1 |
| 10-Aug-2014 |
tls | Rebase.
|
| 1.42.2.4 |
| 26-Apr-2017 |
pgoyette | Sync with HEAD
|
| 1.42.2.3 |
| 20-Mar-2017 |
pgoyette | Sync with HEAD
|
| 1.42.2.2 |
| 07-Jan-2017 |
pgoyette | Sync with HEAD. (Note that most of these changes are simply $NetBSD$ tag issues.)
|
| 1.42.2.1 |
| 06-Aug-2016 |
pgoyette | Sync with HEAD
|
| 1.47.2.1 |
| 21-Apr-2017 |
bouyer | Sync with HEAD
|
| 1.49.4.4 |
| 09-Dec-2023 |
martin | Additionally pull up following revision(s) (requested by riastradh in ticket #1920):
tests/lib/libc/sys/Makefile: revision 1.75 (via patch)
t_setrlimit uses alloca now
|
| 1.49.4.3 |
| 21-Mar-2018 |
martin | Pull up the following, requested by kamil in ticket #552:
external/gpl3/gcc{.old}/dist/libsanitizer/asan/asan_linux.cc 1.4 sys/arch/aarch64/include/mcontext.h 1.2 sys/arch/alpha/include/mcontext.h 1.9 sys/arch/amd64/include/mcontext.h 1.19 sys/arch/arm/include/mcontext.h 1.19 sys/arch/hppa/include/mcontext.h 1.9 sys/arch/i386/include/mcontext.h 1.14 sys/arch/ia64/include/mcontext.h 1.6 sys/arch/m68k/include/mcontext.h 1.10 sys/arch/mips/include/mcontext.h 1.22 sys/arch/or1k/include/mcontext.h 1.2 sys/arch/powerpc/include/mcontext.h 1.18 sys/arch/riscv/include/mcontext.h 1.5 sys/arch/sh3/include/mcontext.h 1.11 sys/arch/sparc/include/mcontext.h 1.14-1.17 sys/arch/sparc64/include/mcontext.h 1.10 sys/arch/vax/include/mcontext.h 1.9 tests/lib/libc/sys/Makefile 1.50 tests/lib/libc/sys/t_ucontext.c 1.2-1.5 sys/arch/hppa/include/mcontext.h 1.10 sys/arch/ia64/include/mcontext.h 1.7
- Introduce _UC_MACHINE_FP(). _UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer. - Add new tests in lib/libc/sys/t_ucontext: * ucontext_sp (testing _UC_MACHINE_SP) * ucontext_fp (testing _UC_MACHINE_FP) * ucontext_pc (testing _UC_MACHINE_PC) * ucontext_intrv (testing _UC_MACHINE_INTRV)
Add a dummy implementation of _UC_MACHINE_INTRV() for ia64.
Implement _UC_MACHINE_INTRV() for hppa.
Make the t_ucontext.c test more portable.
We now have _UC_MACHINE_FP.
|
| 1.49.4.2 |
| 26-Feb-2018 |
snj | revert ticket 552, which broke the build
|
| 1.49.4.1 |
| 25-Feb-2018 |
snj | Pull up following revision(s) (requested by kamil in ticket #552): sys/arch/aarch64/include/mcontext.h: 1.2 sys/arch/alpha/include/mcontext.h: 1.9 sys/arch/amd64/include/mcontext.h: 1.19 sys/arch/arm/include/mcontext.h: 1.19 sys/arch/hppa/include/mcontext.h: 1.9 sys/arch/i386/include/mcontext.h: 1.14 sys/arch/ia64/include/mcontext.h: 1.6 sys/arch/m68k/include/mcontext.h: 1.10 sys/arch/mips/include/mcontext.h: 1.22 sys/arch/or1k/include/mcontext.h: 1.2 sys/arch/powerpc/include/mcontext.h: 1.18 sys/arch/riscv/include/mcontext.h: 1.5 sys/arch/sh3/include/mcontext.h: 1.11 sys/arch/sparc/include/mcontext.h: 1.14-1.17 sys/arch/sparc64/include/mcontext.h: 1.10 sys/arch/vax/include/mcontext.h: 1.9 tests/lib/libc/sys/Makefile: 1.50 tests/lib/libc/sys/t_ucontext.c: 1.2 Introduce _UC_MACHINE_FP() as a macro _UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer. Don't rely on this interface as a compiler might strip frame pointer or optimize it making this interface unreliable. For hppa assume a small frame context, for larger frames FP might be located in a different register (4 instead of 3). For ia64 there is no strict frame pointer, and registers might rotate. Reuse 79 following: ./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM LOC_REG (79) Once ia64 will mature, this should be revisited. A macro can encapsulate a real function for extracting Frame Pointer on more complex CPUs / ABIs. For the remaining CPUs, reuse standard register as defined in appropriate ABI. The direct users of this macro are LLVM and GCC with Sanitizers. Proposed on tech-userlevel@. Sponsored by <The NetBSD Foundation> -- Improve _UC_MACHINE_FP() for SPARC/SPARC64 Introduce a static inline function _uc_machine_fp() that contains improved caluclation of a frame pointer. Algorithm: uptr *stk_ptr; # if defined (__arch64__) stk_ptr = (uptr *) (*sp + 2047); # else stk_ptr = (uptr *) *sp; # endif *bp = stk_ptr[15]; Noted by <mrg> -- Make _UC_MACHINE_FP() compile again and fix it so that it does not add the offset twice. -- fix _UC_MACHINE32_FP() -- use 32 bit pointer value so that [15] is the right offset. do this by using __greg32_t, which is only in the sparc64 version, and these are only useful there, so move them. -- Add new tests in lib/libc/sys/t_ucontext New tests: - ucontext_sp - ucontext_fp - ucontext_pc - ucontext_intrv They test respectively: - _UC_MACHINE_SP - _UC_MACHINE_FP - _UC_MACHINE_PC - _UC_MACHINE_INTRV These tests attempt to access and print the values from ucontext, without interpreting the values. This is a follow up of the _UC_MACHINE_FP() introduction. These tests use PRIxREGISTER, and require to be built with -D_KERNTYPES. Sponsored by <The NetBSD Foundation>
|
| 1.50.2.3 |
| 06-Sep-2018 |
pgoyette | Sync with HEAD
Resolve a couple of conflicts (result of the uimin/uimax changes)
|
| 1.50.2.2 |
| 25-Jun-2018 |
pgoyette | Sync with HEAD
|
| 1.50.2.1 |
| 21-May-2018 |
pgoyette | Sync with HEAD
|
| 1.52.2.3 |
| 21-Apr-2020 |
martin | Sync with HEAD
|
| 1.52.2.2 |
| 13-Apr-2020 |
martin | Mostly merge changes from HEAD upto 20200411
|
| 1.52.2.1 |
| 10-Jun-2019 |
christos | Sync with HEAD
|
| 1.57.2.1 |
| 09-Dec-2023 |
martin | Additionally pull up following revision(s) (requested by riastradh in ticket #1769):
tests/lib/libc/sys/Makefile: revision 1.75 (via patch)
t_setrlimit uses alloca now
|
| 1.68.2.2 |
| 14-Dec-2020 |
thorpej | Unit tests for timerfd.
|
| 1.68.2.1 |
| 14-Dec-2020 |
thorpej | Unit tests for eventfd(2).
|
| 1.72.2.1 |
| 09-Dec-2023 |
martin | Additionally pull up following revision(s) (requested by riastradh in ticket #477):
tests/lib/libc/sys/Makefile: revision 1.75 (via patch)
t_setrlimit uses alloca now
|
| 1.76.2.1 |
| 02-Aug-2025 |
perseant | Sync with HEAD
|