Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init/Shutdown sequence cannot be done twice #3128

Closed
rohansuri opened this issue Sep 26, 2024 · 4 comments
Closed

Init/Shutdown sequence cannot be done twice #3128

rohansuri opened this issue Sep 26, 2024 · 4 comments

Comments

@rohansuri
Copy link

rohansuri commented Sep 26, 2024

Describe the bug

Hello,

It seems even after ref counting of Init/Shutdown has been added in #2411, doing a sequence of Init/Shutdown twice, fails.

In pseudocode:

Init
Do S3Get
Shutdown

Init
Do S3Get  // Fails with curlCode: 35, SSL connect error
Shutdown

Expected Behavior

It seems the SDK requires us to ensure, once Shutdown is called, we can never Init again?

Current Behavior

The outcome of S3 GET API is: curlCode: 35, SSL connect error

Reproduction Steps

Here's a GTest:

TEST_F(S3Test, awsdk){    
    Aws::SDKOptions options;
    Aws::InitAPI(options);
    Aws::S3::S3ClientConfiguration config;
    auto client = std::make_unique<Aws::S3::S3Client>(config);

    // GET
    auto get = [&](){
        Aws::S3::Model::GetObjectRequest request;
        request.SetBucket("my-bucket");
        request.SetKey("my-key");

        auto outcome = client->GetObject(request);
        if(!outcome.IsSuccess()){
            std::cout << "GET FAILED " << outcome.GetError().GetMessage() << std::endl;
        }
    };

    get(); // THIS SUCCEEDS
    client.reset();
    Aws::ShutdownAPI(options);

    Aws::InitAPI(options);
    client = std::make_unique<Aws::S3::S3Client>(config);
    get(); // THIS FAILS
    client.reset();
    Aws::ShutdownAPI(options);
}

The relevant output is:
GET FAILED curlCode: 35, SSL connect error

The entire output is:

./fusion_gtest --gtest_filter="*S3Test*sdk*"
Note: Google Test filter = *S3Test*sdk*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from S3Test
[ RUN      ] S3Test.awsdk
GET FAILED curlCode: 35, SSL connect error
[       OK ] S3Test.awsdk (30331 ms)
[----------] 1 test from S3Test (30331 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (30331 ms total)
[  PASSED  ] 1 test.

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.11.411

Compiler and Version used

Apple clang version 15.0.0 (clang-1500.3.9.4)

Operating System and version

MacOS 14.4.1

@rohansuri rohansuri added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 26, 2024
@sbiscigl
Copy link
Contributor

I tried replicating and could not. I do think think this about the warning we have on the repo main page

⚠️ If you are using macOS Sonoma, there is a #2804 where using libcurl version 8.4.0 on macOS can lead to issues. curl/curl#12525. In the meanwhile, please use an updated version of curl from Homebrew. You can include this in your project via the CMAKE_PREFIX_PATH.

cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/curl/" \
 -DAUTORUN_UNIT_TESTS=OFF \
 -DBUILD_ONLY="s3" \
 -DCMAKE_INSTALL_PREFIX="~/sdk-install" \

using a brew install or custom install of curl and not the one that ships with macOS should fix your problem

@sbiscigl sbiscigl added build-problem problems with building this sdk response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 26, 2024
@rohansuri
Copy link
Author

Thank you @sbiscigl !
That indeed fixed the issue.

-- Found CURL: /opt/homebrew/opt/curl/lib/libcurl.dylib (found version "8.10.1")  
--   Curl include directory: /opt/homebrew/opt/curl/include
--   Curl target link: /opt/homebrew/opt/curl/lib/libcurl.dylib

@sbiscigl
Copy link
Contributor

cool give a shout if you have anymore issues!

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@sbiscigl sbiscigl removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. build-problem problems with building this sdk labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants