2014-02-21 5 views
0

RHEL3에서 실행되는 내 응용 프로그램에서 차례대로 사용되는 sharedlib (.so) 파일을 생성하는 C++로 작성된 코드가 있습니다.RHEL 5의 glibc 손상된 이중 링크 목록

이제 RHEL5로 마이그레이션해야합니다. .so 파일의 코드가 성공적으로 컴파일되지만 서비스를 가져 오려고하면 ** glibc 손상된 이중 연결 목록 **이 표시되지만 서비스가 성공적으로 시작됩니다.

OS로 인해 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) 
+0

메모리 누수를 디버깅하려면 [valgrind] (http://valgrind.org/)를 사용하십시오. –

+0

버그가 코드 내에 있습니다. "glibc 손상된 이중 링크 목록"메시지가 도움이됩니다. –

답변

1

대부분의 경우 이는 일부 메모리가 두 번 해제됨을 의미합니다. 버그가 코드에있을 가능성이 큽니다.

새 시스템에서 라이브러리를 다시 컴파일하고 valgrind를 사용하여 문제의 원인을 찾으십시오.