Closed Otto45 closed 1 year ago
It looks like you're missing the InitAPI
call
@jmklix, the samples in this repo show that simply creating an instance of ApiHandle
does the global initialization for the SDK. I also understand this initialization needs to be done before everything else, and the object must outlive any other AWS SDK/CRT objects. As I mentioned above, this works on my laptop, so what is different about using InitAPI
? I don't see any reference to it in this repo or the CRT C++ repo, am I missing something?
My mistake, I was confusing this with aws-sdk-cpp. Looking into this segfault
@jmklix after setting up a cross-compilation toolchain and remote debugging using our generated yocto sdk, we were able to finally determine the issue has to do with setting the optimization level to 2 with the compiler flag -O2
. Because we use yocto to build our OS image, it automatically sets this compiler flag for standard, or non-debug, builds. We overrode this functionality (setting the optimization to -O0
) in the recipes for all the aws libraries and our libraries / binaries, and everything is working now.
Glad you were able to get this working. Let me know if you have any other problems with this sdk
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.
Describe the bug
I'm creating an instance of
MqttClientConnectionConfig
using theMqttClientConnectionConfigBuilder
, and when the function I'm doing this in ends, I'm getting a segfault when theMqttClientConnectionConfig
's destructor is called. The segfault is technically occurring trying to destroy a CRT string on theOptional<HttpClientConnectionProxyOptions>
member ofMqttClientConnectionConfig
. I'm not setting any proxy options using theWithHttpProxyOptions
function onMqttClientConnectionConfigBuilder
.Expected Behavior
No segmentation fault should occur.
Current Behavior
Stacktrace:
Reproduction Steps
main.cpp:
CMakeLists.txt:
Possible Solution
No response
Additional Information/Context
The code works just fine when compiled for x86 and ran on my laptop, but the segfault is occurring when the code is cross-compiled and running on our SoM boards.
SoM Board Specs:
SDK version used
v1.21.0
Environment details (OS name and version, etc.)
Yocto Zeus FSL 5.4.3