aws-sdk-cpp
aws-sdk-cpp copied to clipboard
Segmentation fault in S3CrtClient::init()
Describe the bug
Credential provider may not be initialized resulting in a segmentation fault here:
https://github.com/aws/aws-sdk-cpp/blob/4db1ff69fa185c7910394f4a6462cbea278a1707/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp#L223
Expected behavior
Log an error and abort initialization.
Current behavior
Segmentation fault
Steps to Reproduce
Set credential provider to environment but don't setup access key via environment variable.
access_key_id_cursor.len will then be 0 here https://github.com/awslabs/aws-c-auth/blob/f29ffca89dc0b6a1d722ae9bacb230ec9dc765f4/source/credentials.c#L67
resulting in that no credential provider is initialized
Possible Solution
No response
AWS CPP SDK version used
1.9
Compiler and Version used
clang --10
Operating System and version
Ubuntu
Hi @MarcusHellqvist , Yea I am able to reproduce this too, thanks for bringing this up, we'll take a look.
I've encountered a similar problem and my workaround is to forcibly exclude EnvironmentAWSCredentialsProvider that is normally part of the DefaultAWSCredentialsProviderChain chain. In our case, this change doesn't break any of our existing deployments.
I run into this right now.
unknown location(0): fatal error: in "memory_access_violation_test": memory access violation at address: 0x00000000: no mapping at fault address
test_s3client.cc(136): last checkpoint: "memory_access_violation_test" test entry
BOOST_AUTO_TEST_CASE(memory_access_violation_test)
{
auto executor = Aws::MakeShared<Aws::Utils::Threading::PooledThreadExecutor>("s3-executor", 10);
Aws::S3Crt::ClientConfiguration configClient;
configClient.endpointOverride = "http://127.0.0.1:9888";
configClient.executor = executor;
configClient.enableHostPrefixInjection = false;
configClient.scheme = Aws::Http::Scheme::HTTP;
Aws::S3Crt::S3CrtClient client{
Aws::Auth::AWSCredentials{"", ""},
configClient,
Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never,
false /* useVirtualAddressing */,
Aws::S3Crt::US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET};
(void)client;
}
Should be resolved now, re-open if you have a case where it does not.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.