Search code examples
amazon-web-servicesaws-sdkaws-sdk-cpp

Fatal error condition occurred in c:209: allocator != ((void *)0) - aws-sdk-cpp


I'm having an issue after updating: Upload an object to an Amazon S3 bucket using an AWS SDK:(https://docs.aws.amazon.com/AmazonS3/latest/userguide/example_s3_PutObject_section.html)

int main(int, char **)
{
    Aws::SDKOptions options;
    classB::initAwsApi(options);
    
        while (true)
    {

        
        //...
        
        if (threadApi.joinable())
        threadApi.join();
        
        threadApi = std::thread(request, &connection, &headers);
        std::this_thread::sleep_for(std::chrono::seconds(5));
        // if I close the stream, the error doesn't appear. But I would like to close the stream
        stream_.release();
    }
    
    if (threadApi.joinable())
            threadApi.join();

    // when closing the SDK, the error appears
    classB::shutdownAwsApi(options);
}

output: Fatal error condition occurred in /home/x/x/deps/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-c-common/source/allocator.c:209: allocator != ((void *)0) Exiting Application No call stack information available Aborted(core dumped)


Solution

  • the error was in the new version of aws. I lowered the version and compiled it again and it worked