Closed rohitnsb closed 7 months ago
I've haven't been able to reproduce the same crash that you are seeing in ubuntu 22.04. Are you calling InitApi multiple times? Can you provide more detailed reproduction steps? I used the following samples and I was able to run without any problems:
main.cpp
#include <iostream>
#include <aws/core/Aws.h>
using namespace std;
using namespace Aws;
int main() {
Aws::SDKOptions options;
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
Aws::InitAPI(options);
{
std::cout << "Test" <<std::endl;
}
Aws::ShutdownAPI(options);
return 0;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(issue_2913)
set(CMAKE_CXX_STANDARD 20)
find_package(AWSSDK REQUIRED COMPONENTS kms s3 s3-encryption ec2)
add_executable(${PROJECT_NAME} "main.cpp")
target_link_libraries(${PROJECT_NAME} ${AWSSDK_LINK_LIBRARIES})
building the sample
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="<path to install location>"
cmake --build . --config Debug
I created a new docker and built with below command, still I see the same error
can you check if steps are correct?
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp mkdir sd-build apt-get update cd sd-build/ apt-get install cmake apt install zlib1g-dev apt-get install libssl-dev apt-get install libcurl4-openssl-dev cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/lib -DBUILD_ONLY="kms;s3;s3-encryption;ec2;core" cmake --build . --config Debug
It looks like what you're doing is mostly correct, but I had to add a few things to get the container working. Here is the entire dockerfile that I used to test this. Please let me know if this doesn't work for you:
FROM ubuntu:22.04
#install deps
RUN apt-get update
RUN apt-get install -y git cmake zlib1g-dev libssl-dev libcurl4-openssl-dev build-essential
#clone and build sdk
RUN git clone --depth 1 --recurse-submodules https://github.com/aws/aws-sdk-cpp && \
cd aws-sdk-cpp && \
mkdir build && \
cd build && \
cmake -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY="kms;s3;s3-encryption;ec2" .. && \
cmake --build . && \
cmake --install .
#copy code and build sample application
RUN mkdir sdk-example
COPY CMakeLists.txt sdk-example/CMakeLists.txt
COPY main.cpp sdk-example/main.cpp
RUN cd sdk-example && \
mkdir build && \
cd build && \
cmake .. && \
cmake --build .
ENTRYPOINT [ "./sdk-example/build/issue_2913" ]
Was ablt to build and init aws SDK with above commands Not sure what step I missed
Thanks, now it it initing
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the bug
I built the aws cpp sdk and on initAPI it is crashing below is the dump
Expected Behavior
should not crash
Current Behavior
crash
Reproduction Steps
call InitAPI()
Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
1.11.293
Compiler and Version used
gcc version 11.4.0
Operating System and version
ubuntu 22.04