{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-cpp/issues/633","repository_url":"https://api.github.com/repos/aws/aws-sdk-cpp","labels_url":"https://api.github.com/repos/aws/aws-sdk-cpp/issues/633/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-cpp/issues/633/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-cpp/issues/633/events","html_url":"https://github.com/aws/aws-sdk-cpp/issues/633","id":248124579,"number":633,"title":"Valgrind report memory leaks on Aws::Utils::Crypto::Sha256OpenSSLImpl::Calculate","user":{"login":"aviggiano","id":3029017,"avatar_url":"https://avatars2.githubusercontent.com/u/3029017?v=4","gravatar_id":"","url":"https://api.github.com/users/aviggiano","html_url":"https://github.com/aviggiano","followers_url":"https://api.github.com/users/aviggiano/followers","following_url":"https://api.github.com/users/aviggiano/following{/other_user}","gists_url":"https://api.github.com/users/aviggiano/gists{/gist_id}","starred_url":"https://api.github.com/users/aviggiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aviggiano/subscriptions","organizations_url":"https://api.github.com/users/aviggiano/orgs","repos_url":"https://api.github.com/users/aviggiano/repos","events_url":"https://api.github.com/users/aviggiano/events{/privacy}","received_events_url":"https://api.github.com/users/aviggiano/received_events","type":"User","site_admin":false},"labels":[{"id":210264937,"url":"https://api.github.com/repos/aws/aws-sdk-cpp/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-04T21:44:12Z","updated_at":"2017-08-10T22:10:50Z","closed_at":"2017-08-10T22:10:50Z","body":"Hello,\r\n\r\nValgrind is reporting a memory leak on the C++ SDK when I use the documentation examples from the [aws-doc-sdk-examples](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/cpp/example_code/sqs/send_message.cpp) repository. \r\n\r\nHere I am using the SQS client, but I was able to reproduce the same issue with the SNS client and analogous functions. Please find the logs below:\r\n\r\n```\r\n$ valgrind --leak-check=full --track-origins=yes ./send_message \"<queue_url>\" \"message\"\r\n==8878== Memcheck, a memory error detector\r\n==8878== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.\r\n==8878== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info\r\n==8878== Command: ./send_message <queue_url> message\r\n==8878== \r\nSuccessfully sent message to <queue_url>\r\n==8878== \r\n==8878== HEAP SUMMARY:\r\n==8878==     in use at exit: 73,296 bytes in 17 blocks\r\n==8878==   total heap usage: 8,764 allocs, 8,747 frees, 1,080,092 bytes allocated\r\n==8878== \r\n==8878== 144 bytes in 3 blocks are definitely lost in loss record 11 of 13\r\n==8878==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==8878==    by 0x6502DB2: CRYPTO_malloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)\r\n==8878==    by 0x658DEA6: EVP_MD_CTX_create (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)\r\n==8878==    by 0x543BEE1: Aws::Utils::Crypto::Sha256OpenSSLImpl::Calculate(std::istream&) (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x542526E: Aws::Utils::Crypto::Sha256::Calculate(std::istream&) (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x54065AF: Aws::Client::AWSAuthV4Signer::ComputePayloadHash(Aws::Http::HttpRequest&) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x54046AC: Aws::Client::AWSAuthV4Signer::SignRequest(Aws::Http::HttpRequest&, bool) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x54128BB: Aws::Client::AWSClient::AttemptOneRequest(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x541173D: Aws::Client::AWSClient::AttemptExhaustively(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x541539E: Aws::Client::AWSXMLClient::MakeRequest(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x4F46589: Aws::SQS::SQSClient::SendMessage(Aws::SQS::Model::SendMessageRequest const&) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-sqs/libaws-cpp-sdk-sqs.so)\r\n==8878==    by 0x40EE9B: main (in /home/aviggiano/aws-test/aws-doc-sdk-examples/cpp/build/send_message)\r\n==8878== \r\n==8878== 144 bytes in 3 blocks are definitely lost in loss record 12 of 13\r\n==8878==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==8878==    by 0x6502DB2: CRYPTO_malloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)\r\n==8878==    by 0x658DEA6: EVP_MD_CTX_create (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)\r\n==8878==    by 0x543BDE5: Aws::Utils::Crypto::Sha256OpenSSLImpl::Calculate(std::basic_string<char, std::char_traits<char>, Aws::Allocator<char> > const&) (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x542522C: Aws::Utils::Crypto::Sha256::Calculate(std::basic_string<char, std::char_traits<char>, Aws::Allocator<char> > const&) (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x5404E17: Aws::Client::AWSAuthV4Signer::SignRequest(Aws::Http::HttpRequest&, bool) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x54128BB: Aws::Client::AWSClient::AttemptOneRequest(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x541173D: Aws::Client::AWSClient::AttemptExhaustively(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x541539E: Aws::Client::AWSXMLClient::MakeRequest(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)\r\n==8878==    by 0x4F46589: Aws::SQS::SQSClient::SendMessage(Aws::SQS::Model::SendMessageRequest const&) const (in /home/aviggiano/aws/deps/aws-sdk-cpp/build/aws-cpp-sdk-sqs/libaws-cpp-sdk-sqs.so)\r\n==8878==    by 0x40EE9B: main (in /home/aviggiano/aws-test/aws-doc-sdk-examples/cpp/build/send_message)\r\n==8878== \r\n==8878== LEAK SUMMARY:\r\n==8878==    definitely lost: 288 bytes in 6 blocks\r\n==8878==    indirectly lost: 0 bytes in 0 blocks\r\n==8878==      possibly lost: 0 bytes in 0 blocks\r\n==8878==    still reachable: 73,008 bytes in 11 blocks\r\n==8878==         suppressed: 0 bytes in 0 blocks\r\n==8878== Reachable blocks (those to which a pointer was found) are not shown.\r\n==8878== To see them, rerun with: --leak-check=full --show-leak-kinds=all\r\n==8878== \r\n==8878== For counts of detected and suppressed errors, rerun with: -v\r\n==8878== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)\r\n```\r\n\r\nI also opened [an issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/86) there since I am not sure whether the problem is with the lib or with the example."},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-cpp/issues/comments/321687277","html_url":"https://github.com/aws/aws-sdk-cpp/issues/633#issuecomment-321687277","issue_url":"https://api.github.com/repos/aws/aws-sdk-cpp/issues/633","id":321687277,"user":{"login":"singku","id":3468296,"avatar_url":"https://avatars2.githubusercontent.com/u/3468296?v=4","gravatar_id":"","url":"https://api.github.com/users/singku","html_url":"https://github.com/singku","followers_url":"https://api.github.com/users/singku/followers","following_url":"https://api.github.com/users/singku/following{/other_user}","gists_url":"https://api.github.com/users/singku/gists{/gist_id}","starred_url":"https://api.github.com/users/singku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singku/subscriptions","organizations_url":"https://api.github.com/users/singku/orgs","repos_url":"https://api.github.com/users/singku/repos","events_url":"https://api.github.com/users/singku/events{/privacy}","received_events_url":"https://api.github.com/users/singku/received_events","type":"User","site_admin":false},"created_at":"2017-08-10T22:10:50Z","updated_at":"2017-08-10T22:10:50Z","body":"Fixed, will push out soon"}}
{"actor":{"display_login":"singku"}}