SDK crashing with s2n_init() failed (Embedded Linux, buildroot) #505
-
Hello every, We are currently migrating our IoT solution to AWS and we are stuck at the last phase - adjusting our devices code to connect with IoT Core using the aws-iot-device-sdk-cpp-v2 library. Our devices are based on Microchp's SAMA5D27-SOM1 (ARM Cortex-V5 CPU, 128MB RAM) running an Embedded Linux OS. Our user space application (C++ daemon) is the software communicating with IoT Core (MQTT over Websocket). As our cross compilation system, we use buildroot, which cross compiles the Linux Kernel, libraries, application and packages everything into a bootable image and a cross compiled custom SDK for application development (all the headers, libraries etc. used to build applications for the target platform). The AWS SDK is built as part of buildroot (AKA. a "package") and we can verify that our application is linking successfully with the shared objects created (for ARM). We are using SDK v1.20.0 (the tag in the github repo). The issue we are facing is at the initial usage of the SDK, as seen in the samples code:
which causes the application to terminate with the following error printed to the terminal:
The AWS C++ SDK is defined as the following buildroot package and cross-builds all shared libraries successfully (which are also linked successfully with our application's executable and installed correctly to the target's root file system / sysroot):
Looking into #343 which seems somewhat similar we tried cross-building the library with the following cmake flags, with no effect:
As the issue above (#343) suggested, we also tried tweaking the We did notice differences between the compiler output when compiling with the USE_OPENSSL flag and when compiling without it. When building with -DUSE_OPENSSL the cmake script finds the correct libcrypto.so file but declares a strange version - The version found is 1.1.1g while the actual version is 1.1.1p - This is in spite of the libcrypto.so file being of the correct version (1.1.1p).
When building without the flag the build seems to include the OpenSSL headers from the correct location (our custom Linux SDK). I assume it is linking with the libcrypto.so library although not mentioned (?).
In both builds we can see that the OpenSSL include files are coming from the correct path. Looking into this file: https://github.com/aws/s2n-tls/blob/main/CMakeLists.txt , we have also tried the INTERNING flag, but we were unable to build it, even with a static library (libcrypto.a). So we are a bit confused if and what we're missing and how to approach and solve this. It seems like something wrong is being picked up by cmake If any more info is required - we will be happy to work on getting it. Your assistance is highly appreciated, Omri |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
@omri-s-electreon which embedded linux build system are you using? I know Microchip supports both yocto and buildroot - if you are using yocto, are you using the aws bitbake layer? https://github.com/aws4embeddedlinux/meta-aws EDIT: Nevermind, I see you're using buildroot. We have a contributor who maintains buildroot recipes. https://github.com/aduskett/buildroot-aws-iot - recipes might be outdated and require version adjustment. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
This should no longer be a problem as s2n is no longer a dependency. Please let us know if you run into any other problems with this sdk.