Commit Graph

3264 Commits

Author SHA1 Message Date
kamil e884bc2dfc Correct another string about securelevel in t_ptrace
Change:
    Test must be run with securelevel >= 1

To:
    Test must be run with securelevel >= 0

In attach_pid1_securelevel.

Sponsored by <The NetBSD Foundation>
2017-04-02 00:06:09 +00:00
kamil bce52e0028 Deduplicate code in step* tests in t_ptrace_wait*
No functional change.

Sponsored by <The NetBSD Foundation>
2017-04-02 00:03:40 +00:00
kamil 5ab466b502 Correct securelevel in attach_pid1_securelevel
Assert that a debugger cannot attach to PID 1 with securelevel >= 0
(as root) instead of >= 1.

Sponsored by <The NetBSD Foundation>
2017-04-01 23:51:27 +00:00
kamil c0d49dc8aa Try to fix Clang/LLVM build
Initialize a local variable.
2017-04-01 23:28:02 +00:00
kamil d412f5ec32 Refactor dbregs_dr*_dont_inherit_execve ATF tests for x86/
Eliminate duplicated code.

Sponsored by <The NetBSD Foundation>
2017-04-01 23:25:08 +00:00
martin 75bf572ad0 Make the mutex6 test (which fails every know and then, but too rarely
to actually debug it) print some debug info when failing.
2017-04-01 17:19:40 +00:00
ozaki-r eb849f3e8d Add test cases for ping options 2017-03-31 06:41:40 +00:00
kamil 0a45c98ca6 Remove deuplicated code in dbregs_dr[01234]_dont_inherit_lwp
Currently remove tests for dbregs_dr[67]_dont_inherit_lwp.

Sponsored by <The NetBSD Foundation>
2017-03-30 20:24:35 +00:00
kamil 04aac12dac Eliminate code duplication in the x86 dbregs_dr[0123]_trap_variable* tests
This is work in progress to remove no longer needed code overhead shared
between tests.

Sponsored by <The NetBSD Foundation>
2017-03-30 02:17:38 +00:00
kamil f0df2ef69f Deduplicate shared code in dbregs_preserve_dr[0123]{,_yield,_continued}
Move common function code into shared subroutine.

While there remove checks for defined(HAVE_DBREGS). All x86 ports offer
debug register accessors.

Sponsored by <The NetBSD Foundation>
2017-03-29 23:50:09 +00:00
kamil a730799971 Explain expected behavior for PTRACE_FORK events in t_ptrace_wait*
PR kern/52117 ptrace(2) PTRACE_FORK fails on some platforms

Add message similar to:
    We expect two SIGTRAP events, for child 22199 (TRAP_CHLD,
    pe_report_event=PTRACE_FORK, state.pe_other_pid=child2) and for child2
    (TRAP_CHLD, pe_report_event=PTRACE_FORK, state.pe_other_pid=child)

This should make the expected behavior more clear.

Sponsored by <The NetBSD Foundation>
2017-03-28 13:16:30 +00:00
kamil 203a7bc419 Mark PT_STEP tests in t_ptrace_wait* as broken on ARM
There is a definition of PT_STEP for userland, but no implementation
in the kernel.

PR kern/52119 PT_STEP not supported on arm 32-bit

Sponsored by <The NetBSD Foundation>
2017-03-28 12:39:07 +00:00
kamil 5f3e805bbe Set timeout expected in resume1 (t_ptrace_wait*)
Mark timeout for this test 5 sec. It sometimes works sometimes does not.

Add a local sleep(3) at the end to get consisten report about timeouting
always.

PR kern/51995

Sponsored by <The NetBSD Foundation>
2017-03-28 03:19:20 +00:00
kamil b97ce90e99 Mark fork1 and siginfo5 as broken on sparc, sparc64, evbarm and alpha
PR kern/52117 ptrace(2) PTRACE_FORK fails on some platforms

These tests work on amd64, i386 and xen.

They are part of t_ptrace_wait*.

Sponsored by <The NetBSD Foundation>
2017-03-28 03:03:15 +00:00
kamil 501e6bc911 Optimize signal6 in t_ptrace_wait
Reduce timeout to 5 seconds. This tests timeouts and this change saves
time.

PR kern/51918

Sponsored by <The NetBSD Foundation>
2017-03-28 01:40:39 +00:00
ozaki-r 16ca3747e1 Use the utility functions for rump_server 2017-03-28 01:27:46 +00:00
kamil c6dfd176d2 Mark signal6 as failing due to timeout not regular failure
This test is marked as PR kern/51918.

Timeout has been reported on i386, amd64, alpha, sparc, sparc64, evbarm.
xen.

Sponsored by <The NetBSD Foundation>
2017-03-28 01:00:33 +00:00
maya daa855846a Add failing test cases for PRs kern/2423, kern/3645, kern/4597 2017-03-26 18:26:05 +00:00
skrll 8ff4d6477a kern/52012 kern/52018 kern/52019 were all fixed by christos 2017-03-25 10:07:55 +00:00
pgoyette b57579c759 Rather than ghecking system global state to see if mprotect might be
enabled, use the newly-committed sysctl proc.curproc.paxflags variable
2017-03-25 01:39:20 +00:00
martin 426774e5a3 Do not toggle global security.pax.mprotect state in an attempt to
activate it for the current process. It does not work and tests should
not change global system state anyway.
Instead: skip the test is pax.mprotect is not globally enabled. We could
use a better check for this (querying the current processes pax flags),
but unfortunately we don't have one.
2017-03-24 08:18:27 +00:00
ozaki-r 33479c318b Fix typo 2017-03-24 04:06:19 +00:00
ozaki-r 0cc8b50659 Add test cases for PR kern/52077
From s-yamaguchi@IIJ
2017-03-24 03:47:25 +00:00
martin 44424683d9 Avoid using an uninitialized mutex. 2017-03-23 08:31:00 +00:00
martin 05ad4681cb Do not assume anything about the pseudo-disklabel of a completely zeroed
disk image. Use the raw partition and newfs -I instead.
2017-03-23 08:18:17 +00:00
jdolecek 1e4f0c4e55 add tests for the mount update from rw to rw+log, which used to case the panic
reported in PR kern/52056
2017-03-22 21:33:06 +00:00
martin defea524bf Skip the "migrate" test on architectures not natively using MBR, it
can not work there.
2017-03-22 19:13:40 +00:00
ozaki-r e6b76a5e72 Add some tests to change flags of routes 2017-03-22 06:30:00 +00:00
kre 992d3e66d8 Fix typo in a comment. 2017-03-22 05:35:33 +00:00
kre 08844cd91f Add tests for "12 noon", "12 midnight". 2017-03-22 01:50:22 +00:00
kre f8f91559ae Since PR lib/52101 is now fixed, the tests for its bug should no longer fail. 2017-03-22 01:00:19 +00:00
kre 10db8f184b Fix a typo - it doesn't matter now, as the test fails anyway, but
it will matter when parsedate is fixed and the test is supposed to
succeed.
2017-03-21 21:42:18 +00:00
kre 0c8a4b80f9 PR lib/52101
Add 6 extra tests for the 12am/12pm bug - all currently expected to fail.
(That is, 6 subtests of the "times" test will fail, all new ones)>

While here, when parsedate() fails (returns -1) avoid converting that
failure value (-1) to a struct tm (1969-12-31T23:59:59 UTC) and then
comparing the values with those expected by the test, and complaining
about all of those (where ANY was not permitted) that don't match...
2017-03-21 20:06:27 +00:00
ozaki-r 3772aa0189 Add a test case for PR kern/52083 2017-03-21 04:03:17 +00:00
kre a787cac634 PR bin/52090 - the $* tests are no longer expected to fail. 2017-03-20 11:48:41 +00:00
kre 0c0af3f55d Add tests for the $(( )) assignment operators PR bin/50958 2017-03-20 11:32:51 +00:00
kre 86dd15a646 PR bin/52090
Add 5 new test cases to test various ways that $* can be expanded.
Currently 3 of the 5 are marked as "expected to fail" because of the
bug in this PR.
2017-03-19 20:29:30 +00:00
ozaki-r bb335adb69 Add a test case of ifconfig <if_index>
I don't know if <if_index> is expected to be accepted instead of
an interface name. Please update the test case if the behavior is
just a bug and ifconfig gets fixed.
2017-03-16 09:43:56 +00:00
martin 55e87a2ae4 Do not assume an all-zeroes disk label will read back as a disk with
an 'a'  partition covering the whole disk, instead use the raw partition.
Also skip this test if the fss device is not available.
With lots of help from pgoyette.
2017-03-15 10:53:15 +00:00
kre 706a2d4f09 Add new test case in to check (coming) bug fix for newly discovered
ash based shell bug
	echo ${unset_var##$(echo a)}$(echo b)
should say "b" but instead says "a" ... the first "echo a" is not
evaluated because it cannot possibly match an unset variable, but is
not removed from the list of command substitutions, when the shell
needs to execute the 2nd cmdsub, "echo b" should be at the head of
the list, but isn't, "echo a" is still there...

This test should fail (for now) - should show 4 of 40 subtests failing.
It isn't marked as atf_expect_fail as the fix for this will be coming
later today (I will just wait at least 1 b5 build cycle so the failure
can be observed).

Detecting the bug, and the fix, are from FreeBSD.
2017-03-12 00:39:47 +00:00
ozaki-r ccc1fa9d34 Separate tests for learning table of bridge 2017-03-11 04:24:52 +00:00
ozaki-r 24d1e180c8 Improve test stability and output messages on failure 2017-03-11 02:01:10 +00:00
ozaki-r d2352b812f Improve test stability and output messages on failure 2017-03-08 05:30:56 +00:00
christos 48c8a60c2e new test 2017-03-06 23:07:42 +00:00
christos 47f9cf0422 add builtin_offsetof 2017-03-06 21:02:47 +00:00
christos b811ddbd72 add a test for a typeof cast 2017-03-06 12:00:27 +00:00
ozaki-r 0ada8502a1 Add a test case for net.inet.ip.mtudisctimeout
The test case just reproduces PR kern/52029 and needs more tests.
2017-03-06 07:33:27 +00:00
ozaki-r b9b3014049 Fix ONEDAYISH; it can be followed by one extra space 2017-03-06 07:15:47 +00:00
chs 36c31375b6 reenable mutex2 and mutex3 on powerpc now that PR 44387 is fixed. 2017-03-05 16:08:23 +00:00
chs bdc7894921 reenable sigfpe_flt on powerpc now that FPU exceptions work. 2017-03-05 16:07:38 +00:00
kre 1cd3fe6ea7 Since it is unlikely that any of this really wants to test whether
[v]fork() produces pid==1 (init) (if it were useful to test that, an
entirely different test would be appropriate) change the tests so
they check for [v]fork() failure, as probably intended, instead.
2017-03-03 12:23:26 +00:00
ozaki-r 8155a2ae5c Provide a more robust regexp for time formats of 1day-ish 2017-03-03 07:34:04 +00:00
kamil 81ccb321cb Mark syscall1 broken in t_ptrace_wait*
Mark this test broken with kern/52012 as the tracee does not stop on syscall
entry. Check for siginfo(2) in syscall1 and unveil two new bugs.

PR kern/52012: PT_SYSCALL does not stop on syscall entry
PR kern/52018: ptrace(2) PT_SYSCALL generates SIGTRAP without si_code
PR kern/52019: ptrace(2) PT_SYSCALL generate SIGTRAP to the parent but
               returns SIGSTOP in PT_GET_SIGINFO

Sponsored by <The NetBSD Foundation>
2017-03-01 08:05:15 +00:00
kamil ad0426b8f6 Mark resume1 and syscallemu1 tests broken in t_ptrace_wait*
resume1:
    PR kern/51995 ptrace(2) PT_RESUME is not reliable

syscallemu1:
    PR kern/52012 PT_SYSCALL does not stop on syscall entry

Sponsored by <The NetBSD Foundation>
2017-02-28 13:29:52 +00:00
kamil d2c80310bc Add new test syscallemu1 in t_ptrace_wait*
syscallemu1:
    Verify that exit(2) can be intercepted with PT_SYSCALLEMU

This test is failing as PT_SYSCALL does not stop the process on syscall
entry. This renders PT_SYSCALL broken on NetBSD.

Sponsored by <The NetBSD Foundation>
2017-02-28 13:19:50 +00:00
ozaki-r d9193815d7 Add tests that destroy an interface while the mcast program is running 2017-02-28 09:23:23 +00:00
ozaki-r 9e51ae8639 Add tests for loopback interface 2017-02-28 03:32:11 +00:00
chs 2fafd8552f check the lower bits of the stack pointer,
not the lower bits of the upper half of the stack pointer.
2017-02-27 20:22:32 +00:00
ozaki-r 5ca786c5d4 Make CARP on IPv6 work
It passes ATF tests but no more, no less.
2017-02-27 08:26:53 +00:00
ozaki-r 0dff263b68 Test handovers on interface down as well as server halt 2017-02-27 07:25:59 +00:00
ozaki-r d547401b55 Add a test case for CARP on IPv6
The test case fails expectedly because the implementation of CARP on IPv6
is incomplete yet.
2017-02-27 07:24:26 +00:00
christos e89750009c kill stray q 2017-02-25 18:18:29 +00:00
christos 5661ffc1f0 make bitfields unsigned 2017-02-25 16:45:24 +00:00
kamil 5447864424 Add new test syscall1 in t_ptrace_wait*
syscall1:
    Verify that getpid(2) can be traced with PT_SYSCALL

Enforce usage of syscall(2), it should prevent failing on any possible
optimizations in future as a libc can ship this information not through
syscall (shared struct with kernel or similar).

Sponsored by <The NetBSD Foundation>
2017-02-24 06:17:48 +00:00
kre 71b606ef4e Drop the test for QEMU and instead skip relevant tests when /dev/mixer
can't be opened (which more accurately reflects when mixerctl is going
to fail...)

Based upon an idea from Andreas Gustafsson (gson@) - except that using
/dev/audio0 for this purpose doesn't work, if the only audio device
configured is pad0 an open of audio fails with EIO (???)

While here, perpare for the updated mixerctl coming soon to a repository
near you...
	Use correct usage in the test of a bogus -d arg (otherwise the
		new mixerctl will complain about usage, and never even
		attempt to open the bogus device)
	Don't require /dev/mixer for the noargs -> generate usage msg
		test ... this will now generate a failing test with the
		old mixerctl if there is no working /dev/mixer, but
		that mixerctl won't be around much longer.
2017-02-23 14:01:37 +00:00
kre 700ea9d267 Limit previous to the i386 qemu kernels, the tests work on amd64 and sparc
(which have some audio configured.)
2017-02-23 02:28:10 +00:00
kre e4eeed67d9 Skip most of the mixerctl tests when running under QEMU (assumed to be for ATF)
as the kernel that runs them has no audio (and no mixers) configured.

The usage message test might be returned some day if /usr/bin/mixerctl
gets modified so it doesn't attempt to open the device (and error out)
in cases where the device isn't actually going to be used (and -d wasn't
given to set the device name explicitly).
2017-02-23 02:09:24 +00:00
kamil fb0af2ac33 Improve PT_SET_SIGMASK and PT_GET_SIGMASK API in ptrace(2)
Use proper check for LW_SYSTEM, don't depend on PT_GETREGS/PT_SETREGS.
Don't allow to mask SA_CANTMASK signals with PT_SET_SIGMASK (this covers
SIGSTOP and SIGKILL).

Add new ATF tests:
 - setsigmask5
   Verify that sigmask cannot be set to SIGKILL

 - setsigmask6
   Verify that sigmask cannot be set to SIGSTOP

Sponsored by <The NetBSD Foundation>
2017-02-23 00:50:09 +00:00
kamil f9b2093d06 Introduce new ptrace(2) API to allow/prevent exection of LWP
Introduce new API for debuggers to allow/prevent execution of the specified
thread.

New ptrace(2) operations:

     PT_RESUME     Allow execution of a specified thread, change its state
                   from suspended to continued.  The addr argument is unused.
                   The data argument specifies the LWP ID.

                   This call is equivalent to _lwp_continue(2) called by a
                   traced process.  This call does not change the general
                   process state from stopped to continued.

     PT_SUSPEND    Prevent execution of a specified thread, change its state
                   from continued to suspended.  The addr argument is unused.
                   The data argument specifies the requested LWP ID.

                   This call is equivalent to _lwp_suspend(2) called by a
                   traced process.  This call does not change the general
                   process state from continued to stopped.

This interface is modeled after FreeBSD, however with NetBSD specific arguments
passed to ptrace(2) -- FreeBSD passes only thread id, NetBSD passes process and
thread id.

Extend PT_LWPINFO operation in ptrace(2) to report suspended threads. In the
ptrace_lwpinfo structure in pl_event next to PL_EVENT_NONE and PL_EVENT_SIGNAL
add new value PL_EVENT_SUSPENDED.

Add new errno(2) value EDEADLK that might be returned by ptrace(2). It prevents
dead-locking in a scenario of resuming a process or thread that is prevented
from execution. This fixes bug that old API was vulnerable to this scenario.

Kernel bump delayed till introduction of PT_GETDBREGS/PT_SETDBREGS soon.

Add new ATF tests:
 - resume1
   Verify that a thread can be suspended by a debugger and later
   resumed by the debugger

 - suspend1
   Verify that a thread can be suspended by a debugger and later
   resumed by a tracee

 - suspend2
   Verify that the while the only thread within a process is
   suspended, the whole process cannot be unstopped

Sponsored by <The NetBSD Foundation>
2017-02-22 23:43:43 +00:00
maya c3094abd94 GC more gcc 4.8 specific (dead) logic 2017-02-22 12:34:49 +00:00
ozaki-r 9e6e8d7cf9 Add tests for expiration of default router and prefix entries 2017-02-22 03:03:37 +00:00
kamil b4bf2c1aa5 Add kernel/arch/x86 ATF tests for CPU Debug Registers for amd64 and i386
This moves kernel/arch/amd64 tests, the ones to be shared between amd64 and
i386, into kernel/arch/x86. This covers all Debug Register tests.

kernel/arch/amd64 is reduced to regs1
kernel/arch/i386 is reduced to regs1

kernel/arch/x86 tests:
 - dbregs_print
 - dbregs_preserve_dr0
 - dbregs_preserve_dr1
 - dbregs_preserve_dr2
 - dbregs_preserve_dr3
 - dbregs_preserve_dr0_yield
 - dbregs_preserve_dr1_yield
 - dbregs_preserve_dr2_yield
 - dbregs_preserve_dr3_yield
 - dbregs_preserve_dr0_continued
 - dbregs_preserve_dr1_continued
 - dbregs_preserve_dr2_continued
 - dbregs_preserve_dr3_continued
 - dbregs_dr0_trap_variable_writeonly_byte
 - dbregs_dr1_trap_variable_writeonly_byte
 - dbregs_dr2_trap_variable_writeonly_byte
 - dbregs_dr3_trap_variable_writeonly_byte
 - dbregs_dr0_trap_variable_writeonly_2bytes
 - dbregs_dr1_trap_variable_writeonly_2bytes
 - dbregs_dr2_trap_variable_writeonly_2bytes
 - dbregs_dr3_trap_variable_writeonly_2bytes
 - dbregs_dr0_trap_variable_writeonly_4bytes
 - dbregs_dr1_trap_variable_writeonly_4bytes
 - dbregs_dr2_trap_variable_writeonly_4bytes
 - dbregs_dr3_trap_variable_writeonly_4bytes
 - dbregs_dr0_trap_variable_readwrite_write_byte
 - dbregs_dr1_trap_variable_readwrite_write_byte
 - dbregs_dr2_trap_variable_readwrite_write_byte
 - dbregs_dr3_trap_variable_readwrite_write_byte
 - dbregs_dr0_trap_variable_readwrite_write_2bytes
 - dbregs_dr1_trap_variable_readwrite_write_2bytes
 - dbregs_dr2_trap_variable_readwrite_write_2bytes
 - dbregs_dr3_trap_variable_readwrite_write_2bytes
 - dbregs_dr0_trap_variable_readwrite_write_4bytes
 - dbregs_dr1_trap_variable_readwrite_write_4bytes
 - dbregs_dr2_trap_variable_readwrite_write_4bytes
 - dbregs_dr3_trap_variable_readwrite_write_4bytes
 - dbregs_dr0_trap_variable_readwrite_read_byte
 - dbregs_dr1_trap_variable_readwrite_read_byte
 - dbregs_dr2_trap_variable_readwrite_read_byte
 - dbregs_dr3_trap_variable_readwrite_read_byte
 - dbregs_dr0_trap_variable_readwrite_read_2bytes
 - dbregs_dr1_trap_variable_readwrite_read_2bytes
 - dbregs_dr2_trap_variable_readwrite_read_2bytes
 - dbregs_dr3_trap_variable_readwrite_read_2bytes
 - dbregs_dr0_trap_variable_readwrite_read_4bytes
 - dbregs_dr1_trap_variable_readwrite_read_4bytes
 - dbregs_dr2_trap_variable_readwrite_read_4bytes
 - dbregs_dr3_trap_variable_readwrite_read_4bytes
 - dbregs_dr0_trap_code
 - dbregs_dr1_trap_code
 - dbregs_dr2_trap_code
 - dbregs_dr3_trap_code
 - dbregs_dr0_dont_inherit_lwp
 - dbregs_dr1_dont_inherit_lwp
 - dbregs_dr2_dont_inherit_lwp
 - dbregs_dr3_dont_inherit_lwp
 - dbregs_dr6_dont_inherit_lwp
 - dbregs_dr7_dont_inherit_lwp
 - dbregs_dr0_dont_inherit_execve
 - dbregs_dr1_dont_inherit_execve
 - dbregs_dr2_dont_inherit_execve
 - dbregs_dr3_dont_inherit_execve
 - dbregs_dr6_dont_inherit_execve
 - dbregs_dr7_dont_inherit_execve

Sponsored by <The NetBSD Foundation>
2017-02-22 01:07:13 +00:00
kre 697c0e2acf Ugh... fix a last minute fix that went horribly wrong! 2017-02-21 21:22:45 +00:00
kre 67cef682dd PR bin/50934
Add a test program for the bug described in this PR.
This is the first pkill/pgrep/prenice test (more would be good!)

This test has been confirmed to work once the bug described in the PR
has been fixed, so the test is not marked "expected to fail" even
though initially that is what should happen.

Note: the test cana also fail if the system running the tests happens
to be running processes with names that match the patterns searched for
by the test, other than the test program itself.  This is expected to be
unlikely.
2017-02-21 10:40:30 +00:00
kamil 10e522e132 Add new tests dbregs_dr*_dont_inherit_execve in arch/amd64
Added tests:
 - dbregs_dr0_dont_inherit_execve
 - dbregs_dr1_dont_inherit_execve
 - dbregs_dr2_dont_inherit_execve
 - dbregs_dr3_dont_inherit_execve
 - dbregs_dr6_dont_inherit_execve
 - dbregs_dr7_dont_inherit_execve

Debug Registers must no be inherited after exec() call.

Sponsored by <The NetBSD Foundation>
2017-02-21 08:40:16 +00:00
ozaki-r c1421f792c Add basic tests for forwarding fragmented packets 2017-02-20 09:58:58 +00:00
ozaki-r bed60eb03f Add simple tests of behaviors of alias addresses 2017-02-20 09:00:08 +00:00
kamil 2473483dae Protect dbregs_dr*_dont_inherit_lwp in arch/amd64 with HAVE_DBREGS
The code for debug registers isn't in HEAD and it might break the build.

Sponsored by <The NetBSD Foundation>
2017-02-20 06:48:49 +00:00
kamil 69781b08f0 Add new tests dbregs_dr[67]_dont_inherit_lwp in arch/amd64
New tests:
 - dbregs_dr6_dont_inherit_lwp
 - dbregs_dr7_dont_inherit_lwp

Debug Registers are set always per-LWP and they are never inherited.
If a user wants to reuse them, there is need to set trap on thread creation
(PTRACE_LWP_CREATE) and set them from a debugger on newly created LWP.

Sponsored by <The NetBSD Foundation>
2017-02-20 06:18:48 +00:00
kamil 89cfb5786e Fix more issues with compat to i386 in arch/amd64 tests for Debug Registers
Stop compating the number of available registers with 16, it's amd64
specific. i386 ships with 8 Debug Registers.

Sponsored by <The NetBSD Foundation>
2017-02-20 05:47:59 +00:00
kamil 87307ca799 Add new tests dbregs_dr*_dont_inherit_lwp and improve i386 compat
Add new tests:
 - dbregs_dr0_dont_inherit_lwp
 - dbregs_dr1_dont_inherit_lwp
 - dbregs_dr2_dont_inherit_lwp
 - dbregs_dr3_dont_inherit_lwp

Fix memcmp(3) usage when comparing registers. Comparing with len is
incorrect as it should be len*sizeof(register) or just sizeof(registers).

Don't check for 16 Debug Registers, it's amd64 specific and not portable
to i386.

Don't compare registers before and after triggering a trap, it's a bug that
was hidden by incorrect usage of memcmp(3).

Sponsored by <The NetBSD Foundation>
2017-02-20 05:40:51 +00:00
kamil 6a2fda314b Add new tests dbregs_dr[0123]_trap_code in arch/amd64
Add new tests:
 - dbregs_dr0_trap_code
 - dbregs_dr1_trap_code
 - dbregs_dr2_trap_code
 - dbregs_dr3_trap_code

This is the final set of tests for trap types that are supposed to be
supported by all amd64 CPUs.

Traps for code (instruction) execution must be set to 1 byte, otherwise
they are undefined. x86 code traps must point to the first byte of an
instruction.

Sponsored by <The NetBSD Foundation>
2017-02-20 02:56:03 +00:00
kamil 29b683511e Add new tests dbregs_dr*_trap_variable_readwrite_read_*byte* in arch/amd64
Add new tests:
 - dbregs_dr0_trap_variable_readwrite_read_byte
 - dbregs_dr1_trap_variable_readwrite_read_byte
 - dbregs_dr2_trap_variable_readwrite_read_byte
 - dbregs_dr3_trap_variable_readwrite_read_byte
 - dbregs_dr0_trap_variable_readwrite_read_2bytes
 - dbregs_dr1_trap_variable_readwrite_read_2bytes
 - dbregs_dr2_trap_variable_readwrite_read_2bytes
 - dbregs_dr3_trap_variable_readwrite_read_2bytes
 - dbregs_dr0_trap_variable_readwrite_read_4bytes
 - dbregs_dr1_trap_variable_readwrite_read_4bytes
 - dbregs_dr2_trap_variable_readwrite_read_4bytes
 - dbregs_dr3_trap_variable_readwrite_read_4bytes

Sponsored by <The NetBSD Foundation>
2017-02-20 01:34:53 +00:00
kamil 6b2b7082a4 Add new tests dbregs_dr*_trap_variable_readwrite_write_*byte* in arch/amd64
Add new tests:
 - dbregs_dr0_trap_variable_readwrite_write_byte
 - dbregs_dr1_trap_variable_readwrite_write_byte
 - dbregs_dr2_trap_variable_readwrite_write_byte
 - dbregs_dr3_trap_variable_readwrite_write_byte
 - dbregs_dr0_trap_variable_readwrite_write_2bytes
 - dbregs_dr1_trap_variable_readwrite_write_2bytes
 - dbregs_dr2_trap_variable_readwrite_write_2bytes
 - dbregs_dr3_trap_variable_readwrite_write_2bytes
 - dbregs_dr0_trap_variable_readwrite_write_4bytes
 - dbregs_dr1_trap_variable_readwrite_write_4bytes
 - dbregs_dr2_trap_variable_readwrite_write_4bytes
 - dbregs_dr3_trap_variable_readwrite_write_4bytes

Sponsored by <The NetBSD Foundation>
2017-02-20 01:21:47 +00:00
kamil ef053d8fe1 Extend dbregs_dr*_trap_variable tests to 1-2-4 byte traps in arch/amd64
Replace the following tests:
 - dbregs_dr0_trap_variable
 - dbregs_dr1_trap_variable
 - dbregs_dr2_trap_variable
 - dbregs_dr3_trap_variable

With new ones:
 - dbregs_dr0_trap_variable_writeonly_byte
 - dbregs_dr1_trap_variable_writeonly_byte
 - dbregs_dr2_trap_variable_writeonly_byte
 - dbregs_dr3_trap_variable_writeonly_byte
 - dbregs_dr0_trap_variable_writeonly_2bytes
 - dbregs_dr1_trap_variable_writeonly_2bytes
 - dbregs_dr2_trap_variable_writeonly_2bytes
 - dbregs_dr3_trap_variable_writeonly_2bytes
 - dbregs_dr0_trap_variable_writeonly_4bytes
 - dbregs_dr1_trap_variable_writeonly_4bytes
 - dbregs_dr2_trap_variable_writeonly_4bytes
 - dbregs_dr3_trap_variable_writeonly_4bytes

All tests pass with my local implementation of debug registers. Once the
interface will be verified, I will prepare it for commit to HEAD.

Sponsored by <The NetBSD Foundation>
2017-02-19 23:58:30 +00:00
kamil ca883d3170 Add checks for si_code in dbregs_dr[0123]_trap_variable in ATF arch/amd64
Validate that debug register traps generate appropriate SIGTRAP signal with
TRAP_DBREG property in si_code.

Sponsored by <The NetBSD Foundation>
2017-02-19 22:09:29 +00:00
kamil 59fed38a43 Synchronize struct dbreg with FreeBSD - rename field member .dbregs to .dr
Currently this code is disabled in HEAD and the dbreg struct has to be
committed first in order to be used. Before enabling it I'm working on
reducing needless differences with FreeBSD and Linux.

Sponsored by <The NetBSD Foundation>
2017-02-18 04:30:34 +00:00
kamil 38578ed3f8 Fix dbregs_dr[0123]_trap_variable in arch/amd64/t_ptrace_wait*
Add missing PT_CONTINUE between two wait(2)-like calls.

Sponsored by <The NetBSD Foundation>
2017-02-18 02:28:21 +00:00
ozaki-r edc02e28f0 Make the test more stable 2017-02-17 00:51:52 +00:00
ozaki-r d1c5314c1f Make test names self-descriptive 2017-02-17 00:51:25 +00:00
kamil 0c10bdf293 Switch back arch/amd64/t_ptrace_wait.c to r1.6 and restore original DBREGS
This is preparation to replace watchpoint API to dbregs.

Sponsored by <The NetBSD Foundation>
2017-02-16 15:57:45 +00:00
knakahara abf7aa227e add l2tp(4) basic test. 2017-02-16 08:44:47 +00:00
ozaki-r f5b4d3a19e Use nc instead of ftp/httpd
ftp with rumphijack is unstable probably because ftp uses siglongjmp from
a signal hander. So stop using ftp and use nc instead. This fixes test
failures of t_mtudisc on some environments such as my development machine
(amd64) and anita on sparc64.
2017-02-16 08:12:47 +00:00
kamil f0303273a0 Reintroduce ATF_TP_ADD_TC_HAVE_DBREGS for t_ptrace_wait* ATF tests
PT_GETDBREGS & PT_SETDBREGS API will replace the current one for
watchpoints.

Sponsored by <The NetBSD Foundation>
2017-02-15 20:58:22 +00:00
ozaki-r 38a4600920 Add tests for ifconfig up/down 2017-02-14 08:43:06 +00:00
kamil 61aff29627 Introduce new interface in ptrace(2) - PT_GET_SIGMASK and PT_SET_SIGMASK
Add new interface to add ability to get/set signal mask of a tracee.
It has been inspired by Linux PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, but
adapted for NetBSD API.

This interface is used for checkpointing software to set/restore context
of a process including signal mask like criu or just to track this property
in reverse-execution software like Record and Replay Framework (rr).


Add new ATF tests for this interface
====================================
getsigmask1:
    Verify that plain PT_SET_SIGMASK can be called

getsigmask2:
    Verify that PT_SET_SIGMASK reports correct mask from tracee

setsigmask1:
    Verify that plain PT_SET_SIGMASK can be called with empty mask

setsigmask2:
    Verify that sigmask is preserved between PT_GET_SIGMASK and
    PT_SET_SIGMASK

setsigmask3:
    Verify that sigmask is preserved between PT_GET_SIGMASK, process
    resumed and PT_SET_SIGMASK

setsigmask4:
    Verify that new sigmask is visible in tracee


Kernel ABI bump delayed as there are more interfaces to come in ptrace(2).

Sponsored by <The NetBSD Foundation>
2017-02-12 06:09:52 +00:00
christos 5b7d8aad4e remove exect, it will not be fixed and it will be removed. 2017-02-09 03:27:07 +00:00
ozaki-r 22c2d28c4e Add tests for several bpf ioctls 2017-02-09 02:18:13 +00:00
kamil 0892a29a1a libpthread_dbg(3) deletion from the base distribution
libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>
2017-02-08 03:44:40 +00:00
martin 06d5dce161 PR kern/51762: add a test program 2017-02-02 22:07:05 +00:00
martin 384970d9ee Restrict special mode/owner settings to truncate_test.root_owned;
otherwise the Atffile will be generated unreadable for group/others
as well.
2017-02-01 10:18:27 +00:00
ozaki-r b1bee1e6b4 Add a test case for BIOCGBLEN and BIOCSBLEN 2017-02-01 08:04:49 +00:00
christos c0d019d153 add extra file. 2017-02-01 00:47:56 +00:00
kamil be61ec4715 Remove debug printf(3)
No functional change.

Sponsored by <The NetBSD Foundation>
2017-01-27 16:43:07 +00:00
kamil 71f5b91f6d Add new tests signal{9,10} in t_ptrace_wait{,3,4,6,id,pid}
signal9:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_LWP_CREATE breakpoint

signal10:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_LWP_EXIT breakpoint

Both tests are broken and linked with PR kern/51918.

Sponsored by <The NetBSD Foundation>
2017-01-27 16:35:47 +00:00
kamil a7e8e90e67 Add new test signal8 in t_ptrace_wait{,3,4,6,id,pid}
signal8:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_VFORK_DONE breakpoint

This test is marked as broken and linked with PR kern/51918.

Sponsored by <The NetBSD Foundation>
2017-01-27 16:06:23 +00:00
hannken a9f23b81d0 Add test for read/write to readonly update mount. 2017-01-27 10:45:11 +00:00
nat 712047004e Revert to previous. Audio passes the test properly again. 2017-01-27 05:14:54 +00:00
kamil fa3933b2b8 Add new tests signal[67] in t_ptrace_wait{4,6,id,pid}
signal6:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_FORK breakpoint

signal7:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_VFORK breakpoint

signal6 fails due to PR kern/51918
signal6 fails due to PR kern/51918 and PR kern/51630

Sponsored by <The NetBSD Foundation>
2017-01-27 00:34:52 +00:00
kamil ac522b683c Add new test signal5 in t_ptrace_wait{,3,4,6,id,pid}
signal5:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching exec() breakpoint

signal5 is failing and linked with PR kern/51918

Sponsored by <The NetBSD Foundation>
2017-01-26 22:46:19 +00:00
kamil a34102a3aa Add new test signal4 in t_ptrace_wait{,3,4,6,id,pid}
signal4:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching single step trap

signal4 is marked as failing and referenced with PR kern/51918.

Sponsored by <The NetBSD Foundation>
2017-01-26 22:32:48 +00:00
kamil a17a9cedbb Add new tests signal[23] in t_ptrace_wait{,3,4,6,id,pid}
signal2:
    Verify that masking SIGTRAP in tracee stops tracer from
    catching this raised signal

signal3:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching software breakpoints

signal3 is marked as failing and refrenced with PR kern/51918
Currently signal3 requires code for other architectures than x86_64

Sponsored by <The NetBSD Foundation>
2017-01-26 20:15:44 +00:00
kamil 7da544b6ff Add new test signal1 in t_ptrace_wait{,3,4,6,id,pid}
signal1:
    Verify that masking single unrelated signal does not stop tracer
    from catching other signals

Sponsored by <The NetBSD Foundation>
2017-01-26 17:03:21 +00:00
kamil 905db9de05 Add io_read_auxv1 in t_ptrace_wait{,3,4,6,id,pid}
io_read_auxv1:
    Verify PT_READ_AUXV called for tracee

Sponsored by <The NetBSD Foundation>
2017-01-25 17:01:57 +00:00
maya 1d815938de use isinf instead of isinff. this doesn't introduce a functional change -
isinf works for float as well, and is more portable.

from Ngie Cooper in PR bin/51838
2017-01-20 21:15:56 +00:00
ozaki-r ac86ae25b9 Protect if_clone data with if_clone_mtx
To this end, carpattach needs to be delayed from RUMP_COMPONENT_NET to
RUMP_COMPONENT_NET_IF on rump_server. Otherwise mutex_enter via carpattach
for if_clone_mtx is called before mutex_init for it in ifinit1.
2017-01-20 08:35:33 +00:00
kamil 3a94491317 Use siginfo_t to validate tests/kernel/arch/amd64/t_ptrace_wait*
This change makes sure that the fired expected watchpoint with expected
property. It's done with PT_GET_SIGINFO and checking SIGTRAP codes.

Sponsored by <The NetBSD Foundation>
2017-01-18 05:14:34 +00:00
kamil 4e1719ea5b Refactor ptrace_watchpoint structure to allow extensions
Add new field pw_type in the ptrace_watchpoint structure.

amd64 and i386 offer the current set of watchpoints as
PTRACE_PW_TYPE_DBREGS.

On other archs than x86, there are readily available different types of
hardware assisted watchpoints like for code-only or data-only registers on
ARM. Also in future there is an option to implement MMU-based watchpoints
and future per-port or per-cpu extensions.

Next step is to alter this interface on x86 to generate SIGTRAP with
si_code TRAP_HWWTRAP with additional information on occurred event:
 - which watchpoint fired,
 - additional watchpoint-type specific information, like on amd64 with
   PTRACE_PW_TYPE_DBREGS.:
   * only watchpoint fired
   * watchpoint fired and single step occurred

Adjust ATF tests for the pw_type change.

Sponsored by <The NetBSD Foundation>
2017-01-16 21:35:59 +00:00
christos acb4286257 beware of your shadow 2017-01-16 19:07:06 +00:00
christos 7eebfad669 PR/51894: Ngie Cooper: Use /dev/zero to read instead of stdin 2017-01-16 16:35:57 +00:00
christos 6d9b7137e8 PR/51893: Ngie Cooper: prevent toolchain from optimizing out memset call 2017-01-16 16:34:24 +00:00
christos 424ba067d9 PR/51892: Ngie Cooper: add __unused to `osi` in the sigaction handler 2017-01-16 16:32:13 +00:00
christos f8bd60ee57 PR/51891: Ngie Cooper: use sys/disklabel.h instead of machine/disklabel.h 2017-01-16 16:31:05 +00:00
christos 78c0e08e9b PR/51885: Ngie Cooper: Add delays to avoid races. 2017-01-16 16:29:54 +00:00
christos 2d6ff91c6a PR/51884: Ngie Cooper: Include and message fixes 2017-01-16 16:29:19 +00:00
christos 9ac9a14dec PR/51886: Ngie Cooper: Use _exit instead of exit 2017-01-16 16:28:27 +00:00
christos 75e7228cd4 PR/51887: Ngie Cooper: Include and error message fixes 2017-01-16 16:27:43 +00:00
christos 138b5d077b PR/51890: Ngie Cooper: include and error message fixes. 2017-01-16 16:27:06 +00:00
christos ab92520e8c PR/51888: Ngie Cooper: more error checking, missing includes 2017-01-16 16:23:41 +00:00
christos 17284898e1 PR/51889: Ngie Cooper: add sys/time.h 2017-01-16 16:22:22 +00:00
ozaki-r cc5766bfdd Rewrite tests for CARP in a shell script instead of C
The new shell script enables us to modify/add tests easily.
2017-01-16 08:18:11 +00:00
christos 2162d23666 PR/51874: Ngie Cooper: Add __unused to signal handlers 2017-01-14 21:08:17 +00:00
christos 32eb699ff6 PR/51873: Ngie Cooper: add util.h #include 2017-01-14 20:59:23 +00:00
christos 468d6e2ffc PR/51872: Ngie Cooper: call sem_unlink after :basic and :child 2017-01-14 20:58:20 +00:00
christos 153621e321 PR/51871: Ngie Cooper: add fcntl.h for O_* fcntl/open constants 2017-01-14 20:57:24 +00:00
christos dcc3af2fc9 PR/51868: Ngie Cooper: mkfifo does not return an fd 2017-01-14 20:55:26 +00:00
christos 5f5a00ced0 PR/51867: Ngie Cooper: misc cleanups 2017-01-14 20:52:42 +00:00
christos 80210e1441 Pr/51866: Ngie Cooper: fix leak and release limit on memory to prevent
false positives with mlock/mmap
2017-01-14 20:51:13 +00:00
christos cd517fb06c PR/51815: Ngie Cooper: don't leak dlopen'ed handle 2017-01-14 20:49:24 +00:00
christos b318113857 PR/51825: Ngie Cooper: use the non _ version of the macro 2017-01-14 20:47:41 +00:00
christos c3359ffa01 PR/51876: Ngie Cooper: kyua 0.11 $TMPDIR fixes 2017-01-14 20:45:16 +00:00
christos 8684dbb301 PR/51875: Ngie Cooper: portability fixes 2017-01-14 20:43:52 +00:00
kamil ac2c008382 Add additional check for pe_report_event in lwp_{create,exit}1
This caught bug that currently PTRACE_LWP_EXIT is reported as
PTRACE_LWP_CREATE.

Sponsored by <The NetBSD Foundation>
2017-01-14 19:17:10 +00:00
kamil 6413a1acf0 Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5)
Add interface in ptrace(2) to track thread (LWP) events:
 - birth,
 - termination.

The purpose of this thread is to keep track of the current thread state in
a tracee and apply e.g. per-thread designed hardware assisted watchpoints.

This interface reuses the EVENT_MASK and PROCESS_STATE interface, and
shares it with PTRACE_FORK, PTRACE_VFORK and PTRACE_VFORK_DONE.

Change the following structure:

typedef struct ptrace_state {
        int     pe_report_event;
        pid_t   pe_other_pid;
} ptrace_state_t;

to

typedef struct ptrace_state {
        int     pe_report_event;
        union {
                pid_t   _pe_other_pid;
                lwpid_t _pe_lwp;
        } _option;
} ptrace_state_t;

#define pe_other_pid    _option._pe_other_pid
#define pe_lwp          _option._pe_lwp

This keeps size of ptrace_state_t unchanged as both pid_t and lwpid_t are
defined as int32_t-like integer. This change does not break existing
prebuilt software and has minimal effect on necessity for source-code
changes. In summary, this change should be binary compatible and shouldn't
break build of existing software.


Introduce new siginfo(5) type for LWP events under the SIGTRAP signal:
TRAP_LWP. This change will help debuggers to distinguish exact source of
SIGTRAP.


Add two basic t_ptrace_wait* tests:
lwp_create1:
    Verify that 1 LWP creation is intercepted by ptrace(2) with
    EVENT_MASK set to PTRACE_LWP_CREATE

lwp_exit1:
    Verify that 1 LWP creation is intercepted by ptrace(2) with
    EVENT_MASK set to PTRACE_LWP_EXIT

All tests are passing.


Surfing the previous kernel ABI bump to 7.99.59 for PTRACE_VFORK{,_DONE}.

Sponsored by <The NetBSD Foundation>
2017-01-14 06:36:52 +00:00
kamil 14d6312469 Add new tests eventmask[34] in t_ptrace_wait{,3,4,6,id,pid}
eventmask3:
    Verify that PTRACE_VFORK in EVENT_MASK is preserved

eventmask4:
    Verify that PTRACE_VFORK_DONE in EVENT_MASK is preserved

Currently eventmask3 is failing and marked with PR kern/51630

Sponsored by <The NetBSD Foundation>
2017-01-14 04:37:55 +00:00
pgoyette ea3582b27e 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.
2017-01-14 03:59:58 +00:00
christos 0ac9d4eb29 better name 2017-01-14 01:33:32 +00:00
christos 6a94a0768f PR/51832: Ngie Cooper:
- limit memory to 64M
- error msg fixes
- includes fixes
2017-01-14 00:50:56 +00:00
christos 81da05f641 Do things in a less intrusive way. 2017-01-14 00:33:19 +00:00
kamil c35cdcf1bb Update t_ptrace_wait* tests for added support for PTRACE_VFORK{,_DONE}
PTRACE_VFORK and PTRACE_VFORK_DONE are now parts of <sys/ptrace.h>.

PTRACE_VFORK tests are still failing as the support for it is currently
a stub.

Sponsored by <The NetBSD Foundation>
2017-01-13 23:22:12 +00:00
christos c54cb81102 Don't play with "../.." in includes for h_macros.h; deal with it centrally.
Minor fixes.
2017-01-13 21:30:39 +00:00
christos 6e9c6546e8 PR/51859: Ngie Cooper: use closefrom/restore RLIMIT_NOFILE when done 2017-01-13 21:19:45 +00:00
christos 9398a6c8c6 PR/51861: Ngie Cooper: Sprinkle __unused, mark __dead, _exit(). 2017-01-13 21:18:33 +00:00
christos f3f1ae73bf PR/51862: Ngie Cooper: don't leak buf 2017-01-13 21:16:38 +00:00
christos 1b5bdd34e2 PR/51860: Ngie Cooper: don't leak fd 2017-01-13 21:15:57 +00:00
christos f4c1dfe02d PR/51857: Ngie Cooper: mark signo __unused for -Wunused 2017-01-13 21:15:14 +00:00
agc a5445b4eea also terminate 2 other statements properly 2017-01-13 21:09:12 +00:00
agc 56556fc2dc terminate the statement properly 2017-01-13 21:00:59 +00:00
christos 35c57c2fc8 PR/51858: Ngie Cooper: don't leak buf 2017-01-13 20:46:15 +00:00
christos 93538aec95 PR/51856: Ngie Cooper: add limits.h for INT_MAX 2017-01-13 20:44:45 +00:00
christos 26e010503c PR/51847: Ngie Cooper: More error checks, add __unused 2017-01-13 20:44:10 +00:00
christos 666a964a93 PR/51855: Ngie Cooper: fix leaks 2017-01-13 20:43:11 +00:00
christos 86d82e08a1 PR/51853: Ngie Cooper: add limits.h for MAXPATHLEN in FreeBSD 2017-01-13 20:42:36 +00:00
christos 10ef6baaf5 PR/51854: Ngie Cooper: sys/socket.h include and check result from socket(2) 2017-01-13 20:41:50 +00:00
christos cee075369e PR/51851: Ngie Cooper: add stdbool.h #include for false/true 2017-01-13 20:31:53 +00:00
christos faab7dc2ec PR/51852: Ngie Cooper: mark signo __unused 2017-01-13 20:31:06 +00:00
christos bf323d9fd1 PR/51849: Ngie Cooper: headers portability fixes 2017-01-13 20:10:57 +00:00
christos 180ffa9edb PR/51850: Ngie Cooper: add sys/socket.h for socket(2) and don't leak fds 2017-01-13 20:09:48 +00:00
christos 57ddf889e1 PR/51848: Ngie Cooper: tests/lib/libc/sys/t_sigaction: mark variables __unused
XXX: h_macros.h needs to be fixed differently.
2017-01-13 20:08:38 +00:00
christos 4cc87d7ee2 PP/51845: Ngie Cooper: need <netinet/in.h> for htonl etc and fix socket leak 2017-01-13 20:06:50 +00:00
christos 26785dc779 PR/51846: Ngie Cooper: closefrom(3) instead of fcntl(3, F_CLOSEM)
for portability
2017-01-13 20:04:52 +00:00
christos af06389089 PR/51844: Ngie Cooper: use root-owned file created during build instead of
/usr/bin/fpr
2017-01-13 20:03:51 +00:00
christos d0d6e976d7 PR/51843: Ngie Cooper: don't leak file descriptor 2017-01-13 19:34:19 +00:00
christos 499ce000b9 PR/51842: Ngie Cooper: don't leak fifo file descriptor 2017-01-13 19:33:03 +00:00
christos 86df5d0a52 PR/51841: Ngie Cooper: portability fixes for FreeBSD 2017-01-13 19:28:55 +00:00
christos 54f5f52408 PR/51840: Ngie Cooper: portability fixes for FreeBSD, etc 2017-01-13 19:27:23 +00:00
christos 5d4836fefb PR/51839: Ngie Cooper: reset errno to 0 before calling scalbn* 2017-01-13 19:26:03 +00:00
christos 6660f1abd6 PR/51837: Ngie Cooper: add limits.h for INT_MAX 2017-01-13 19:23:40 +00:00
ozaki-r a0d1dbdc06 Remove a check added wrongly 2017-01-13 08:11:01 +00:00
ozaki-r 6fe17373ab Add tests for net.inet6.ip6.prefer_tempaddr 2017-01-13 06:30:33 +00:00
ozaki-r ade7bb4d73 Remove extra checks and cleanup 2017-01-13 06:30:09 +00:00
christos a1bf1494f3 Bart Simpson's punishment. 2017-01-13 05:18:22 +00:00
christos f6982a4254 help gcc's numbscullness. 2017-01-13 05:12:44 +00:00
kre 97c5c4a143 Move the #ifndef/#define dance for the (currently) system undefined
PTRACE_VFORK* macros out of a function that is not always compiled
(as they are used in other functions that are.)   Unbreak the build.
2017-01-13 03:01:09 +00:00
kamil 314c5d1975 Add new tests vforkdone[12] in t_ptrace_wait{,3,4,6,id,pid}
vforkdone1:
    Verify that vfork(2) is intercepted by ptrace(2) with EVENT_MASK
    set to PTRACE_VFORK_DONE

vforkdone2:
    Verify that vfork(2) is intercepted by ptrace(2) with EVENT_MASK
    set to PTRACE_FORK | PTRACE_VFORK_DONE

As of now PTRACE_VFORK_DONE is undefined in <sys/ptrace.h>.

Sponsored by <The NetBSD Foundation>
2017-01-12 21:35:53 +00:00
christos af5b14872f more error checks 2017-01-11 18:15:02 +00:00
christos 2b582fd0b7 fix mismatched paren, also the previous commit should say and check error
for -1.
2017-01-11 18:09:40 +00:00
christos 64565cf3c6 PR/51822: Ngie Cooper: add additional t_memmem check 2017-01-11 18:07:37 +00:00
christos 22f9a6b271 PR/51823: Ngie Cooper: Add output diagnostic if memcmp of the md5 string fails 2017-01-11 18:05:54 +00:00
joerg 77fe1f22f1 Remove LLVM atomic hacks for Sparc. 2017-01-11 12:10:26 +00:00
christos 69ee1aa91e wrap the macro in do/while. 2017-01-11 07:26:17 +00:00
ozaki-r 79ca97d6c8 Cope with tentative state 2017-01-11 07:22:43 +00:00
ozaki-r 285906a96f Add a test case for IPv6 temporary address 2017-01-11 03:15:44 +00:00
ozaki-r 5722f72db4 Check autoconf flag 2017-01-11 03:15:11 +00:00
christos 25f1087ae3 more tests needing <sys/stat.h> 2017-01-10 22:36:29 +00:00
christos e56151ab6a need <sys/stat.h> 2017-01-10 22:24:29 +00:00
christos 84802888eb need <sys/stat.h> 2017-01-10 22:10:22 +00:00
christos 7c2c9f2e62 add <stdio.h> 2017-01-10 20:35:49 +00:00
maya 674799e3e9 remove duplicate include.
(also move so it is alphabetical, hence the weird diff)
2017-01-10 15:43:59 +00:00
christos 0480186ded PR/51815: Ngie Cooper: don't leak dlopen'ed handle 2017-01-10 15:34:49 +00:00