RHEL 5中glibc损坏的双链接列表 我有一个C++编写的代码,它生成了一个SyrdLIB(.so)文件,它又在我的应用程序中使用,它运行在RHel3../P>上。

RHEL 5中glibc损坏的双链接列表 我有一个C++编写的代码,它生成了一个SyrdLIB(.so)文件,它又在我的应用程序中使用,它运行在RHel3../P>上。,c++,linux,rhel5,C++,Linux,Rhel5,现在我必须迁移到RHEL5。.so文件的代码编译成功,但当我尝试启动服务时,它会显示**glibc损坏的双链接列表**,但服务启动成功 这可能是因为操作系统的代码相同,所以在RHEL3中编译可以正常工作 另外,如果我将RHEL3中编译的.so文件复制到RHEL5机器上,一切正常 This is what i got by running valgrind : ==19845== Invalid read of size 4 ==19845== at 0x453F4EC: std::

现在我必须迁移到RHEL5。.so文件的代码编译成功,但当我尝试启动服务时,它会显示**glibc损坏的双链接列表**,但服务启动成功

这可能是因为操作系统的代码相同,所以在RHEL3中编译可以正常工作

另外,如果我将RHEL3中编译的.so文件复制到RHEL5机器上,一切正常

    This is what i got by running valgrind :
==19845== Invalid read of size 4
==19845==    at 0x453F4EC: std::_Rb_tree<int, std::pair<int const, key>, std::_Select1st<std::pair<int const, key> >, std::less<int>, std::allocator<std::pair<int const, key> > >::_S_right(std::_Rb_tree_node_base*) (in /home/test/examplesofile1.so)
==19845==    by 0x45408AA: std::_Rb_tree<int, std::pair<int const, key>, std::_Select1st<std::pair<int const, key> >, std::less<int>, std::allocator<std::pair<int const, key> > >::_M_erase(std::_Rb_tree_node<std::pair<int const, key> >*) (in /home/test/examplesofile1.so)
==19845==    by 0x4540918: std::_Rb_tree<int, std::pair<int const, key>, std::_Select1st<std::pair<int const, key> >, std::less<int>, std::allocator<std::pair<int const, key> > >::~_Rb_tree() (in /home/test/examplesofile1.so)
==19845==    by 0x4540974: std::map<int, key, std::less<int>, std::allocator<std::pair<int const, key> > >::~map() (in /home/test/examplesofile1.so)
==19845==    by 0x48235FB: (within /home/test/examplesofile2.so)
==19845==    by 0xAA5058: __cxa_finalize (in /lib/libc-2.5.so)
==19845==    by 0x477BC03: (within /home/test/examplesofile2.so)
==19845==    by 0x4A2FDEB: (within /home/test/examplesofile2.so)
==19845==    by 0xA697CD: _dl_fini (in /lib/ld-2.5.so)
==19845==    by 0xAA4DA8: exit (in /lib/libc-2.5.so)
==19845==    by 0x8086F57: vMakeDaemon (commonfunctions.c:438)
==19845==    by 0x8067F9A: Initialize (mngr.c:360)
这是我通过运行valgrind得到的结果:
==19845==大小为4的读取无效
==19845==0x453F4EC:std:_Rb_tree:_S_right(std:_Rb_tree_node_base*)(in/home/test/examplesofile1.so)
==19845==by 0x45408AA:std:_Rb_tree:_M_erase(std:_Rb_tree_node*)(in/home/test/examplesofile1.so)
==19845==by 0x4540918:std::\u Rb\u tree::~\u Rb\u tree()(在/home/test/examplesofile1.so中)
==19845==by 0x4540974:std::map::~map()(在/home/test/examplesofile1.so中)
==19845==0x48235FB:(在/home/test/examplesofile2.so内)
==19845==0xAA5058:uu cxa_finalize(在/lib/libc-2.5.so中)
==19845==0x477BC03:(在/home/test/examplesofile2.so内)
==19845==0x4A2FDEB:(在/home/test/examplesofile2.so内)
==19845==0xA697CD:_dl_fini(in/lib/ld-2.5.so)
==19845==by0xaa4da8:exit(在/lib/libc-2.5.so中)
==19845==by 0x8086F57:vmakedemon(commonfunctions.c:438)
==19845==0x8067F9A:初始化(mngr.c:360)

在大多数情况下,这意味着一些内存会被释放两次。 因此,错误很可能存在于代码中


尝试在新系统上重新编译库,并使用valgrind查找问题的原因。

用于调试内存泄漏。错误很可能在代码中。。。。“glibc损坏的双链接列表”消息有助于找到它。