Skip to content

Commit 19c1d03

Browse files
committed
tsan: ignore some errors in the clone_setns test
Some bots failed with: unshare failed: 1 https://lab.llvm.org/buildbot/#/builders/70/builds/14101 Look only for the target EINVAL error. Differential Revision: https://reviews.llvm.org/D113759
1 parent 4721ee7 commit 19c1d03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler-rt/test/tsan/Linux/clone_setns.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
#include <sys/wait.h>
1212

1313
static int cloned(void *arg) {
14-
if (unshare(CLONE_NEWUSER)) {
14+
// Unshare can fail for other reasons, e.g. no permissions,
15+
// so check only the error we are interested in:
16+
// if the process is multi-threaded unshare must return EINVAL.
17+
if (unshare(CLONE_NEWUSER) && errno == EINVAL) {
1518
fprintf(stderr, "unshare failed: %d\n", errno);
1619
exit(1);
1720
}

0 commit comments

Comments
 (0)