Description
Confirm by changing [ ] to [x] below:
- [ x] I've gone though Developer Guide and API reference
- [x ] I've searched for previous similar issues and didn't find any solution
Platform/OS/Hardware/Device
What are you running the sdk on?
Create EC2MetadataClient
Describe the question
Got below core dump
#4 0x0000000000000000 in ?? ()
#5 0x000000ad9c87ad0b in Aws::Client::ClientConfiguration::ClientConfiguration() ()
from /tmp/debug-uw.H7NRyYLx/lib64/libaws-cpp-sdk-core.so
#6 0x000000ad9c8873ce in Aws::Internal::AWSHttpResourceClient::AWSHttpResourceClient(char const*) () from /tmp/debug-uw.H7NRyYLx/lib64/libaws-cpp-sdk-core.so
#7 0x000000ad9c887508 in Aws::Internal::EC2MetadataClient::EC2MetadataClient(char const*)
() from /tmp/debug-uw.H7NRyYLx/lib64/libaws-cpp-sdk-core.so
Logs/output
If applicable, add logs or error output.
Some logs before core dump
2021-06-23T07:27:27.941Z info VmkCtlAwsLogger: Aws_Init_Cleanup Initiate AWS SDK for C++ with Version:1.8.186
…
2021-06-23T07:27:27.943Z info VmkCtlAwsLogger: Aws::Config::AWSConfigFileProfileConfigLoader Unable to open config file /.aws/config for reading.
2021-06-23T07:27:27.943Z info VmkCtlAwsLogger: Aws::Config::AWSProfileConfigLoader Failed to reload configuration.
2021-06-23T07:27:27.944Z info VmkCtlAwsLogger: ClientConfiguration ClientConfiguration will use SDK Auto Resolved profile: [default] if not specified by users.
2021-06-23T07:27:27.944Z info VmkCtlAwsLogger: ClientConfiguration Retry Strategy will use the default max attempts.
2021-06-23T07:27:27.944Z info VmkCtlAwsLogger: EC2MetadataClient Creating AWSHttpResourceClient with max connections 2 and scheme HTTP
2021-06-23T07:27:27.944Z info VmkCtlAwsLogger: CurlHandleContainer Initializing CurlHandleContainer with size 2
2021-06-23T07:27:27.944Z info VmkCtlAwsLogger: ClientConfiguration ClientConfiguration will use SDK Auto Resolved profile: [default] if not specified by users.
2021-06-23T07:27:27.944Z info VmkCtlAwsLogger: ClientConfiguration Retry Strategy will use the default max attempts.
Then the system got a core dump.
I tried to add some debug logs locally. I see it goes into line 129 but didn't call into GetCurrentRegion() at all. So I guess the core dump is supposed to be caused at line 130
https://github.com/aws/aws-sdk-cpp/blob/main/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp
125 if (Aws::Utils::StringUtils::ToLower(Aws::Environment::GetEnv("AWS_EC2_METADATA_DISABLED").c_str()) != "true")
126 {
127 auto client = Aws::Internal::GetEC2MetadataClient();
128 if (client)
129 {
130 region = client->GetCurrentRegion(); <-----------------
131 }
132 }
Seems it failed to invoke the function GetCurrentRegion(). It looks really weird. Please AWS experts help with it. Thanks.
SDK version number:
1.8.186