Commit Graph

3707 Commits

Author SHA1 Message Date
kamil
e3a629e53f Rename signal1 to signal_mask_unrelated in t_ptrace_wait*
No functional change intended.
2019-02-12 21:35:35 +00:00
kamil
7439bd598d Refactor lwp_create1 and lwp_exit1 into trace_thread* in ptrace(2) tests
New tests:
 - trace_thread1
 - trace_thread2
 - trace_thread3
 - trace_thread4

These tests verify _lwp_create(2) and _lwp_exit(2) events. They are
currently skipped as not reliable.
2019-02-12 06:00:05 +00:00
kamil
2d4745f8b2 Rename the siginfo4 test in ATF t_ptrace_wait*
The siginfo group of ptrace(2) tests has been replaced with new individual
tests or merged into existing ones. This is the last siginfo* test that
has been renamed.

New name: traceme_exec.
2019-02-11 05:59:00 +00:00
kamil
32c33d29c1 Merge siginfo6 into other PT_STEP tests in t_ptrace_wait* 2019-02-11 05:51:20 +00:00
kamil
bfae04bf15 Drop siginfo5 from ATF tests in t_ptrace_wait*
siginfo5 duplicates older tests verifying PTRACE_FORK.
2019-02-11 04:20:06 +00:00
kamil
bc00947fe2 Initial refactoring of siginfo* tests in t_ptrace_wait*
Drop test siginfo1 as duplicated with earlier tests.

Rework and rename siginfo2 and siginfo3 into a single test body.

New tests:
 - siginfo_set_unmodified (replaces siginfo2)
 - siginfo_set_faked (replaces siginfo3)

All new tests pass.
2019-02-11 04:13:28 +00:00
mlelstv
82fe3e95ba provide a test function, avoids crashing tests with SIGSEGV. 2019-02-10 09:54:39 +00:00
kamil
5a04cbf366 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.
2019-02-10 02:13:45 +00:00
kamil
8ac77c305d Add initial pthread(3) tests in ATF t_prace_wait* tests
There were tested few scenarios with native _lwp_create(2) functions, using
this interface is not needed and it's easier to manage tests with
high-level pthread(3) API.

Rewrite original lwpinfo1 and lwpinfo2 tests into 8 new tests:
 - traceme_lwpinfo0 (0 spawned additional threads)
 - traceme_lwpinfo1 (1 spawned additional thread)
 - traceme_lwpinfo2 (2 spawned additional threads)
 - traceme_lwpinfo3 (3 spawned additional threads)
 - attach_lwpinfo0 (0 spawned additional threads)
 - attach_lwpinfo1 (1 spawned additional thread)
 - attach_lwpinfo2 (2 spawned additional threads)
 - attach_lwpinfo3 (3 spawned additional threads)

These tests verify primarily the PT_LWPINFO interface.

Build the t_ptrace_wait* tests with -pthread.

All tests pass.
2019-02-10 02:04:06 +00:00
kamil
fb7fe14f74 Add infinite_thread() for ptrace(2) ATF tests
infinite_thread() is designed to be spawned as a pthread(3) function.

It will be used soon in new tests.
2019-02-09 23:10:42 +00:00
scole
a253ff12d9 use HAVE_FPREGS not HAVE_FPGPREGS and move some register_t inside proper #define. fixes ia64 build. ok <kamil> 2019-02-09 23:03:01 +00:00
mrg
01ef24fd3f fix hello_profile's hello_profile_head function name. 2019-02-09 02:36:28 +00:00
mrg
f4fc04f995 add $NetBSD$ tags. 2019-02-09 00:13:19 +00:00
mrg
9ca42b4c5e add very simple test that you can link -fopenmp.
currently fails, but should work soon...
2019-02-09 00:12:14 +00:00
kamil
120dbb13e3 Refactor kill* test in t_ptrace_wait*
Drop original scenario of kill1 (PT_CONTINUE(SIGKILL)) as it duplicates
traceme_sendsignal_simple1.

New kill tests:
 - kill1: ptrace(PT_KILL) (previously kill2)
 - kill2: kill(SIGKILL)
 - kill3: killpg(SIGKILL)

All kill* tests share the same function body.

All tests pass.
2019-02-08 03:08:00 +00:00
kamil
fe7f44d815 Correct a style in description of PT_STEP tests in t_ptrace_wait* 2019-02-08 00:31:46 +00:00
kamil
60980e6752 Refactor definition of PT_STEP tests into single macro
No functional change intended.
2019-02-08 00:29:41 +00:00
kamil
c18cba814b Refactor GPR and FPR tests in t_ptrace_wait* tests
This change deduplicates the code and puts all the test into shared
function body.

No functional change except ranaming tests regs* to access_regs* and
fpregs* to access_fpregs*.
2019-02-07 23:03:33 +00:00
maxv
83ed0b5e52 Improvements:
- Emulate the instructions by executing them directly on the host CPU.
   This is easier and probably faster than doing it in software
   manually.

 - Decode SUB from Primary, CMP from Group1, TEST from Group3, and add
   associated tests.

 - Handle correctly the cases where an instruction that always implicitly
   reads the register operand is executed with the mem operand as source
   (eg: "orq (%rbx),%rax").

 - Fix the MMU handling of 32bit-PAE. Under PAE CR3 is not page-aligned,
   so there are extra bits that are valid.

With these changes in place I can boot Windows XP on Qemu+NVMM.
2019-02-07 10:58:45 +00:00
kamil
f51f2525b1 Enable 3 new ptrace(2) tests for SIGILL
Add missing code for SIGILL verification and enable new SIGILL tests:
 - traceme_crash_ill
 - traceme_vfork_crash_ill
 - unrelated_tracer_sees_crash_ill

SIGILL is caused by a crash signal and needs special treatement that has
to be asserted to behave correctly.

In the unrelated_tracer_sees_crash* tests add additional check to catch
scenarios when a test dies due to abnormal condition and it's not caught
as the tracer is collected by initproc.

All tests pass on NetBSD/amd64, other ports have temporarily unimplemented
PTRACE_ILLEGAL_ASM.
2019-02-07 00:24:59 +00:00
joerg
abf7fd5db8 movzx is not AT&T syntax, but some bastard version of Intel syntax.
Switch to the equivalent mnenomic.
2019-02-06 15:42:31 +00:00
mrg
7081cfef47 use strncpy() into a buffer that may not be nul terminated. 2019-02-06 09:16:49 +00:00
kamil
fdaf7bbf8c Add 2 new tests in t_fopen
Added:
 - fopen_nullptr (without COMPAT_10)
 - fopen_nullptr_compat10 (with COMPAT_10)

PR kern/53948

Reviewed by <mgorny>
2019-02-05 17:30:19 +00:00
maxv
0cfadc3649 Ah, I had warnings disabled, fix the build. 2019-02-05 17:03:10 +00:00
maxv
ed8fc6e9ad Add 12 tests for libnvmm's I/O Assist. 2019-02-05 13:00:03 +00:00
kamil
9e1a0a9819 Add missing break keywords in t_ptrace_wait* x86 tests
Add missing break in switch() cases in dbregs_trap_variable().

Reported by <mrg>
Detected by GCC 7
2019-02-05 02:57:10 +00:00
mrg
844d41bff8 - add __unreachable() after ATF_REQUIRE(pid > 0) where pid <= 0.
- rearrange one switch so that the -1/0/default cases are the
  same order in all instances.
2019-02-04 09:35:11 +00:00
mrg
5bb852d0c6 - tests explicitly check failure modes, ignore those warnings 2019-02-04 05:24:18 +00:00
mrg
bd9cab8c09 - make ERRX() return a value since it doesn't actually exit in the !TEST case. 2019-02-04 04:20:13 +00:00
mrg
466118942b - revert previous to t_ubsan.c, it is desired behaviour. from kamil.
- use -Wno-int-in-bool-context instead
2019-02-04 03:10:33 +00:00
mrg
37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
mrg
770680b518 - avoid multipling a boolean value, use &&. 2019-02-03 10:45:58 +00:00
thorpej
68e270a267 Implement support for "pshared" POSIX semaphores.
Fixes lib/53273 (and Firefox's multi-process tab feature).
2019-02-03 03:20:23 +00:00
mrg
fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
mrg
8dec05958d don't check the return value of execvp() for failure to call err().
assume if it returns at all something has failed.
2019-02-01 09:06:07 +00:00
maxv
2089a3819a Fix two issues:
* Uh I put the wrong masks in some GPRs, fuck.

 * When the opsize of MOVZX is 4, we need to combine the zero-extend from
   the instruction with the natural zero-extend of long mode.

Add two associated tests.
2019-02-01 06:49:58 +00:00
maxv
a8470e3880 Put correct values in the seg fields. AMD doesn't check for that, but Intel
does, so they need to be correct.
2019-02-01 05:32:08 +00:00
martin
d648db56e0 Move from uname -m to uname -p when checking if this target does support
ifunc - someone with a powerpc machine please double check!
2019-01-30 12:42:53 +00:00
martin
b39c506b5a Clean up terminology: modern arm CPUs do properly implement IEEE 754
floating point exceptions - but some (actually all currently know ones)
do not implement sending traps when these exceptions are raised.

Pointed out by Peter Maydell.
2019-01-30 12:16:28 +00:00
mgorny
de2592f9f0 Move common UBSAN test case code into ubsan_common.subr
Reviewed by <kamil>
2019-01-29 20:07:03 +00:00
mgorny
ff295ecc8d Move common ASAN test case code into asan_common.subr
Reviewed by <kamil>
2019-01-29 20:02:34 +00:00
mgorny
b4870a4524 Move common UBSAN test case code into ubsan_common.subr
Reviewed by <kamil>
2019-01-29 19:59:10 +00:00
mgorny
bf6dc715c6 Move common ASAN test case code into asan_common.subr
Reviewed by <kamil>
2019-01-29 19:56:37 +00:00
christos
e9c3f5723c vaxinate against ieeefp.h 2019-01-27 16:29:56 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
martin
15fd2d17a6 Some arm CPUs do not implement traps on floating point exceptions. 2019-01-26 16:44:30 +00:00
martin
8f6988db21 aarch64 does not trap on unaligned acces 2019-01-26 15:46:27 +00:00
christos
76d3dd6b3e PR/53908: Alex Raschi: One more file needs to move. 2019-01-25 18:34:45 +00:00
christos
78928445f5 PR/53908: Alex Raschi: Test that require modules belong in modules; move the
threadpool test from kernel to modules.
2019-01-25 18:33:58 +00:00
martin
076f00a246 There are aarch64 Cortex cpus that do not trap on some floating point
exceptions - so apply the arm handling for aarch64 as well.
2019-01-23 17:36:01 +00:00