Skip to content

Conversation

@marczych
Copy link
Contributor

This fixes the following Valgrind failure:

==6158== Conditional jump or move depends on uninitialised value(s)
==6158==    at 0x4738F2: RestClient::Connection::performCurlRequest(std::string const&) (REDACTED)
==6158==    by 0x473D10: RestClient::Connection::get(std::string const&) (REDACTED)
==6158==    by 0x472779: RestClient::get(std::string const&) (REDACTED)
==6158==    by 0x40E59F: RestClientCpp_Http_Test::TestBody() (REDACTED)
==6158==    by 0x447798: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (REDACTED)
==6158==    by 0x43A2CE: testing::Test::Run() (REDACTED)
==6158==    by 0x43A38C: testing::TestInfo::Run() (REDACTED)
==6158==    by 0x43A4A4: testing::TestCase::Run() (REDACTED)
==6158==    by 0x43A757: testing::internal::UnitTestImpl::RunAllTests() (REDACTED)
==6158==    by 0x43A9F8: testing::UnitTest::Run() (REDACTED)
==6158==    by 0x40C99F: main (REDACTED)
==6158==
{
   <insert_a_suppression_name_here>
   Memcheck:Cond
   fun:_ZN10RestClient10Connection18performCurlRequestERKSs
   fun:_ZN10RestClient10Connection3getERKSs
   fun:_ZN10RestClient3getERKSs
   fun:_ZN23RestClientCpp_Http_Test8TestBodyEv
   fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
   fun:_ZN7testing4Test3RunEv
   fun:_ZN7testing8TestInfo3RunEv
   fun:_ZN7testing8TestCase3RunEv
   fun:_ZN7testing8internal12UnitTestImpl11RunAllTestsEv
   fun:_ZN7testing8UnitTest3RunEv
   fun:main
}

This fixes the following Valgrind failure:

```
==6158== Conditional jump or move depends on uninitialised value(s)
==6158==    at 0x4738F2: RestClient::Connection::performCurlRequest(std::string const&) (REDACTED)
==6158==    by 0x473D10: RestClient::Connection::get(std::string const&) (REDACTED)
==6158==    by 0x472779: RestClient::get(std::string const&) (REDACTED)
==6158==    by 0x40E59F: RestClientCpp_Http_Test::TestBody() (REDACTED)
==6158==    by 0x447798: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (REDACTED)
==6158==    by 0x43A2CE: testing::Test::Run() (REDACTED)
==6158==    by 0x43A38C: testing::TestInfo::Run() (REDACTED)
==6158==    by 0x43A4A4: testing::TestCase::Run() (REDACTED)
==6158==    by 0x43A757: testing::internal::UnitTestImpl::RunAllTests() (REDACTED)
==6158==    by 0x43A9F8: testing::UnitTest::Run() (REDACTED)
==6158==    by 0x40C99F: main (REDACTED)
==6158==
{
   <insert_a_suppression_name_here>
   Memcheck:Cond
   fun:_ZN10RestClient10Connection18performCurlRequestERKSs
   fun:_ZN10RestClient10Connection3getERKSs
   fun:_ZN10RestClient3getERKSs
   fun:_ZN23RestClientCpp_Http_Test8TestBodyEv
   fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
   fun:_ZN7testing4Test3RunEv
   fun:_ZN7testing8TestInfo3RunEv
   fun:_ZN7testing8TestCase3RunEv
   fun:_ZN7testing8internal12UnitTestImpl11RunAllTestsEv
   fun:_ZN7testing8UnitTest3RunEv
   fun:main
}
```
@mrtazz
Copy link
Owner

mrtazz commented Apr 19, 2016

This is awesome! Thank you for the patch! What valgrind options did you use for this? As the valgrind run that is being executed as part of CI (https://github.com/mrtazz/restclient-cpp/blob/master/Makefile.am#L27) doesn't seem to catch it.

@mrtazz mrtazz merged commit 0d6e64d into mrtazz:master Apr 19, 2016
@marczych
Copy link
Contributor Author

I found and fixed the problems in a larger project that is built with Bazel which ultimately runs: valgrind --suppressions="$suppressions_file" --gen-suppressions=all --error-exitcode="$error_exit_code" "$test_executable". I'm running valgrind-3.10.1.

@mrtazz
Copy link
Owner

mrtazz commented Apr 20, 2016

Oh nice! I'm gonna see if I can add that to the CI build. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants