aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.98k stars 1.06k forks source link

Avoid processing log statement if logger has been destructed #2833

Closed SergeyRyabinin closed 9 months ago

SergeyRyabinin commented 9 months ago

in the middle of logging

Issue #, if available:

in case of heavy mis-use of basic-use such as in

TEST(AwsMemoryManagementTest, MultiInitParallel)

the logger may perform

m_syncData.m_queuedLogMessages.emplace_back(std::move(statement));

on already destructed self. With custom memory management enabled, it will result in UB.

Description of changes:

Check all that applies:

Check which platforms you have built SDK on to verify the correctness of this PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.