aws / aws-iot-device-sdk-cpp

SDK for connecting to AWS IoT from a device using C++
http://aws-iot-device-sdk-cpp-docs.s3-website-us-east-1.amazonaws.com
Apache License 2.0
122 stars 111 forks source link

SSL_CTX_new() | Segmentation fault #200

Closed Sourabh-ALTEN closed 2 years ago

Sourabh-ALTEN commented 2 years ago

Describe the bug

Hello All,

We are currently using AWS IoT SDK-CPP v1 to build our application. But recently we are facing segmentation fault in the /network/OpenSSL/OpenSSLConnection.cpp when running the sdk. Its throwing error for

if ((p_ssl_context_ = SSL_CTX_new(method)) == NULL) {
                AWS_LOG_ERROR(OPENSSL_WRAPPER_LOG_TAG, " SSL INIT Failed - Unable to create SSL Context");
                return ResponseCode::NETWORK_SSL_INIT_ERROR;
            }

And the error message is:

if ((p_ssl_context_ = SSL_CTX_new(method)) == NULL) {
Program
  received signal SIGSEGV, Segmentation fault.

The method used is TLS_method(). We didn't made any changes to this section and it was running fine previously.

Can anyone please let me know what could be the issue and how to resolve it?

P.S: please let me knopw if further info is needed. Currently, switching to newer SDK is not an option for us.

Expected Behavior

No error message from OpenSSL

Current Behavior

Segmentation fault in /network/OpenSSL/OpenSSLConnection.cpp

Reproduction Steps

-

Possible Solution

No response

Additional Information/Context

No response

SDK version used

v1

Environment details (OS name and version, etc.)

Running SDK in VS Code with WSL connection to Docker container

jmklix commented 2 years ago

Which branch of this sdk are you using: Main or locking-fixes? The locking-fixes branch has a few fixes that might prevent the seg fault that you're seeing.

Sourabh-ALTEN commented 2 years ago

Hello @jmklix I am currently using Master default branch.

jmklix commented 2 years ago

Can you try using the locking-fixes branch?

github-actions[bot] commented 2 years ago

Greetings! It looks like this issue hasn’t been active in longer than a week. 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, also please try V2 as this might be solved there too.

github-actions[bot] commented 2 years ago

⚠️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.