[compiler-rt] ea02eda - [sanitizer][test] Print result in getpwnam_r_invalid_user.cpp (#162217)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 09:48:45 PDT 2025


Author: Thurston Dang
Date: 2025-10-07T09:48:41-07:00
New Revision: ea02eda911960623bc6f79796e7757439ffdfa3b

URL: https://github.com/llvm/llvm-project/commit/ea02eda911960623bc6f79796e7757439ffdfa3b
DIFF: https://github.com/llvm/llvm-project/commit/ea02eda911960623bc6f79796e7757439ffdfa3b.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp
index c0d6cfea1fbef..4c6cffee05e51 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp
@@ -14,6 +14,8 @@ int main(void) {
   struct passwd *pwdres;
   char buf[10000];
   int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres);
+  fprintf(stderr, "Result: %d\n", res);
+  fflush(stderr);
   assert(res == 0 || res == ENOENT);
   assert(pwdres == 0);
   return 0;


        


More information about the llvm-commits mailing list