glibc 损坏了 RHEL 5 中的双链表
glibc corrupted double linked list in RHEL 5
>我有一个用C++编写的代码,它生成一个sharedlib(.so)文件,该文件又用于我在RHEL3上运行的应用程序。
现在我必须迁移到 RHEL5。.so 文件的代码编译成功,但当我尝试启动我的服务时,它显示 **glibc 损坏的双链表**,但服务成功启动。
这可能是由于操作系统,因为在 RHEL3 中编译的相同 .so 的相同代码工作正常。
此外,如果我将 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 查找导致问题的原因。
相关文章:
- 为什么C中的通用链表中存储的数据已损坏
- 为什么链表中的数据在嵌套函数中会更改/损坏?
- 第一次运行程序时出现损坏的双链表错误,后续运行正常
- glibc 损坏了 RHEL 5 中的双链表
- 中的错误:双链表0xb2808cf8 C++损坏
- C++glibc检测到损坏的双链表错误C++
- 链表实现的堆栈损坏
- glibc 检测小箱链表已损坏
- 链表中C++内存损坏
- C++:glibc检测到损坏的双链表:0x08f8f148
- 我的双向链表中的查找函数损坏
- 我将如何在不损坏列表的情况下删除链表中的节点
- 损坏的双链表
- C++:损坏的双链表和内存损坏
- C++ Linux 中的双链表损坏
- c++ - Smallbin双链表损坏
- 当我在调用append后立即实例化Node时,链表会损坏
- 损坏的双链表:0x0804d0c0 (c++)
- std::map<K, V>.clear() 在损坏的双链表中崩溃
- 机器相关的损坏的双链表错误