From 93aba1e240dbf8fa8f71cbc05dcae2dc1498c2dd Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Wed, 7 May 2025 12:27:19 -0700 Subject: [PATCH] [libc++][Android] Disable fdsan in filebuf close.pass.cpp (#102412) fdsan is Bionic's "File Descriptor Sanitizer". Starting in API 30+, it aborts this close.pass.cpp test, because it closes the FD belonging to std::filebuf's FILE*. For `__BIONIC__`, disable that part of the test. --- .../fstreams/filebuf.members/close.pass.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp index e0338e6f619b..43233decf1b3 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp @@ -10,11 +10,6 @@ // basic_filebuf* close(); -// This test closes an fd that belongs to a std::filebuf, and Bionic's fdsan -// detects this and aborts the process, starting in Android R (API 30). -// See D137129. -// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{2[1-9]}} - #include #include #if defined(__unix__) @@ -37,7 +32,10 @@ int main(int, char**) assert(f.close() == nullptr); assert(!f.is_open()); } -#if defined(__unix__) + // Starting with Android API 30+, Bionic's fdsan aborts a process that calls + // close() on a file descriptor tagged as belonging to something else (such + // as a FILE*). +#if defined(__unix__) && !defined(__BIONIC__) { std::filebuf f; assert(!f.is_open());