intel / gmmlib

Other
159 stars 87 forks source link

Use of uninitialized data. #100

Closed stolk closed 1 year ago

stolk commented 2 years ago

The test run uses uninitialized data, causing undefined behaviour.

==421301== Conditional jump or move depends on uninitialised value(s)
==421301==    at 0x5296A48: GmmLib::GmmMultiAdapterContext::GetAdapterNode(_ADAPTER_BDF_) (GmmInfo.cpp:718)
==421301==    by 0x5296AAF: GmmLib::GmmMultiAdapterContext::IncrementRefCount(_ADAPTER_BDF_) (GmmInfo.cpp:754)
==421301==    by 0x529621D: GmmCreateLibContext (GmmInfo.cpp:164)
==421301==    by 0x52AFE81: InitializeGmm (GmmLibDllMain.cpp:57)
==421301==    by 0x11BF87: CommonULT::SetUpTestCase() (GmmCommonULT.cpp:91)
==421301==    by 0x119C1F: CTestCachePolicy::SetUpTestCase() (GmmCachePolicyULT.cpp:44)
==421301==    by 0x1E6D01: testing::TestCase::RunSetUpTestCase() (gtest.h:18286)
==421301==    by 0x20C137: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::TestCase, void>(testing::TestCase*, void (testing::TestCase::*)(), char const*) (gtest-all.cc:3635)
==421301==    by 0x20678C: void testing::internal::HandleExceptionsInMethodIfSupported<testing::TestCase, void>(testing::TestCase*, void (testing::TestCase::*)(), char const*) (gtest-all.cc:3671)
==421301==    by 0x1F0761: testing::TestCase::Run() (gtest-all.cc:4000)
==421301==    by 0x1F8182: testing::internal::UnitTestImpl::RunAllTests() (gtest-all.cc:5886)
==421301==    by 0x20CB5C: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest-all.cc:3635)
==421301==  Uninitialised value was created by a stack allocation
==421301==    at 0x11BB2C: CommonULT::SetUpTestCase() (GmmCommonULT.cpp:57)
==421301== 
johnmach commented 1 year ago

Fixed in https://github.com/intel/gmmlib/commit/26ffef5199abcec625651562eb319e983037297d