-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Segmentation fault in libaws-cpp-sdk-core.so on creation of Aws::Client::ClientConfiguration #1925
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
Comments
Hi @gi12345 can you send the cmake command line that you used to build? |
This is part of a very large system. We do not use cmake, all is built through make. |
Also, look at this one:
|
You are setting the ClientConfiguration outside CMotionUploader() {
InitAPI(options);
{
Aws::Client::ClientConfiguration clientConfig;
}
} |
|
Hi Daniel,
In my opinion the problem is caused by Aws::Client::ClientConfiguration m_cfg. I guess it is bound to an AWS internal constructor which runs prior to Aws::InitAPI(m_awsSDKoptions). C++ compiler performs class member variable handling prior to invoking class constructor method.If the class member variable definition Aws::Client::ClientConfiguration m_cfg would automatically call Aws::InitAPI() the problem would be solved. |
Hi Daniel, |
As an experiment I have modified my code as follows:
Ouput:
Crash stack trace:
Obtained 10 stack frames:
|
Reproduced this way: int main(int argc, char** argv)
{
printf("Point qqqqqqqqqqqqqqqqqq1\n");
Aws::SDKOptions k_awsSDKoptions;
Aws::InitAPI(k_awsSDKoptions);
printf("Point qqqqqqqqqqqqqqqqqqqqqq2\n");
{
Aws::Client::ClientConfiguration m_cfg; //xxx-gi
printf("Point qqqqqqqqqqqqqqqqqqqqqqq3\n");
} =========================================
=========================================
========================================== |
|
Code always crashes in this variable definition inside AWS SDK: |
in file AWSHttpResourceClient.cpp, Line 134: |
The latest AWS-C++ SDK (started June 1 2022) has linkage errors not seen before in the core.so library:
|
Hi Daniel, |
we see the same issue. use aws-sdk-cpp ver. 1.8.816, ubuntu20, use make, Intel 32bits App. The following lists the coredump backtrace and our codes ------ coredump backtrace ------
----- codes -------- class ApplicationState
{
public:
static ApplicationState& getInstance();
void addClientConfiguration();
private:
Aws::Client::ClientConfiguration* p_awsClientConfig;
}
ApplicationState &ApplicationState::getInstance() {
static ApplicationState appState;
return appState;
}
void ApplicationState::addClientConfiguration() {
p_awsClientConfig = new Aws::Client::ClientConfiguration();
}
main() {
Aws::SDKOptions options;
Aws::InitAPI(options);
ApplicationState::getInstance().addClientConfiguration(); // crash here !!!
} |
Can you make sure that you are making all sdk calls inside the #include <aws/core/Aws.h>
int main(int argc, char** argv)
{
Aws::SDKOptions options;
Aws::InitAPI(options);
{
// make your SDK calls here.
}
Aws::ShutdownAPI(options);
return 0;
} |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Segmentation fault in libaws-cpp-sdk-core.so on creation of Aws::Client::ClientConfiguration.
Stack trace and reproduction steps see below.
Expected Behavior
No segmentation fault
Current Behavior
Crash Trace:
Reproduction Steps
---- MotionUploader.h file ---------------------
---- MotionUploader.cpp file --------------------
Possible Solution
No response
Additional Information/Context
This code has been working before running daily for a couple of years. The AWS SDK used was about 2018.
The bug is most likely triggered by a design change inside AWS-SDK.
See also likely similar issue, but not for C++: Segmentation fault at Aws::Utils::Threading::ReaderWriterLock::LockReader () #1716
AWS CPP SDK version used
AWS-SDK-C++ version: new checkout and default build "S3-only" on April 18, 2022 OS: Built on Ubuntu-20 AARM64, run on AARM64-device
Compiler and Version used
Ubuntu20-gcc
Operating System and version
Ubuntu-20 AARM64
The text was updated successfully, but these errors were encountered: