Skip to content

Commit

Permalink
apacheGH-41163: [C++][FS][Azure] Run TestGetFileInfoGenerator() with …
Browse files Browse the repository at this point in the history
…Valgrind again

We use conda's libxml2. It didn't use `--with-tls` but 2.12.6-2 or
later uses `--with-tls`. It may suppress a detected leak.
  • Loading branch information
kou committed Apr 18, 2024
1 parent be5f5b8 commit 94aa38e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
15 changes: 0 additions & 15 deletions cpp/src/arrow/filesystem/azurefs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,6 @@ class TestGeneric : public ::testing::Test, public GenericFileSystemTest {
bool have_directory_mtimes() const override { return true; }
bool have_flaky_directory_tree_deletion() const override { return false; }
bool have_file_metadata() const override { return true; }
// calloc() used in libxml2's xmlNewGlobalState() is detected as a
// memory leak like the following. But it's a false positive. It's
// used in ListBlobsByHierarchy() for GetFileInfo() and it's freed
// in the call. This is detected as a memory leak only with
// generator API (GetFileInfoGenerator()) and not detected with
// non-generator API (GetFileInfo()). So this is a false positive.
//
// ==2875409==ERROR: LeakSanitizer: detected memory leaks
//
// Direct leak of 968 byte(s) in 1 object(s) allocated from:
// #0 0x55d02c967bdc in calloc (build/debug/arrow-azurefs-test+0x17bbdc) (BuildId:
// 520690d1b20e860cc1feef665dce8196e64f955e) #1 0x7fa914b1cd1e in xmlNewGlobalState
// builddir/main/../../threads.c:580:10 #2 0x7fa914b1cd1e in xmlGetGlobalState
// builddir/main/../../threads.c:666:31
bool have_false_positive_memory_leak_with_generator() const override { return true; }

BaseAzureEnv* env_;
std::shared_ptr<AzureFileSystem> azure_fs_;
Expand Down
6 changes: 0 additions & 6 deletions cpp/src/arrow/filesystem/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,6 @@ void GenericFileSystemTest::TestGetFileInfoSelector(FileSystem* fs) {
}

void GenericFileSystemTest::TestGetFileInfoGenerator(FileSystem* fs) {
#if defined(ADDRESS_SANITIZER) || defined(ARROW_VALGRIND)
if (have_false_positive_memory_leak_with_generator()) {
GTEST_SKIP() << "Filesystem have false positive memory leak with generator";
}
#endif

ASSERT_OK(fs->CreateDir("AB/CD"));
CreateFile(fs, "abc", "data");
CreateFile(fs, "AB/def", "some data");
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/filesystem/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ class ARROW_TESTING_EXPORT GenericFileSystemTest {
virtual bool have_flaky_directory_tree_deletion() const { return false; }
// - Whether the filesystem stores some metadata alongside files
virtual bool have_file_metadata() const { return false; }
// - Whether the filesystem has a false positive memory leak with generator
virtual bool have_false_positive_memory_leak_with_generator() const { return false; }

void TestEmpty(FileSystem* fs);
void TestNormalizePath(FileSystem* fs);
Expand Down

0 comments on commit 94aa38e

Please sign in to comment.