Skip to content

Commit ea02eda

Browse files
authored
[sanitizer][test] Print result in getpwnam_r_invalid_user.cpp (#162217)
This test has been flaky failing on sanitizer-ppc64le-linux since at least 9 days ago (https://lab.llvm.org/buildbot/#/builders/72/builds/15257), but the exact cause is unclear because the only output is that `assert(res == 0 || res == ENOENT);` failed. To aid debugging, this patch prints out the result of the `getpwnam_r` call.
1 parent f015c7f commit ea02eda

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ int main(void) {
1414
struct passwd *pwdres;
1515
char buf[10000];
1616
int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres);
17+
fprintf(stderr, "Result: %d\n", res);
18+
fflush(stderr);
1719
assert(res == 0 || res == ENOENT);
1820
assert(pwdres == 0);
1921
return 0;

0 commit comments

Comments
 (0)