Add traceme_vfork_signalmasked_crash and traceme_vfork_signalignored_crash
tests for crash signals (SIGTRAP, SIGSEGV, SIGILL, SIGFPE, SIGBUS).
These new scenario assert that signal masked/ignored are delivered to
vfork(2)ed child.
All tests pass.
Check whether sigignore is not reset on a trapsignal under a debugger.
The expected behavior is to not reset it. A side effect of resetting
signal mask is noticable especially with a software/hardware breakpoint
that changes state of a process.
Mark these tests as failing.
Check whether signal mask is not reset on a trapsignal under a debugger.
The expected behavior is to not reset it. A side effect of resetting
signal mask is noticable especially with a software/hardware breakpoint
that changes state of a process.
Mark these tests as failing.
Fix the kernel pty driver to report closed slave via master's kevent
EVFILT_READ. This behavior matches the behavior for pipes, is
consistent with how FreeBSD implements it and is relied upon by LLDB's
main loop implementation.
Includes feedback by kre and kamil (from tech-kern), commit approved
by kamil.
New tests verify that crashes (from trap signals) are delivered to tracer
regardless of the signal masking or signal ignoring option enabled in the
traced child.
All tests pass.
In close future these tests will obtain additional asserts.
Verify that ignoring (with SIG_IGN) in tracee
does not stop tracer from catching this raised signal.
Cover crash signals and already covered ones in other tests.
All tests pass.
Add new tests traceme_raisesignal_masked[1-8].
New tests to verify that masking (with SIG_BLOCK) signal in tracee
stops tracer from catching this raised signal. Masked crash signals are
invisible to tracer as well.
All tests pass.
Verify correct behavior of crash signals (SIGTRAP, SIGBUS, SIGILL, SIGFPE,
SIGSEGV) in existing test scenarios:
- traceme_raise
- traceme_sendsignal_handle
- traceme_sendsignal_masked
- traceme_sendsignal_ignored
- traceme_sendsignal_simple
- traceme_vfork_raise
These tests verify signals out of the context of CPU trap. These new tests
will help to retain expected behavior in future changes in semantics of
the trapsignals in the kernel.
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.
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.
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.
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.
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.
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*.
- 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.
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.
* 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.
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.