0

输出格式显示堆栈,因此很难找到根本原因。

 ==21663== Invalid read of size 4
==21663==    at 0x4448117: iurcall_init_rlmgt_IsAllAlcapSuccess(Iurcall_Init_CallCtx_t*) (iurcall_init_rlmgt_p.cc:6319)
==21663==    by 0x47D98DD: iurcall_init_rlmgt_IsAllAlcapSuccess_Test_return_1_when_edchMacD_flow_ctx_not_exist_and_alcapEstablish_is_FALSE_Test::TestBody() (iurcall_init_rlmgt_p_test.cc:373)
==21663==    by 0x8BCAB27: testing::Test::Run() (gmock-gtest-all.cc:3436)
==21663==    by 0x8BD1966: testing::internal::TestInfoImpl::Run() (gmock-gtest-all.cc:3655)
==21663==    by 0x8BD1AA8: testing::TestCase::Run() (gmock-gtest-all.cc:3761)
==21663==    by 0x8BD1D96: testing::internal::UnitTestImpl::RunAllTests() (gmock-gtest-all.cc:5365)
==21663==    by 0x8BD1F21: testing::UnitTest::Run() (gmock-gtest-all.cc:5028)
==21663==    by 0x4820149: Gtest_initialisation(int, char**) (iurcall_init_gtest_main.cc:49)
==21663==    by 0x808E500: main (bosinit_config_template.h:439)
==21663==  Address 0xa8190e4 is 44 bytes inside a block of size 56 free'd
4

1 回答 1

0

这个 Valgrind 输出看起来不完整。它应该类似于这个问题,第二个调用堆栈在Address 0xa8190e4 is 44 bytes inside a block of size 56 free'd.

这个调用堆栈是问题的根本原因。这不是内存泄漏。您正在尝试使用已释放的对象。第二个调用堆栈是对象被释放的地方,第一个是它被使用的地方。

于 2012-05-17T10:32:23.140 回答