Aws::ivsrealtime::Model::CreateParticipantTokenRequest Appears to Corrupt Memory? #3137
-
Hi all, I'm trying to create a basic C++ app that will grab a new participant token from a stage for IVS Realtime. However, I'm having some assertion issues when using the CreateParticipantTokenRequest object, and also the CreateParticipantTokenOutcome object (which is the response returned). Both appear to corrupt memory when deleted, even when they haven't been used and its the only piece of code in place.
Has anyone noticed this, or is there potentially something wrong with my build of the SDK? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I think there is something wrong with your environment or build of the SDK. Anecdotally i was not able to reproduce the issue you had using a MSVC toolchain, but also I was not able to reproduce your issue when running from a al-2023 docker image. Project Structure:
Dockerfile # Using offical Amazon Linux 2023 image from public ECR
FROM public.ecr.aws/amazonlinux/amazonlinux:2023
# Install compiler et al.
RUN yum groupinstall "Development Tools" -y
# Install required dependencies
RUN yum install -y ninja-build cmake3 curl-devel openssl-devel
# Install sdk
RUN git clone --depth 1 --recurse-submodules https://github.com/aws/aws-sdk-cpp && \
cd aws-sdk-cpp && \
mkdir build && \
cd build && \
cmake -G Ninja -DBUILD_ONLY="ivs-realtime" \
-DAUTORUN_UNIT_TESTS=OFF .. && \
cmake --build . && \
cmake --install .
## Copy over and build
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 -G Ninja .. && \
cmake --build .
CMakeLists.txt cmake_minimum_required(VERSION 3.13)
project(sdk_usage_workspace)
set(CMAKE_CXX_STANDARD 20)
find_package(AWSSDK REQUIRED COMPONENTS ivs-realtime)
add_executable(${PROJECT_NAME} "main.cpp")
target_link_libraries(${PROJECT_NAME} PRIVATE ${AWSSDK_LINK_LIBRARIES}) main.cpp #include <aws/core/Aws.h>
#include <aws/ivs-realtime/model/CreateParticipantTokenRequest.h>
auto main() -> int
{
Aws::SDKOptions options;
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
Aws::InitAPI(options);
{
{
Aws::ivsrealtime::Model::CreateParticipantTokenRequest request;
}
}
Aws::ShutdownAPI(options);
return 0;
}
replicate.sh #!/bin/zsh
set -u
# build image
docker build -t test-image .
# run example
docker run --name test-image test-image /sdk-example/build/sdk_usage_workspace when we run with |
Beta Was this translation helpful? Give feedback.
Hey, sorry I should have updated this discussion when I solved this a couple of weeks ago. Yes this was caused by a mismatch between C runtime environments. The SDK was being built dynamically linking to CRT, but my software was statically linking to it. Aligning those has resolved the issue.