Closed normanade closed 6 months ago
Thanks for finding this and opening a PR to fix it. Reviewing and testing your PR.
PR has been merged.
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
Aws::S3::S3Client leaks memory on Windows, when uses windows api BCrypt. Aws::Utils::Crypto::BCryptHashImpl, which is used by the default signer Aws::Auth::AWSAuthV4Signer on windows (when AWS_LC cmake option OFF), failed to deconstruct correctly, and leaks memory by 2800KiB per 1k construction & deconstruction call pairs.
Expected Behavior
Aws::S3::S3Client should construct and deconstruct without memory leak.
Current Behavior
Per 1k call pair of Aws::S3::S3Client construction & deconstruction, the whole program leaks about 2800KiB memory. Using Visual Studio's heap analyzer, difference of heap snapshot between the beginning and the ending of the program shows that certain parts of Aws::Utils::Crypto::BCryptHashImpl stays unreleased.
Reproduction Steps
Possible Solution
Aws::Utils::Crypto::BCryptHashImpl & Aws::Utils::Crypto::BCryptHashContext didn't deconstruct correctly. Deconstruct all the member variables should fix the problem.
Additional Information/Context
No response
AWS CPP SDK version used
1.11.290
Compiler and Version used
Visual Studio 2022
Operating System and version
Windows 10