| Age | Commit message (Collapse) | Author |
|
with FreeBSD)
* Fix a broken call to open(2) with O_CREAT and no permission argument.
* ANSIfy function definitions.
* Improve failure messages.
From freebsd.org via Brooks Davis - Thanks!
|
|
|
|
dual CPU alpha (where previously we sometimes ended up with no delay
at all).
|
|
|
|
MKRUMP=no
It needs libpthread regardless MKRUMP..
|
|
|
|
|
|
if it is a relative timestamp, as discussed in tech-kern.
XXX: pullup-8
|
|
indefinitely, discussed in tech-kern.
|
|
|
|
|
|
ptrace(2) tests have been moved to tests/lib/libc/sys
Sponsored by <The NetBSD Foundation>
|
|
These files were merged with kernel/t_ptrace_wait*
This removes MD test files.
Sponsored by <The NetBSD Foundation>
|
|
This aims to remove MD-specific tests files for ptrace(2).
Prefix i386 and amd64 tests with unique strings "i386_" and "x86_64_".
This removes conflicts with generic tests.
Sponsored by <The NetBSD Foundation>
|
|
This aims to remove MD-specific tests files for ptrace(2).
Sponsored by <The NetBSD Foundation>
|
|
This aims to remove MD-specific tests files for ptrace(2).
Sponsored by <The NetBSD Foundation>
|
|
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>
|
|
No functional change.
Sponsored by <The NetBSD Foundation>
|
|
Assert that a debugger cannot attach to PID 1 with securelevel >= 0
(as root) instead of >= 1.
Sponsored by <The NetBSD Foundation>
|
|
Initialize a local variable.
|
|
Eliminate duplicated code.
Sponsored by <The NetBSD Foundation>
|
|
Currently remove tests for dbregs_dr[67]_dont_inherit_lwp.
Sponsored by <The NetBSD Foundation>
|
|
This is work in progress to remove no longer needed code overhead shared
between tests.
Sponsored by <The NetBSD Foundation>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Reduce timeout to 5 seconds. This tests timeouts and this change saves
time.
PR kern/51918
Sponsored by <The NetBSD Foundation>
|
|
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>
|
|
|
|
[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.
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The code for debug registers isn't in HEAD and it might break the build.
Sponsored by <The NetBSD Foundation>
|
|
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>
|
|
Stop compating the number of available registers with 16, it's amd64
specific. i386 ships with 8 Debug Registers.
Sponsored by <The NetBSD Foundation>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|