aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2017-03-15 16:02:25 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-15 16:02:25 +0000
commitbe22559413d212b465e4ab685d46201a678eb494 (patch)
treea0e359ac06de085ee6ef7050ea7e0c4f7477ee1b
parentc3170791c5b5632cea9b2cc51421a144bf657bf5 (diff)
parent1a370139d15a12580e66cbf3c594b554e8ba801c (diff)
downloadseccomp-tests-be22559413d212b465e4ab685d46201a678eb494.tar.gz
Fix CTS test
am: 1a370139d1 Change-Id: I3667efd164054dbb0cc688f55cd9a24de370184a
-rw-r--r--README.google1
-rw-r--r--linux/seccomp_bpf.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/README.google b/README.google
index 1f0ac50..54ffc04 100644
--- a/README.google
+++ b/README.google
@@ -10,3 +10,4 @@ Local Modifications:
- Use __android_log_print() instead of fprintf()
- Rename main() to seccomp_test_main()
- Add get_seccomp_test_list()
+- Fix pthread_join bug (https://android-review.googlesource.com/#/c/349407)
diff --git a/linux/seccomp_bpf.c b/linux/seccomp_bpf.c
index e0558fd..6f5b786 100644
--- a/linux/seccomp_bpf.c
+++ b/linux/seccomp_bpf.c
@@ -1845,8 +1845,10 @@ TEST_F(TSYNC, two_siblings_with_ancestor)
/* Ensure they are both killed and don't exit cleanly. */
pthread_join(self->sibling[0].tid, &status);
EXPECT_EQ(0x0, (long)status);
+ self->sibling[0].tid = 0;
pthread_join(self->sibling[1].tid, &status);
EXPECT_EQ(0x0, (long)status);
+ self->sibling[1].tid = 0;
}
TEST_F(TSYNC, two_sibling_want_nnp)
@@ -1911,8 +1913,10 @@ TEST_F(TSYNC, two_siblings_with_no_filter)
/* Ensure they are both killed and don't exit cleanly. */
pthread_join(self->sibling[0].tid, &status);
EXPECT_EQ(0x0, (long)status);
+ self->sibling[0].tid = 0;
pthread_join(self->sibling[1].tid, &status);
EXPECT_EQ(0x0, (long)status);
+ self->sibling[1].tid = 0;
}
TEST_F(TSYNC, two_siblings_with_one_divergence)
@@ -1956,8 +1960,10 @@ TEST_F(TSYNC, two_siblings_with_one_divergence)
/* Ensure they are both unkilled. */
pthread_join(self->sibling[0].tid, &status);
EXPECT_EQ(SIBLING_EXIT_UNKILLED, (long)status);
+ self->sibling[0].tid = 0;
pthread_join(self->sibling[1].tid, &status);
EXPECT_EQ(SIBLING_EXIT_UNKILLED, (long)status);
+ self->sibling[1].tid = 0;
}
TEST_F(TSYNC, two_siblings_not_under_filter)
@@ -2015,6 +2021,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter)
pthread_mutex_unlock(&self->mutex);
pthread_join(self->sibling[sib].tid, &status);
EXPECT_EQ(SIBLING_EXIT_UNKILLED, (long)status);
+ self->sibling[sib].tid = 0;
/* Poll for actual task death. pthread_join doesn't guarantee it. */
while (!kill(self->sibling[sib].system_tid, 0))
sleep(0.1);
@@ -2040,6 +2047,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter)
pthread_mutex_unlock(&self->mutex);
pthread_join(self->sibling[sib].tid, &status);
EXPECT_EQ(0, (long)status);
+ self->sibling[sib].tid = 0;
/* Poll for actual task death. pthread_join doesn't guarantee it. */
while (!kill(self->sibling[sib].system_tid, 0))
sleep(0.1);