Aws-sdk-cpp: Segmentation fault (core dumped) when declare S3 client in C++

Created on 22 Oct 2019  Â·  2Comments  Â·  Source: aws/aws-sdk-cpp

What platform/OS are you using?

linux

Which version of the SDK?

1.7.135

What compiler are you using? what version?

C++

Can you provide a TRACE level log? (sanitize any sensitive information)

When I tried to declare S3 client with the code

Aws::S3::S3Client s3_client();

It will fail and throw error

Segmentation fault (core dumped)

I confirmed that I have the correct credentials set up in ~/.aws/credentials and I can access to AWS S3 through terminal command:

aws s3 ls

I tried different version of SDK, they all have the same issue.
And I also have the same issue when try to initialize DynamoDB client through the command:

Aws::Client::ClientConfiguration clientConfig;
clientConfig.region = Aws::Region::US_EAST_1;
Aws::DynamoDB::DynamoDBClient dynamoClient(clientConfig);

It will also fail in the 3rd line.

guidance

Most helpful comment

Hi @sichao-uber , are you trying to run one of our code samples? If not can you provide a code snippet that replicates this issue?
And just kind of shooting in the dark here but, did you initialized the api?
Aws::InitAPI();

All 2 comments

Hi @sichao-uber , are you trying to run one of our code samples? If not can you provide a code snippet that replicates this issue?
And just kind of shooting in the dark here but, did you initialized the api?
Aws::InitAPI();

Hi, I am simply doing a test there, so my code is quite simple

void test()
{
    Aws::Client::ClientConfiguration clientConfig;
    clientConfig.region = Aws::Region::US_EAST_1;
    Aws::DynamoDB::DynamoDBClient dynamoClient(clientConfig);
}

And you are right. After I added

Aws::SDKOptions options;
Aws::InitAPI(options);

It works now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ComicSansMS picture ComicSansMS  Â·  3Comments

nicolasbonnard picture nicolasbonnard  Â·  4Comments

sisyphus79 picture sisyphus79  Â·  5Comments

efendizadeh picture efendizadeh  Â·  5Comments

KeithBlonquist picture KeithBlonquist  Â·  4Comments