aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2017-03-15 16:12:55 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-15 16:12:55 +0000
commita30806fac718829c9744b6675e6583cbf2eaf5b4 (patch)
treea0e359ac06de085ee6ef7050ea7e0c4f7477ee1b
parent1bea0ca97d54ec53110edcb5b7550eafc0c75034 (diff)
parented1f0ad1b8f69ecd24fc42d4cc1a811f016ba663 (diff)
downloadseccomp-tests-a30806fac718829c9744b6675e6583cbf2eaf5b4.tar.gz
Fix CTS test am: 1a370139d1 am: be22559413
am: ed1f0ad1b8 Change-Id: I640224f94c732f23e881fbe860aeaf2d48185b46
-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);