Commit Graph

3690 Commits

Author SHA1 Message Date
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
kre
8d9df45b43 Add sub tests to the quoting test case, to demonstrate a parsing
bug (and its fix (depending upon whether the test is run against
an unfixed, or fixed, shell).

An obvious indication of the failure is the following (one of the
new sub-tests)

p=A
cat <<EOF
${p+\%$p\%}
${p+%$p%}
EOF

which should output

\%A\%
%A%


as a here doc is treated as a double quoted string, except
that the " character is just a character.  In such a string,
the \ is only an escape character when the following character
is special, otherwise it represents a literal \ (which is the
case here).

An unfixed shell will omit the backslashes in the output.

It gets even more wrong if the % chars are replaced by "
(double quote) chars, which should make no difference, other
than the corresponding change, in the output.   But doesn't
(it doesn't even produce output broken in a similar way).

This one is a harder case to be specific about however,
as while the fixed (and expected in the test) output is what
is technically correct, only a few shells actually produce
it, most generate something different (but not all the same.)
2019-01-22 14:31:53 +00:00
kamil
82a5a0ea60 Mark traceme_vfork_crash_bus as no longer failing
Fixed in src/sys/kern/core_elf32.c r. 1.58

Closes PR lib/53343
2019-01-22 03:47:45 +00:00
blymn
3e0ce67bf9 Fix script to use getopts instead of a hand rolled argument parser,
add option to set curses debug output file and other general fixes.
Thanks to kre@netbsd.org for comments and help with this.
2019-01-21 21:21:13 +00:00
kre
15320a4ac2 Add subtests to verify that both "sleep 0.2" and "sleep 0,2" work
when the locale is ru_RU.UTF-8 (which has ',' as its decimal radix char).
Inspired by a problem with rc.subr experiened by ru_RU.UTF-8 reported on
netbsd-users.  These are in the "fraction" test case.

While here, add some more (sub-)tests of invalid input, to make sure they
fail (in the "nonnumeric" test case), and for fun, a couple of subtests
testing hex input fractional delays (in the "hex" test case).
2019-01-21 13:19:18 +00:00
gson
0bd23f10c8 Call rump_pub_lwproc_newlwp() in the lfs cleaner thread to make its
rump system calls all use the same lwp.  Hopefully this will fix
PR kern/53884.  Also call rump_pub_lwproc_releaselwp() at the end.
2019-01-20 14:50:58 +00:00
christos
3f3dbbcd73 add a range and a repeat regex test. 2019-01-19 01:02:12 +00:00
knakahara
6e581475e6 Add ATF for ipsecif(4) pfil. 2019-01-17 02:49:11 +00:00
fox
4bfe81d9d9 Fixed issues with uvm_page_physunload_delete_end test case.
1. "avail_start" and "start" were different, resulting in unreachable code in
uvm_page_physunload(), where the condition check "avail_start" < "end" fails.
The test has been fixed by setting "avail_start" and "start" to the same value.

2. If "start" is the address with end address being "start + 2", we can
unplug twice, the first paddr_t would be "start" and the second one would be
"start + 1". Modified the ATF_CHECK_EQ() to reflect these changes.

Reviewed by <cherry>
2019-01-16 13:54:17 +00:00
fox
66ea64ecd5 Fixed issues with uvm_physseg_atboot_free_leak test case.
"\n" in ATF discriptions make it behave in weird ways, like saying "this
test is bogus.", fixed the issue by removing the "\n".

Reviewed by <cherry>
2019-01-16 13:45:29 +00:00
fox
ff43743a55 Fixed issues with uvm_physseg_plug test case.
There is a condition check which failed for VM_PHYSSEG_MAX == 2 (not for
1 or 3 and above), in case of 2, pgs == slab + npages1 + npages3, so we
need to change ">" check to ">=" check.

Reviewed by <cherry>
2019-01-16 13:35:51 +00:00
fox
497a8f2bfd Fixed the build failures caused by incompatible type comparisons when
VM_PHYSSEG is > 1.

Reviewed by <cherry>
2019-01-16 13:21:02 +00:00
knakahara
06a59f7e0a Fix PR kern/53848. Add missing "ifconfig -w". 2019-01-15 05:34:37 +00:00
knakahara
2127b06f61 revert t_ipsec.sh:r1.7 2019-01-15 05:33:42 +00:00
christos
323118b11c add call error checks, requested by mrg@ 2019-01-14 00:23:43 +00:00
christos
42bad95822 Increase the timeout a bit, and make sure we join so that there is no
race.
2019-01-13 15:36:57 +00:00
gson
5a561c0cd0 Mark the fs/vfs/t_renamerace:udf_renamerace_dirs test case as an
expected failure referencing PR kern/53865, and force failure to avoid
reports of unexpected success as it does not realiably fail under
qemu.  This makes the treatment of udf_renamerace_dirs the same as
that of udf_renamerace, only with a different PR.  Also, make
whitespace consistent between the two.
2019-01-13 14:35:00 +00:00
gson
c807c19194 Don't mark the traceme_vfork_crash_bus test case as an expected failure
when it is executing as part of the lib/libc/sys/t_ptrace_waitid test,
because that particular combination is not failing, at least not on amd64.
It is failing as part of other tests, so PR lib/53343 still applies.
2019-01-13 11:03:20 +00:00