If I write a test using the Google Test Framework this way:
TEST_F( TestFName, TestName )
{
std::condition_variable cv;
}
It generates a valgrind error. I run it with options --leak-check=full --track-origins=yes.
Conditional jump or move depends on uninitialised value(s)
==17215== at 0x4E3DA82: pthread_cond_destroy@@GLIBC_2.3.2 (pthread_cond_destroy.c:35)
...
Uninitialised value was created by a stack allocation
==17215== at 0x4551D0: TestFName_TestName_test::TestBody()
It was strange to realize that the error came from an announcement condition_variable cv. When I declared global, the error disappeared.
I am running Valgrind-3.7.0 on a machine with Ubuntu 3.8 x86_64.
Has anyone else encountered the same problem?
source
share