Skip to content

Commit 93aba1e

Browse files
authored
[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.
1 parent 13c464b commit 93aba1e

File tree

1 file changed

+4
-6
lines changed
  • libcxx/test/std/input.output/file.streams/fstreams/filebuf.members

1 file changed

+4
-6
lines changed

libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010

1111
// basic_filebuf<charT,traits>* close();
1212

13-
// This test closes an fd that belongs to a std::filebuf, and Bionic's fdsan
14-
// detects this and aborts the process, starting in Android R (API 30).
15-
// See D137129.
16-
// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{2[1-9]}}
17-
1813
#include <fstream>
1914
#include <cassert>
2015
#if defined(__unix__)
@@ -37,7 +32,10 @@ int main(int, char**)
3732
assert(f.close() == nullptr);
3833
assert(!f.is_open());
3934
}
40-
#if defined(__unix__)
35+
// Starting with Android API 30+, Bionic's fdsan aborts a process that calls
36+
// close() on a file descriptor tagged as belonging to something else (such
37+
// as a FILE*).
38+
#if defined(__unix__) && !defined(__BIONIC__)
4139
{
4240
std::filebuf f;
4341
assert(!f.is_open());

0 commit comments

Comments
 (0)