367457 |
07-Nov-2020 |
dim |
MFC r344855 (by jhb):
Drop "All rights reserved" from my copyright statements.
Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D19485 |
354134 |
28-Oct-2019 |
lwhsu |
MFC r350211, r350220, r350235, r350238-r350239, r350295, r350512, r350700, r352219
r350211: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_child_detached_unrelated_debugger
PR: 239292 Sponsored by: The FreeBSD Foundation
r350220: Fix URL.
Sponsored by: The FreeBSD Foundation
r350235: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__PT_KILL_competing_stop
PR: 220841 Sponsored by: The FreeBSD Foundation
r350238: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_both_attached_unrelated_debugger
PR: 239397 Sponsored by: The FreeBSD Foundation
r350239: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_sees_exit_after_child_debugger
PR: 239399 Sponsored by: The FreeBSD Foundation
r350295: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_parent_detached_unrelated_debugger
PR: 239425 Sponsored by: The FreeBSD Foundation
r350512: Only skip test cases sometimes failing in CI when they are running in CI
Suggested by: jhb Sponsored by: The FreeBSD Foundation
r350700: Get configuration variable with default value for not breaking default setting
Reported by: markj Sponsored by: The FreeBSD Foundation
r352219: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__getppid
PR: 240510 Sponsored by: The FreeBSD Foundation |
351792 |
03-Sep-2019 |
kevans |
MFC r351408-r351410: reduce pollution from mips machine/regnum.h
r351408: libsa: mips: use _JB_* from machine/asm.h, remove regnum dep
This brings the libsa/mips _setjmp implementation closer to parity with the libc version.
r351409: mips: hide regnum definitions behind _KERNEL/_WANT_MIPS_REGNUM
machine/regnum.h ends up being included by sys/procfs.h and sys/ptrace.h via machine/reg.h. Many of the regnum definitions are too short and too generic to be exposing to any userland application including one of these two headers. Moreover, these actively cause build failures in googletest (template <typename T1 ...> expanding to template <typename 9 ...>).
Hide the definitions behind _KERNEL or _WANT_MIPS_REGNUM, and patch all of the userland consumers to define as needed.
r351410: libsa: mips: fix typo that had slipped into the diff on local machine |
351506 |
26-Aug-2019 |
kib |
MFC r351211: sys.kern.pdeathsig.signal_delivered_ptrace: fix startup.
PR: 237657 |
351505 |
26-Aug-2019 |
kib |
MFC r351210: sys.kern.pdeathsig.signal_delivered_ptrace: fix debugger detach
PR: 237657 |
346541 |
22-Apr-2019 |
markj |
MFC r346009: Set the p_oppid field of orphans when exiting. |
342704 |
02-Jan-2019 |
jhb |
MFC 341800: Don't report stale signal information in ptrace_lwpinfo.
Once a signal's siginfo was copied to 'td_si' as part of the signal exchange in issignal(), it was never cleared. This caused future thread events that are reported as SIGTRAP events without signal information to report the stale siginfo in 'td_si'. For example, if a debugger created a new process and used SIGSTOP to stop it after PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI with the SIGSTOP siginfo in pl_siginfo. This broke 'catch syscall' in current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP indicates a breakpoint or single step trap. |
339067 |
01-Oct-2018 |
asomers |
MFC r337222:
Fix LOCAL_PEERCRED with socketpair(2)
Enable the LOCAL_PEERCRED socket option for unix domain stream sockets created with socketpair(2). Previously, it only worked with unix domain stream sockets created with socket(2)/listen(2)/connect(2)/accept(2).
PR: 176419 Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk> Differential Revision: https://reviews.freebsd.org/D16350 |
338619 |
12-Sep-2018 |
markj |
MFC r337329: Fix the regression test for PR 181741.
MFC r337424: Update PR 131876 regression tests after r337423.
PR: 131876 |
338516 |
06-Sep-2018 |
jhb |
MFC 332908: Add two tests for TRAP_* signal codes for SIGTRAP.
- ptrace__breakpoint_siginfo tests that a SIGTRAP for a software breakpoint in userland triggers a SIGTRAP with a signal code of TRAP_BRKPT. - ptrace__step_siginfo tests that a SIGTRAP reported for a step after stepping via PT_STEP or PT_SETSTEP has a signal code of TRAP_TRACE. |
338514 |
06-Sep-2018 |
jhb |
MFC 332906,332907,332976,333679,336053: Expand testing of breakpoints.
332906: Extend support for ptrace() tests using breakpoints.
- Use a single list of platforms to define HAVE_BREAKPOINT for platforms that expose a functional breakpoint() inline to userland. Replace existing lists of platform tests with HAVE_BREAKPOINT instead. - Add support for advancing PC past a breakpoint inserted via breakpoint() to support the existing ptrace__PT_CONTINUE_different_thread test on non-x86 platforms (x86 advances the PC past the breakpoint instruction, but other platforms do not). This is implemented by defining a new SKIP_BREAK macro which accepts a pointer to a 'struct reg' as its sole argument and modifies the contents to advance the PC. The intention is to use it in between PT_GETREGS and PT_SETREGS.
332907: Expose breakpoint() to userland from <machine/cpufunc.h> on MIPS.
Enable ptrace() tests using breakpoint on MIPS as well.
332976: Shorten some recently-added lines that are an extra indent over 80 columns.
333679: Export a breakpoint() function to userland for riscv.
As a result, enable tests using breakpoint() on riscv.
336053: Export a breakpoint() function to userland for arm and arm64.
Enable ptrace() tests using breakpoint() on these architectures. |
337464 |
08-Aug-2018 |
markj |
MFC r337059: Fix some nits in the unix_passfd tests. |
337421 |
07-Aug-2018 |
markj |
MFC r336957: Add a regression test related to PR 131876.
PR: 131876 |
336873 |
29-Jul-2018 |
markj |
MFC r336614: Add a regression test for PR 131876.
PR: 131876 |
333625 |
15-May-2018 |
kib |
Handle the difference between HEAD and stable/11 tests build. This is a direct commit to stable/11.
PR: 228018, 228233 Tested by: Helge Oldach <freebsd@oldach.net> Sponsored by: The FreeBSD Foundation Approved by: re (marius) |
333162 |
02-May-2018 |
kib |
MFC r332740: Add PROC_PDEATHSIG_SET to procctl interface.
MFC r332825: Rename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL.
MFC r333067: Remove redundant pipe from pdeathsig.c test. |
330731 |
10-Mar-2018 |
asomers |
MFC r328896, r329236
r328896: Fix and enable SysV IPC tests.
Don't declare some types that FreeBSD incorrectly declares.
Fix an incorrect call to open() (missing mode).
ANSIfy prototypes.
Enable SysV message queue, semaphore, and shared memory tests.
With exception of the workaround for union semun, these fixes have been committed to NetBSD.
Reviewed by: asomers Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13471
r329236: Fix Coverity CIDs in the sys/kern/sysv_test tests
CID 979810: strcpy => strlcpy CID 1193367: don't leak a file descriptor CID 1299856: Check the return value of read(2)
Reported by: Coverity Coverity CID: 978910 1193367 1299856 X-MFC-With: 328896 Sponsored by: Spectra Logic Corp |
328379 |
24-Jan-2018 |
jhb |
MFC 325028,328344: Discard the correct thread event reported for a ptrace stop.
325028: Discard the correct thread event reported for a ptrace stop.
When multiple threads wish to report a tracing event to a debugger, both threads call ptracestop() and one thread will win the race to be the reporting thread (p->p_xthread). The debugger uses PT_LWPINFO with the process ID to determine which thread / LWP is reporting an event and the details of that event. This event is cleared as a side effect of the subsequent ptrace event that resumed the process (PT_CONTINUE, PT_STEP, etc.). However, ptrace() was clearing the event identified by the LWP ID passed to the resume request even if that wasn't the 'p_xthread'. This could result in clearing an event that had not yet been observed by the debugger and leaving the existing event for 'p_thread' pending so that it was reported a second time.
Specifically, if the debugger stopped due to a software breakpoint in one thread, but then switched to another thread that was used to resume (e.g. if the user switched to a different thread and issued a step), the resume request (PT_STEP) cleared a pending event (if any) for the thread being stepped. However, the process immediately stopped and the first thread reported it's breakpoint event a second time. The debugger decremented the PC for "both" breakpoint events which resulted in the PC now pointing into the middle of an instruction (on x86) and a SIGILL fault when the process was resumed a second time.
To fix, always clear the pending event for 'p_xthread' when resuming a process. ptrace() still honors the requested LWP ID when enabling single-stepping (PT_STEP) or setting a different PC (PT_CONTINUE).
328344: Mark the unused argument to continue_thread() as such.
clang in HEAD and 11 does not warn about this, but clang in 10 does. |
328309 |
24-Jan-2018 |
jhb |
MFC 326953: Catch up to r325719 which makes the kern.proc.pid sysctl "work" for zombies.
Some of the ptrace tests need to wait for a child process to become a zombie before preceding. The parent process polls the child process via the kern.proc.pid sysctl to wait for it to become a zombie. Previously the code polled until the sysctl failed with ESRCH. Now it will poll until either the sysctl fails with ESRCH (for compatiblity with older kernels) or returns a kinfo_proc structure with the ki_stat field set to SZOMB. |
325885 |
16-Nov-2017 |
jhb |
MFC 324993: Add a test for sending a signal while stepping a thread via PT_STEP. |
324943 |
24-Oct-2017 |
bdrewery |
MFC r318246,r324566,r324668,r324701:
r318246: Add a regression test for r318191. r324566: Fix shadowed variable hidden by WARNS changing to 3 in r313006. r324668: This child is expected to exit on SIGTRAP, don't leave a core behind. r324701: Add a test for r324671 along with some other masked tests. |
323186 |
05-Sep-2017 |
rlibby |
MFC r316397 (by bde):
Remove the unportable -msse4 here too after fixing crc32_sse42.c to not depend on it. This should have been part of r315983.
Note, r315983 was MFC'd to stable/11 in r317149.
Approved by: markj (mentor) |
322691 |
19-Aug-2017 |
ngie |
MFC r321959:
Annotate tests that require root privileges appropriately
This unbreaks running the tests with unprivileged users. |
321165 |
18-Jul-2017 |
ngie |
MFC r319063:
Send all of `data`, not just a portion of it
It was sending only a long's worth (4 or 8 bytes) of data previously (instead of the entire buffer) via send(2).
CID: 1229966, 1229967, 1230004, 1230005 |
319404 |
01-Jun-2017 |
tuexen |
MFC r317512:
armv8 has support for optional CRC32C instructions. This patch checks if they are available and if that is true make use of them. Thank you very much to Andrew Turner for providing help and review the patch!
Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D10499 |
317831 |
05-May-2017 |
brooks |
MFC r317566:
Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).
These commands take an int. The tests work by accident on little-endian, 64-bit systems.
PR: 218919 Tested with: qemu-cheri and CheriBSD built for mips64 Reviewed by: asomers, ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL |
317149 |
19-Apr-2017 |
markj |
MFC r313006 (by cem), r315983 (by bde): Add an SSE4.2 implementation of crc32 for x86. |
315963 |
25-Mar-2017 |
badger |
MFC r315412, r314852:
r315412: Don't clear p_ptevents on normal SIGKILL delivery
The ptrace() user has the option of discarding the signal. In such a case, p_ptevents should not be modified. If the ptrace() user decides to send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events do not have the capability to discard the signal, so continue to clear the mask in that case.
r314852: don't stop in issignal() if P_SINGLE_EXIT is set
Suppose a traced process is stopped in ptracestop() due to receipt of a SIGSTOP signal, and is awaiting orders from the tracing process on how to handle the signal. Before sending any such orders, the tracing process exits. This should kill the traced process. But suppose a second thread handles the SIGKILL and proceeds to exit1(), calling thread_single(). The first thread will now awaken and will have a chance to check once more if it should go to sleep due to the SIGSTOP. It must not sleep after P_SINGLE_EXIT has been set; this would prevent the SIGKILL from taking effect, leaving a stopped orphan behind after the tracing process dies.
Also add new tests for this condition.
Sponsored by: Dell EMC |
315949 |
25-Mar-2017 |
badger |
MFC r313992, r314075, r314118, r315484:
r315484: ptrace_test: eliminate assumption about thread scheduling
A couple of the ptrace tests make assumptions about which thread in a multithreaded process will run after a halt. This makes the tests less portable across branches, and susceptible to future breakage. Instead, twiddle thread scheduling and priorities to match the tests' expectation.
r314118: Actually fix buildworlds other than i386/amd64/sparc64 after r313992
Disable offending test for platforms without a userspace visible breakpoint().
r314075: Fix world build for archs where __builtin_debugtrap() does not work.
The offending code was introduced in r313992.
r313992: Defer ptracestop() signals that cannot be delivered immediately
When a thread is stopped in ptracestop(), the ptrace(2) user may request a signal be delivered upon resumption of the thread. Heretofore, those signals were discarded unless ptracestop()'s caller was issignal(). Fix this by modifying ptracestop() to queue up signals requested by the ptrace user that will be delivered when possible. Take special care when the signal is SIGKILL (usually generated from a PT_KILL request); no new stop events should be triggered after a PT_KILL.
Add a number of tests for the new functionality. Several tests were authored by jhb.
PR: 212607 Sponsored by: Dell EMC |
313302 |
05-Feb-2017 |
jilles |
MFC r310096: reaper: Make REAPER_KILL_SUBTREE actually work. |
313213 |
04-Feb-2017 |
ngie |
MFC r312119,r312216,r312226:
r312119:
encode_long, encode_timeval: mechanically replace `exp` with `exponent`
This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test, which include math.h, which in turn defines exp(3)
Tested with: clang, gcc 4.2.1, gcc 4.9
r312216:
Revert r312119 and reword the intent to fix -Wshadow issues between exp(3) and `exp` var.
The approach taken previously was not ideal for multiple functional and stylistic reasons.
Add to existing sed call in Makefile to replace `exp` with `exponent` instead.
Requested by: bde
r312226:
Fix typo in r312216
I meant to replace "exp" with "exponent", not "expected"
Pointyhat to: ngie |
312321 |
17-Jan-2017 |
ngie |
MFC r312118,r312121:
r312118:
Fix -Wformat issue with zero-length format string passed to err(3)
Tested with: clang, gcc 4.2.1, gcc 4.9
r312121:
Follow up to r312118
State that execve failed instead of just printing out the program name and strerror(errno) via err(3). |
312072 |
13-Jan-2017 |
kib |
MFC r311522: Use type-independent formats for printing nlink_t and ino_t. |
310601 |
26-Dec-2016 |
jilles |
MFC r309957: Add tests for reaper receiving SIGCHLD (r309886).
PR: 213928 |
310231 |
18-Dec-2016 |
jilles |
MFC r309836: Add some tests for reaper functionality (in procctl()). |
309661 |
07-Dec-2016 |
ngie |
MFC r306962: r306962 (by br):
Ensure data in pipe is available to read. Useful for latest (5th, direct mode) test only. |
307004 |
10-Oct-2016 |
jilles |
MFC r305676: wait: Do not copyout uninitialized status/rusage/wrusage.
If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and wrusage information should not be returned.
PR: 212048 Reported by: Casey Lucas |
304947 |
28-Aug-2016 |
ngie |
MFC r304238:
Only expect :encode_tv_random_million to fail on 64-bit platforms
It passes on i386 |
304499 |
19-Aug-2016 |
jhb |
MFC 303001: Add PTRACE_VFORK to trace vfork events.
First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when the new child was created via vfork() rather than fork(). Second, a new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK event mask. This new stop is reported after the vfork parent resumes due to the child calling exit or exec. Debuggers can use this stop to reinsert breakpoints in the vfork parent process before it resumes. |
304188 |
15-Aug-2016 |
jhb |
MFC 302900,302902,302921,303461,304009: Add a mask of optional ptrace() events.
302900: Add a test for user signal delivery.
This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland.
302902: Add a mask of optional ptrace() events.
ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future.
Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask.
The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events.
The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS.
The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask.
While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process.
302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL.
303461: Note that not all optional ptrace events use SIGTRAP.
New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP.
304009: Remove description of P_FOLLOWFORK as this flag was removed. |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
300538 |
23-May-2016 |
asomers |
Commit a missing change from 299090
tests/sys/kern/Makefile Reenable a disabled compiler warning, the need for which was eliminated by r299090.
Reviewed by: ngie MFC after: 4 weeks X-MFC-With: 299090 Sponsored by: Spectra Logic Corp
|
299508 |
12-May-2016 |
cem |
kern_descrip_test: Fix trivial buffer overrun with readlink(2)
Reported by: Coverity CID: 1229965, 1229972 Sponsored by: EMC / Isilon Storage Division
|
299094 |
04-May-2016 |
ngie |
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)
Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info.
MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
|
298811 |
29-Apr-2016 |
asomers |
Automate the subr_unit test.
Build and install the subr_unit test program originally written by phk, and run it with the other ATF tests.
tests/sys/kern/Makefile * Build and install the subr_unit test as a plain test
sys/kern/subr_unit.c * Reduce the default number of repetitions from 100 to 1, and add a command-line parser to override it. * Don't be so noisy by default * Fix an include problem for the test build
Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6038
|
298107 |
16-Apr-2016 |
gjb |
Merge the projects/release-pkg branch to head.
This allows packaging the base system with pkg(8), including but not limited to providing the ability to provide upstream binary update possibilities for non-tier-1 architectures.
This merge is a requirement of the 11.0-RELEASE, and as such, thank you to everyone that has tested the project branch.
Documentation in build(7) etc. is still somewhat sparse, but updates to those parts will follow.
Sponsored by: The FreeBSD Foundation
|
296587 |
09-Mar-2016 |
bdrewery |
DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by: EMC / Isilon Storage Division
|
292957 |
30-Dec-2015 |
ngie |
Rename `recvfd` and `sendfd` variables in recvfd/sendfd functions to avoid -Wshadow issues with gcc
MFC after: 1 week Reported by: bz, jenkins Sponsored by: EMC / Isilon Storage Division
|
292914 |
30-Dec-2015 |
ngie |
Integrate tools/regression/sockets/unix_passfd into the FreeBSD test suite as tests/sys/kern/unix_passfd_test
- Convert testcases to ATF - Fix an alignment issues - Mark rights_creds_payload(..) as an expected failure (see PR # 181741)
Based [in part] on the following Differential Revision: https://reviews.freebsd.org/D689
MFC after: 1 week Submitted by: markj Sponsored by: EMC / Isilon Storage Division
|
292894 |
29-Dec-2015 |
jhb |
Add ptrace(2) reporting for LWP events.
Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting thread creation and destruction. Newly created threads will stop to report PL_FLAG_BORN before returning to userland and exiting threads will stop to report PL_FLAG_EXIT before exiting completely. Both of these events are only enabled and reported if PT_LWP_EVENTS is enabled on a process.
|
292822 |
28-Dec-2015 |
ngie |
Remove retval to fix a -Wunused-but-set-variable warning from gcc 4.9
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
292821 |
28-Dec-2015 |
ngie |
- Remove unused but set ssize in shutdown_send_sigpipe - Add #ifdef TEST_SEQ_PACKET_SOURCE_ADDRESS` for untestable code because FreeBSD doesn't have a means to map source addresses for SEQ_PACKET AF_UNIX sockets (paraphrased). Put pathname variable under the #ifdef to mute another unused but set variable warning
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
292820 |
28-Dec-2015 |
ngie |
Clean trailing whitespace
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
291738 |
04-Dec-2015 |
bdrewery |
Fix LDADD/DPADD that should be LIBADD.
Sponsored by: EMC / Isilon Storage Division
|
291331 |
25-Nov-2015 |
bdrewery |
Avoid requiring 'make depend' here.
Really this should not be a DPSRCS. The acct_test.c should not #include convert.c, but just link it in as a normal SRCS.
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
291181 |
23-Nov-2015 |
ngie |
Integrate contrib/netbsd-tests/kernel/t_mqueue into the FreeBSD test suite as tests/sys/kern/mqueue_test
MFC after: 1 week
|
291180 |
23-Nov-2015 |
ngie |
Fix up convert.c generation
- Use a temporary file for convert.c to reduce likelihood of an interrupted build resulting in bad code being written to convert.c - Truncate the file instead of appending to it to ensure that the file being touched will not result in duplicate declarations/definitions from kern_acct.c if/when kern_acct.c changes.
MFC after: 1 week
|
290914 |
16-Nov-2015 |
ngie |
Integrate tools/regression/pipe in to the FreeBSD test suite as tests/sys/kern/pipe
- Fix style(9) bugs - Fix compiler warnings - Use `nitems(x)` instead of `sizeof(x) / sizeof(*x)` pattern
The testcases will be converted over to ATF eventually, but for now will be integrated in as plain C tests
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
290912 |
16-Nov-2015 |
ngie |
Integrate contrib/netbsd-tests/kernel/t_lockf.c into the FreeBSD test suite as tests/sys/kern/lockf_test
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
290905 |
16-Nov-2015 |
ngie |
Integrate acct(2) testcase in as tests/sys/kern/acct/acct_test
The :encode_tv_random_million testcase fails the epsilon tests a few thousand times out of one million, so expect the testcase to fail
MFC after: 1 week Submitted by: keramida Sponsored by: EMC / Isilon Storage Division
|
289603 |
19-Oct-2015 |
kib |
Add tests for the copyin(9) handling of illegal buffers.
Reviewed by: emaste, ngie Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D3925
|
288962 |
06-Oct-2015 |
jhb |
Tweak: use 'mainlwp' instead of 'mainpid' since this is a thread (LWP) identifier, not a pid.
|
288961 |
06-Oct-2015 |
bdrewery |
Fix build with older GCC which, doesn't like 'main' being a variable name.
|
288949 |
06-Oct-2015 |
jhb |
Fix various edge cases related to system call tracing. - Always set td_dbg_sc_* when P_TRACED is set on system call entry even if the debugger is not tracing system call entries. This ensures the fields are valid when reporting other stops that occur at system call boundaries such as for PT_FOLLOW_FORKS or when only tracing system call exits. - Set TDB_SCX when reporting the stop for a new child process in fork_return(). This causes the event to be reported as a system call exit. - Report a system call exit event in fork_return() for new threads in a traced process. - Copy td_dbg_sc_* to new threads instead of zeroing. This ensures that td_dbg_sc_code in particular will report the system call that created the new thread or process when it reports a system call exit event in fork_return(). - Add new ptrace tests to verify that new child processes and threads report system call exit events with a valid pl_syscall_code via PT_LWPINFO.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D3822
|
288683 |
05-Oct-2015 |
ngie |
Revert r288682
I meant to do this on ^/user/ngie/more-tests
Pointyhat to: ngie (use svn info next time...)
|
288682 |
05-Oct-2015 |
ngie |
Remove some paths preparing for a re-copy from head
|
287602 |
09-Sep-2015 |
jhb |
Use _exit() instead of exit() in child processes created during tests.
Suggested by: kib
|
287601 |
09-Sep-2015 |
jhb |
Add a test to verify that a traced process sees its original parent via getppid() after a debugger process that is not the parent has attached.
Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D3615
|
287600 |
09-Sep-2015 |
jhb |
Properly size the children[] arrays in the follow fork tests.
|
286158 |
01-Aug-2015 |
jhb |
Clear P_TRACED before reparenting a detached process back to its original parent. Otherwise the debugee will be set as an orphan of the debugger.
Add tests for tracing forks via PT_FOLLOW_FORK.
Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D2809
|
286011 |
29-Jul-2015 |
pluknet |
Fixed shutdown(2) unix(4) tests for SOCK_SEQPACKET after r285910 (by ed).
|
284000 |
04-Jun-2015 |
jhb |
Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes of the main test process.
Differential Revision: https://reviews.freebsd.org/D2664 Reviewed by: ngie (previous version)
|
283836 |
31-May-2015 |
jhb |
Consistently only use one end of the pipe in the parent and debugger processes and do not rely on EOF due to a close() in the debugger.
PR: 200489 Differential Revision: https://reviews.freebsd.org/D2674 Reviewed by: kib, ngie, rodrigc
|
283647 |
28-May-2015 |
jhb |
Tweak the description of when waitpid() doesn't return any status for a non-blocking wait to avoid the word "empty".
Requested by: ngie
|
283562 |
26-May-2015 |
jhb |
Do not allow a process to reap an orphan (a child currently being traced by another process such as a debugger). The parent process does need to check for matching orphan pids to avoid returning ECHILD if an orphan has exited, but it should not return the exited status for the child until after the debugger has detached from the orphan process either explicitly or implicitly via wait().
Add two tests for for this case: one where the debugger is the direct child (thus the parent has a non-empty children list) and one where the debugger is not a direct child (so the only "child" of the parent is the orphan).
Differential Revision: https://reviews.freebsd.org/D2644 Reviewed by: kib MFC after: 2 weeks
|
283282 |
22-May-2015 |
jhb |
Only reparent a traced process to its old parent if the tracing process is not the old parent. Otherwise, proc_reap() will leave the zombie in place resulting in the process' status being returned twice to its parent.
Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by this change.
Differential Revision: https://reviews.freebsd.org/D2594 Reviewed by: kib MFC after: 2 weeks
|
282104 |
27-Apr-2015 |
ngie |
Move tests/sys/kern/mmap_test to tests/sys/vm/mmap_test
As jhb noted, the actual mmap(2) implementation is under sys/vm, not sys/kern/, so the correct logical place is tests/sys/vm/, not tests/sys/kern/
X-MFC with: r282076 MFC after: 6 days
|
282076 |
27-Apr-2015 |
ngie |
Integrate tools/regression/mmap into the FreeBSD test suite as tests/sys/kern/mmap_test
MFC after: 1 week
|
282061 |
27-Apr-2015 |
ngie |
Integrate tools/regression/execve into the FreeBSD test suite as tests/sys/kern/execve
MFC after: 1 week
|
271397 |
10-Sep-2014 |
asomers |
Abort the create_socket test if socket creation fails.
MFC after: 1 week Reported by: Coverity CID: 1232756
|
270228 |
20-Aug-2014 |
asomers |
Numerous small fixes, mostly suggested by Coverity.
tests/sys/kern/unix_seqpacket_test.c * Remove a duplicate error check in mk_pair_of_sockets * Always close sockets in the success path of ATF test cases. Don't bother with the error paths, because those are mostly assertions anyway. Most of these socket leaks were reported by Coverity. All of them are harmless, because each ATF test case runs in its own process. * Fix the len argument to send in shutdown_send and shutdown_send_sigpipe. The old version was using sizeof a pointer instead of sizeof the char array. Reported by Coverity. * Change a few ATF_CHECK to ATF_REQUIRE if the test can't reasonably continue past a failure.
Reported by: Coverity Scan CID: 1229995, 1229991, 1229988, 1229994, 1229989, 1229992 CID: 1229993, 1229990, 1229984, 1229967, 1230005, 1229977 CID: 1229966, 1230004, 1229976 MFC after: 1 week Sponsored by: Spectra Logic
|
264133 |
04-Apr-2014 |
jmmv |
Fix variable type to avoid printf formatter warning.
This fixes the build under powerpc64 where gcc complains about a mismatch between a %zd printf formatter and an int variable passed to it.
|
263336 |
19-Mar-2014 |
pho |
Added sysctl kern.maxfiles increase test, do not use /etc/passwd for tests and use volatile sig_atomic_t for signal handler variable.
Reviewed by: asomers (previous version) Sponsored by: EMC / Isilon storage division
|
263161 |
14-Mar-2014 |
jmmv |
Make bsd.test.mk the only public mk fragment for the building of tests.
Change {atf,plain,tap}.test.mk to be internal implementation details of bsd.test.mk. Makefiles that build tests should now only include bsd.test.mk and declaratively specify what they want to build, without worrying about the internal implementation of the mk files.
The reason for this change is to permit building test programs of different interfaces from a single directory, which is something I had a need for while porting tests over from src/tools/regression/.
Additionally, this change makes it possible to perform some other requested changes to bsd.test.mk in an easier manner. Coming soon.
|
263116 |
13-Mar-2014 |
asomers |
Replace 4.4BSD Lite's unix domain socket backpressure hack with a cleaner mechanism, based on the new SB_STOP sockbuf flag. The old hack dynamically changed the sending sockbuf's high water mark whenever adding or removing data from the receiving sockbuf. It worked for stream sockets, but it never worked for SOCK_SEQPACKET sockets because of their atomic nature. If the sockbuf was partially full, it might return EMSGSIZE instead of blocking.
The new solution is based on DragonFlyBSD's fix from commit 3a6117bbe0ed6a87605c1e43e12a1438d8844380 on 2008-05-27. It adds an SB_STOP flag to sockbufs. Whenever uipc_send surpasses the socket's size limit, it sets SB_STOP on the sending sockbuf. sbspace() will then return 0 for that sockbuf, causing sosend_generic and friends to block. uipc_rcvd will likewise clear SB_STOP. There are two fringe benefits: uipc_{send,rcvd} no longer need to call chgsbsize() on every send and receive because they don't change the sockbuf's high water mark. Also, uipc_sense no longer needs to acquire the UIPC linkage lock, because it's simpler to compute the st_blksizes.
There is one drawback: since sbspace() will only ever return 0 or the maximum, sosend_generic will allow the sockbuf to exceed its nominal maximum size by at most one packet of size less than the max. I don't think that's a serious problem. In fact, I'm not even positive that FreeBSD guarantees a socket will always stay within its nominal size limit.
sys/sys/sockbuf.h Add the SB_STOP flag and adjust sbspace()
sys/sys/unpcb.h Delete the obsolete unp_cc and unp_mbcnt fields from struct unpcb.
sys/kern/uipc_usrreq.c Adjust uipc_rcvd, uipc_send, and uipc_sense to use the SB_STOP backpressure mechanism. Removing obsolete unpcb fields from db_show_unpcb.
tests/sys/kern/unix_seqpacket_test.c Clear expected failures from ATF.
Obtained from: DragonFly BSD PR: kern/185812 Reviewed by: silence from freebsd-net@ and rwatson@ MFC after: 3 weeks Sponsored by: Spectra Logic Corporation
|
262894 |
07-Mar-2014 |
asomers |
kern/Makefile Set WARNS=5 for all files in this directory
kern/unix_seqpacket_test.c Fix compiler warnings. Most were benign, but rcvbuf_oversized wasn't working as intended because I forgot to set the buffer sizes.
MFC after: 2 weeks Reported by: pho Sponsored by: Spectra Logic Corporation
|
262868 |
06-Mar-2014 |
asomers |
Only use -lpthread for unix_seqpacket_test, not for all test programs.
Reported by: Garrett Cooper MFC after: 3 weeks Sponsored by: Spectra Logic Corporation
|
262867 |
06-Mar-2014 |
asomers |
Fix PR kern/185813 "SOCK_SEQPACKET AF_UNIX sockets with asymmetrical buffers drop packets". It was caused by a check for the space available in a sockbuf, but it was checking the wrong sockbuf.
sys/sys/sockbuf.h sys/kern/uipc_sockbuf.c Add sbappendaddr_nospacecheck_locked(), which is just like sbappendaddr_locked but doesn't validate the receiving socket's space. Factor out common code into sbappendaddr_locked_internal(). We shouldn't simply make sbappendaddr_locked check the space and then call sbappendaddr_nospacecheck_locked, because that would cause the O(n) function m_length to be called twice.
sys/kern/uipc_usrreq.c Use sbappendaddr_nospacecheck_locked for SOCK_SEQPACKET sockets, because the receiving sockbuf's size limit is irrelevant.
tests/sys/kern/unix_seqpacket_test.c Now that 185813 is fixed, pipe_128k_8k fails intermittently due to 185812. Make it fail every time by adding a usleep after starting the writer thread and before starting the reader thread in test_pipe. That gives the writer time to fill up its send buffer. Also, clear the expected failure message due to 185813. It actually said "185812", but that was a typo.
PR: kern/185813 Reviewed by: silence from freebsd-net@ and rwatson@ MFC after: 3 weeks Sponsored by: Spectra Logic Corporation
|
262781 |
05-Mar-2014 |
pho |
Preserve naming consistency for test cases.
Pointed out by: jmmv Sponsored by: EMC / Isilon storage division
|
262730 |
04-Mar-2014 |
pho |
Changed name of test case to a more descriptive one and moved comment to the "descr" property.
Suggested by: jmmv Sponsored by: EMC / Isilon storage division
|
262526 |
26-Feb-2014 |
pho |
Added a regression test for r234131.
Discussed with: asomers Sponsored by: EMC / Isilon storage division
|
262133 |
17-Feb-2014 |
asomers |
test_eagain_*_* should've been using nonblocking sockets instead of blocking sockets. The error was not exposed as long as the kernel suffered from PR kern/185812. Now corrected, these tests pass on DragonFlyBSD 3.6.0.
PR: kern/185812 Sponsored by: Spectra Logic Corporation MFC after: 2 weeks
|
261081 |
23-Jan-2014 |
asomers |
Replace the old unix_seqpacket and unix_seqpacket_exercise tests, which were a little broken and not automatable, with unix_seqpacket_test. It's coverage is a superset of the old tests and it uses ATF. It includes test cases for bugs kern/185813 and kern/185812.
PR: kern/185812 PR: kern/185813 Sponsored by: Spectra Logic MFC after: 2 weeks
|