diff options
author | Bryan Drewery <bdrewery@FreeBSD.org> | 2017-09-15 19:48:48 +0000 |
---|---|---|
committer | Bryan Drewery <bdrewery@FreeBSD.org> | 2017-09-15 19:48:48 +0000 |
commit | b3b6d7b40656aaa1fe859b0c97b9332c3b1f2ec7 (patch) | |
tree | d39460029d4b0155234c0fba6c084f236593d22e /cddl/contrib/opensolaris/cmd/dtrace | |
parent | 02c474b481af5efa9cc8104177669ebaec34e003 (diff) | |
download | src-b3b6d7b40656aaa1fe859b0c97b9332c3b1f2ec7.tar.gz src-b3b6d7b40656aaa1fe859b0c97b9332c3b1f2ec7.zip |
Fix the raise tests.
- The exit probe was not appropriately filtered to only the known pid so it
was firing on any random process that would exit rather the only the one
we cared about.
- The dtest script executes the tst.raise*.exe in the background from
POSIX sh without jobs control. POSIX mandates that SIGINT be set to
SIG_IGN in this case. The test executable never actually tested that
SIGINT could be caught despite trying to block and delay the signal.
So the SIGINT sent from raise() is never actually received since it
is ignored. This could be fixed by calling 'trap - INT' from dtest
before running the executable but I've opted to just use SIGUSR1
instead in these specific tests rather than adding more logic to
test that SIGINT is not ignored at startup.
These 2 issues meant that the tests would randomly work but only if a process
coincidentally exited during the test.
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Notes
Notes:
svn path=/head/; revision=323620
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace')
6 files changed, 10 insertions, 7 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c index e39108366e39..8dd7bb972ef3 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c @@ -35,13 +35,13 @@ main(int argc, char **argv) sigset_t ss; (void) sigemptyset(&ss); - (void) sigaddset(&ss, SIGINT); + (void) sigaddset(&ss, SIGUSR1); (void) sigprocmask(SIG_BLOCK, &ss, NULL); do { (void) getpid(); (void) sigpending(&ss); - } while (!sigismember(&ss, SIGINT)); + } while (!sigismember(&ss, SIGUSR1)); return (0); } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d index cdc7154750b6..30bf5ae4bf0a 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d @@ -47,7 +47,7 @@ syscall::getpid:entry /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:entry } syscall::exit:entry +/pid == $1/ { exit(0); } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c index 9089283f7893..3901d9862097 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c @@ -45,7 +45,7 @@ main(int argc, char **argv) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - (void) sigaction(SIGINT, &sa, NULL); + (void) sigaction(SIGUSR1, &sa, NULL); for (;;) { (void) getpid(); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d index 4f68a0b93b3b..7d18442d7408 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d @@ -47,7 +47,7 @@ syscall::getpid:return /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:return } syscall::exit:entry +/pid == $1/ { exit(0); } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c index 9089283f7893..3901d9862097 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c @@ -45,7 +45,7 @@ main(int argc, char **argv) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - (void) sigaction(SIGINT, &sa, NULL); + (void) sigaction(SIGUSR1, &sa, NULL); for (;;) { (void) getpid(); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d index cdc7154750b6..30bf5ae4bf0a 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d @@ -47,7 +47,7 @@ syscall::getpid:entry /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:entry } syscall::exit:entry +/pid == $1/ { exit(0); } |