S3Client Leaks Memory on Windows caused by BCrypt API Misuse #2918
Labels
bug
This issue is a bug.
p2
This is a standard priority issue
pending-release
This issue will be fixed by an approved PR that hasn't been released yet.
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
The text was updated successfully, but these errors were encountered: