The former location gets included in both libcompat and the compat
module, leading to redefined symbols when the module is loaded. By
moving it to the main Makefile, it gets included only in libcompat.
XXX This still isn't an ideal solution, but it will suffice until
XXX PR kern/51598 is addressed.
A child process cannot call atf functions and expect them to magically
work like in the parent.
The printf(3) messaging from a child will not work out of the box as well
without estabilishing a communication protocol with its parent. To not
overcomplicate the tests - do not log from a child and use err(3)/errx(3)
wrapped with FORKEE_ASSERT()/FORKEE_ASSERTX() as that is guaranteed to work.
Simplify and cleanup code of the tests.
Sponsored by <The NetBSD Foundation>.
Raising SIGCONT from a ptrace(2)d child should be catched with waidpid(2)
as WIFCONTINUED() false and WIFSTOPPED() true; not both true as it does not
make much sense.
PR kern/51596
Change requested by <kre>
Checked by <christos>
Sponsored by <The NetBSD Foundation>
build for one of the XEN kernels.
Adding it back to the list. At least the build will be successful.
XXX This is probably not the end of this saga, as we still have the
XXX redefined-symbol issue when loading the compat module on amd64.
XXX But for now, a working build for the vast majority of users
XXX (including our automated test suites) is more important than a
XXX successfully-loadable compat module.
This test verifies calling raise(2) with the SIGCONT argument in the child.
The parent is notified with it and asserts that WIFCONTINUED() and
WIFSTOPPED() are both set.
XXX: This behavior is surprising. Linux for the same code-path returns false
for WIFCONTINUED() and true for WIFSTOPPED().
Include <stdlib.h> for EXIT_FAILURE.
This code covers (uncovers issues?) WIFCONTINUED() and is the last planned
test in the ptraceme category.
Sponsored by <The NetBSD Foundation>.
For future reference and convenience, an out-of-ATF test is as follows:
#include <sys/param.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <assert.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#define ATF_REQUIRE(a) assert(a)
#if defined(linux)
#define WALLSIG __WALL
#define sys_signame sys_siglist
#endif
int main(int argc, char **argv)
{
int status;
const int exitval = 5;
const int sigval = SIGSTOP, sigsent = SIGCONT;
pid_t child, wpid;
printf("1: Before forking process PID=%d\n", getpid());
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
/* printf(3) messages from a child aren't intercepted by ATF */
/* "2: Child process PID=%d\n", getpid() */
/* "2: Before calling ptrace(PT_TRACE_ME, ...)\n" */
if (ptrace(PT_TRACE_ME, 0, NULL, 0) == -1) {
/* XXX: Is it safe to use ATF functions in a child? */
err(EXIT_FAILURE, "2: ptrace(2) call failed with "
"status %s", sys_errlist[errno]);
}
/* "2: Before raising SIGSTOP\n" */
raise(sigval);
/* "2: Before raising SIGCONT\n" */
raise(sigsent);
/* "2: Before calling _exit(%d)\n", exitval */
_exit(exitval);
} else {
printf("1: Parent process PID=%d, child's PID=%d\n", getpid(),
child);
printf("1: Before calling waitpid() for the child\n");
wpid = waitpid(child, &status, 0);
printf("1: Validating child's PID (expected %d, got %d)\n",
child, wpid);
ATF_REQUIRE(child == wpid);
printf("1: Ensuring that the child has not been exited\n");
ATF_REQUIRE(!WIFEXITED(status));
printf("1: Ensuring that the child has not been continued\n");
ATF_REQUIRE(!WIFCONTINUED(status));
printf("1: Ensuring that the child has not been terminated "
"with a signal\n");
ATF_REQUIRE(!WIFSIGNALED(status));
printf("1: Ensuring that the child has been stopped\n");
ATF_REQUIRE(WIFSTOPPED(status));
printf("1: Verifying that he child has been stopped with the"
" %s signal (received %s)\n", sys_signame[sigval],
sys_signame[WSTOPSIG(status)]);
ATF_REQUIRE(WSTOPSIG(status) == sigval);
printf("1: Before resuming the child process where it left "
"off and without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0)
!= -1);
printf("1: Before calling waitpid() for the child\n");
wpid = waitpid(child, &status, WALLSIG);
printf("1: Validating that child's PID is still there\n");
ATF_REQUIRE(wpid == child);
printf("1: Ensuring that the child has not been exited\n");
ATF_REQUIRE(!WIFEXITED(status));
printf("1: Ensuring that the child has been continued\n");
ATF_REQUIRE(WIFCONTINUED(status));
printf("1: Ensuring that the child has not been terminated "
"with a signal\n");
ATF_REQUIRE(!WIFSIGNALED(status));
printf("1: Ensuring that the child has not been stopped\n");
ATF_REQUIRE(WIFSTOPPED(status));
printf("1: Before resuming the child process where it left "
"off and without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("1: Before calling waitpid() for the child\n");
wpid = waitpid(child, &status, 0);
printf("1: Validating that child's PID is still there\n");
ATF_REQUIRE(wpid == child);
printf("1: Ensuring that the child has been exited\n");
ATF_REQUIRE(WIFEXITED(status));
printf("1: Ensuring that the child has not been continued\n");
ATF_REQUIRE(!WIFCONTINUED(status));
printf("1: Ensuring that the child has not been terminated "
"with a signal\n");
ATF_REQUIRE(!WIFSIGNALED(status));
printf("1: Ensuring that the child has not been stopped\n");
ATF_REQUIRE(!WIFSTOPPED(status));
printf("1: Verifying that he child has exited with the "
"%d status (received %d)\n", exitval, WEXITSTATUS(status));
ATF_REQUIRE(WEXITSTATUS(status) == exitval);
printf("1: Before calling waitpid() for the exited child\n");
wpid = waitpid(child, &status, 0);
printf("1: Validating that child's PID no longer exists\n");
ATF_REQUIRE(wpid == -1);
printf("1: Validating that errno is set to %s (got %s)\n",
sys_errlist[ECHILD], sys_errlist[errno]);
ATF_REQUIRE(errno == ECHILD);
}
}
- Move _VFS_VNODE_PRIVATE protected operations into vnode_impl.h.
- Move struct vnode_impl definition and operations into vnode_impl.h.
- Include vnode_impl.h where we include vnode.h with _VFS_VNODE_PRIVATE defined.
- Get rid of _VFS_VNODE_PRIVATE.
- Rename struct vcache_node to vnode_impl, start its fields with vi_.
- Rename enum vcache_state to vnode_state, start its elements with VS_.
- Rename macros VN_TO_VP and VP_TO_VN to VIMPL_TO_VNODE and VNODE_TO_VIMPL.
- Add typedef struct vnode_impl vnode_impl_t.
(one which used a different key for the signature of the data file...)
Allow either key to work. Also update the name of the sets list
file to match modern reality (only affects instructions issued to user.)
I skipped committing these changes until it had been used a few times
to verify that it actually works properly... it seems to.
Summary of changes in tzdata2016i (2016-11-01 23:19:52 -0700):
Cyprus split into two time zones on 2016-10-30 (new zone is
Asia/Famagusta and is UTC+3 year round). Tonga reintroduces
summer time on 2016-11-06 (assumed for now to be aligned with Fiji).
This year's summer time switch (from +08 to +11) for Antarctica/Casey
occurred 2016-10-22.
Also (minor) adjustments to some historic data for Italy (most
recent applies to time of day of switch out of summer time in period
1967-1970 & 1972-1974, other changes relate to 1910's and 1940's.)
This test is modeled after traceme1 and traceme2 with the goal to test if
the child was terminated with a received signal passed with PT_CONTINUE.
Currently the three traceme tests verifies three possible status values from
waitpid(2) called by the parent:
- WIFEXITED(status),
- WIFSIGNALED(status),
- WIFSTOPPED(status)
with associated macros:
- WEXITSTATUS(status),
- WTERMSIG(status),
- WCOREDUMP(status),
- WSTOPSIG(status).
In traceme3 has been assumed that Ctrl-C (SIGINT) does not emit core(5).
Sponsored by <The NetBSD Foundation>.
to compat_cvtcmd() in if.c. Ideally, if.c would be modified to have
a pointer to a no-op compat_cvtcmd() and that pointer would get
replaced by compat_modcmd(MODULE_CMD_INIT, ...) code. But for now,
just don't include it in the compat module at all.
- Share lists between the libcompat and module makefiles.
- Include some omitted entries in compat.kmod:
. if_43.c
. kern_sa_60.c
. kern_time_30.c
. rndpseudo_50.c
. rtsock_14.c
. rtsock_50.c
. rtsock_70.c
. uipc_syscalls_40.c
. uipc_syscalls_50.c
- Exclude a (harmless) spurious entry in sysv_ipc.kmod on LP64 systems:
. kern_ipc_10.c
Should fix broken ifconfig on modular current kernels.
ok pgoyette
This test is a clone of traceme2 with ptrace(2) calling PT_CONTINUE
with signal to be passed to the child: SIGINT. traceme1 sends no signals.
Sponsored by <The NetBSD Foundation>.
This test is a placeholder for further checks of the native ptrace(2)
function calls.
XXX: Is it safe to call ATF functions from a child? FreeBSD seems to
construct dedicated asserts for them.
XXX: printf(3) calls from a child are not intercepted by atf-run(1)
Sponsored by <The NetBSD Foundation>.
drop BM_WUC_HOST_WU_BIT of BM_PROT_GEN_CFG register in FreeBSD r228386. The
code was added rev. 1.149, but the location was not the best.
Now I219 doesn't hang quickly after "ifconfig up".
- wm_gmii_hv_{read/write}reg*(): USE PHY address 1 for some special registers.
- Add check code for an 82578 workaround. Not completed yet(check only).
- wm_release_hw_control(): Remove extra line. No any effect.