frreiss opened a new issue, #39897:
URL: https://github.com/apache/arrow/issues/39897
### Describe the bug, including details regarding any error messages,
version, and platform.
On MacOS, with Arrow version 15.0.0 and AWS SDK for C++ version 1.11.250,
calling the C++ function `arrow::fs::FileSystemFromUri()` simultaneously from
multiple threads results in a segmentation fault.
Here is a program that reproduces the problem on my machine:
```c++
#include <iostream>
#include <thread>
#include <arrow/api.h>
#include <arrow/filesystem/api.h>
void thread_main()
{
// Call FileSystemFromURI() and check the returned status code.
std::string path;
auto result = arrow::fs::FileSystemFromUri("s3://bucket/key", &path);
if (result.ok()){
std::cout << std::this_thread::get_id() << ": FileSystemFromUri()
succeeded." << std::endl;
} else {
std::cout << std::this_thread::get_id() << ": FileSystemFromUri()
failed." << std::endl;
}
}
int main()
{
const int num_threads = 2;
auto threads = std::vector<std::thread>();
for (int i = 0; i < num_threads; i++)
{
threads.push_back(std::thread(thread_main));
}
for (auto &thread : threads)
{
thread.join();
}
// This line would prevent a segfault if the above code were to work.
(void)arrow::fs::FinalizeS3();
}
```
This program should produce output like:
```
0x16eeeb000: FileSystemFromUri() succeeded.
0x16b5a7000: FileSystemFromUri() succeeded.
```
Instead, it experiences a segmentation fault before printing any output.
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]