当前位置: 技术问答>linux和unix
core debug求助@!
来源: 互联网 发布时间:2017-03-09
本文导语: 我现在做的一个项目是把它从linux(32bit)移植到linux(64bit)。配置如下: Linux(SuSE11)+ Sybase + tomcat1.6 我负责的是后台程序(c/c++开发,调用了C++ 开源库Poco和Linux C的头文件)。前期的Poco库和Sybase的64位动态链...
我现在做的一个项目是把它从linux(32bit)移植到linux(64bit)。配置如下:
Linux(SuSE11)+ Sybase + tomcat1.6
我负责的是后台程序(c/c++开发,调用了C++ 开源库Poco和Linux C的头文件)。前期的Poco库和Sybase的64位动态链接库都已经编译连接好。只是在运行的时候就直接报错,如下:
smm@linux:~> smm_agent: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbin ptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct mallo c_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned lo ng)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size _t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((un signed long)old_end & pagemask) == 0)' failed.
这个我网上查了说是内存问题,可具体是什么又很难定位。
以下是debug信息:
smm@linux:~/build/bin> gdb smm_agent core
GNU gdb (GDB) SUSE (7.0-0.4.16)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
...
Reading symbols from /home/smm/build/bin/smm_agent...done.
Missing separate debuginfo for /home/smm/build/lib/publib/libch_pub.so
Try: zypper install -C "debuginfo(build-id)=5c52a95ce99808f4d56288fa8c1be49e03af7dca"
Reading symbols from /home/sybase/OCS-15_0/lib/libsybintl64.so...(no debugging symbols found)...done.
Loaded symbols for /home/sybase/OCS-15_0/lib/libsybintl64.so
Reading symbols from /lib64/libnsl.so.1...Missing separate debuginfo for /lib64/libnsl.so.1
Try: zypper install -C "debuginfo(build-id)=0123772e96348483f94d1ef0b1568413f40e7e2a"
(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /home/sybase/OCS-15_0/lib/libsybtcl64.so...(no debugging symbols found)...done.
Loaded symbols for /home/sybase/OCS-15_0/lib/libsybtcl64.so
Reading symbols from /lib64/ld-linux-x86-64.so.2...Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C "debuginfo(build-id)=17c088070352d83e7afc43d83756b00899fd37f0"
(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Core was generated by `smm_agent'.
Program terminated with signal 6, Aborted.
#0 0x00007f9a33bff945 in raise () from /lib64/libc.so.6
(gdb) where
#0 0x00007f9a33bff945 in raise () from /lib64/libc.so.6
#1 0x00007f9a33c00f21 in abort () from /lib64/libc.so.6
#2 0x00007f9a33c4222d in __malloc_assert () from /lib64/libc.so.6
#3 0x00007f9a33c45460 in _int_malloc () from /lib64/libc.so.6
#4 0x00007f9a33c47057 in malloc () from /lib64/libc.so.6
#5 0x00007f9a3445de4d in operator new(unsigned long) () from /usr/lib64/libstdc++.so.6
#6 0x00007f9a3443bdc1 in std::basic_string::_Rep::_S_create(unsigned long, unsigned long, std::allocator const&) ()
from /usr/lib64/libstdc++.so.6
#7 0x00007f9a3443c66b in std::basic_string::_Rep::_M_clone(std::allocator const&, unsigned long) ()
from /usr/lib64/libstdc++.so.6
#8 0x00007f9a3443d301 in std::basic_string::reserve(unsigned long) () from /usr/lib64/libstdc++.so.6
#9 0x00007f9a35206114 in Poco::Util::IniFileConfiguration::parseLine(std::basic_istream&) () from /home/smm/build/lib/3partlib/libPocoUtil.so.12
#10 0x00007f9a352066d3 in Poco::Util::IniFileConfiguration::load(std::basic_istream&) () from /home/smm/build/lib/3partlib/libPocoUtil.so.12
#11 0x00007f9a352069aa in Poco::Util::IniFileConfiguration::IniFileConfiguration(std::basic_istream&) ()
from /home/smm/build/lib/3partlib/libPocoUtil.so.12
#12 0x00007f9a35abaec1 in CH_BASE::PUB::Config_ini::GetInt (this=0x624160, szGroup=Traceback (most recent call last):
File "/usr/lib64/../share/gdb/python/libstdcxx/v6/printers.py", line 469, in to_string
return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
OverflowError: signed integer is greater than maximum
, szKey=Traceback (most recent call last):
File "/usr/lib64/../share/gdb/python/libstdcxx/v6/printers.py", line 469, in to_string
return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
UnicodeDecodeError: 'gbk' codec can't decode bytes in position 12-13: illegal multibyte sequence
, dwDefault=0) at /home/smm/CH_Base/pub_api/source/ConfigIni.cpp:64
#13 0x000000000041a230 in Service::Service(std::basic_string const&) ()
#14 0x0000000000419f02 in __static_initialization_and_destruction_0 (__priority=, __initialize_p=)
at /home/smm/SMM_code/Agent/source/StartUpAgent.cpp:6
#15 global constructors keyed to agent() (__priority=, __initialize_p=) at /home/smm/SMM_code/Agent/source/StartUpAgent.cpp:12
#16 0x000000000041cf46 in __do_global_ctors_aux ()
#17 0x0000000000409c6b in _init ()
#18 0x00007f9a33bdcaa0 in ?? () from /lib64/libc.so.6
#19 0x000000000041ced5 in __libc_csu_init (argc=29227, argv=0x722b, envp=0x6) at elf-init.c:120
#20 0x00007f9a33bebb52 in __libc_start_main () from /lib64/libc.so.6
#21 0x000000000040a7e9 in _start () at ../sysdeps/x86_64/elf/start.S:113
smm_agent: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff5d1a945 in raise () from /lib64/libc.so.6
针对上面提出的文件我也尽力看了,可并没有找到有关malloc和free的代码。
希望各位能给我指点一下,应该重点从哪里入手。不胜感谢。
Linux(SuSE11)+ Sybase + tomcat1.6
我负责的是后台程序(c/c++开发,调用了C++ 开源库Poco和Linux C的头文件)。前期的Poco库和Sybase的64位动态链接库都已经编译连接好。只是在运行的时候就直接报错,如下:
smm@linux:~> smm_agent: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbin ptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct mallo c_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned lo ng)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size _t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((un signed long)old_end & pagemask) == 0)' failed.
这个我网上查了说是内存问题,可具体是什么又很难定位。
以下是debug信息:
smm@linux:~/build/bin> gdb smm_agent core
GNU gdb (GDB) SUSE (7.0-0.4.16)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
...
Reading symbols from /home/smm/build/bin/smm_agent...done.
Missing separate debuginfo for /home/smm/build/lib/publib/libch_pub.so
Try: zypper install -C "debuginfo(build-id)=5c52a95ce99808f4d56288fa8c1be49e03af7dca"
Reading symbols from /home/sybase/OCS-15_0/lib/libsybintl64.so...(no debugging symbols found)...done.
Loaded symbols for /home/sybase/OCS-15_0/lib/libsybintl64.so
Reading symbols from /lib64/libnsl.so.1...Missing separate debuginfo for /lib64/libnsl.so.1
Try: zypper install -C "debuginfo(build-id)=0123772e96348483f94d1ef0b1568413f40e7e2a"
(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /home/sybase/OCS-15_0/lib/libsybtcl64.so...(no debugging symbols found)...done.
Loaded symbols for /home/sybase/OCS-15_0/lib/libsybtcl64.so
Reading symbols from /lib64/ld-linux-x86-64.so.2...Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C "debuginfo(build-id)=17c088070352d83e7afc43d83756b00899fd37f0"
(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Core was generated by `smm_agent'.
Program terminated with signal 6, Aborted.
#0 0x00007f9a33bff945 in raise () from /lib64/libc.so.6
(gdb) where
#0 0x00007f9a33bff945 in raise () from /lib64/libc.so.6
#1 0x00007f9a33c00f21 in abort () from /lib64/libc.so.6
#2 0x00007f9a33c4222d in __malloc_assert () from /lib64/libc.so.6
#3 0x00007f9a33c45460 in _int_malloc () from /lib64/libc.so.6
#4 0x00007f9a33c47057 in malloc () from /lib64/libc.so.6
#5 0x00007f9a3445de4d in operator new(unsigned long) () from /usr/lib64/libstdc++.so.6
#6 0x00007f9a3443bdc1 in std::basic_string::_Rep::_S_create(unsigned long, unsigned long, std::allocator const&) ()
from /usr/lib64/libstdc++.so.6
#7 0x00007f9a3443c66b in std::basic_string::_Rep::_M_clone(std::allocator const&, unsigned long) ()
from /usr/lib64/libstdc++.so.6
#8 0x00007f9a3443d301 in std::basic_string::reserve(unsigned long) () from /usr/lib64/libstdc++.so.6
#9 0x00007f9a35206114 in Poco::Util::IniFileConfiguration::parseLine(std::basic_istream&) () from /home/smm/build/lib/3partlib/libPocoUtil.so.12
#10 0x00007f9a352066d3 in Poco::Util::IniFileConfiguration::load(std::basic_istream&) () from /home/smm/build/lib/3partlib/libPocoUtil.so.12
#11 0x00007f9a352069aa in Poco::Util::IniFileConfiguration::IniFileConfiguration(std::basic_istream&) ()
from /home/smm/build/lib/3partlib/libPocoUtil.so.12
#12 0x00007f9a35abaec1 in CH_BASE::PUB::Config_ini::GetInt (this=0x624160, szGroup=Traceback (most recent call last):
File "/usr/lib64/../share/gdb/python/libstdcxx/v6/printers.py", line 469, in to_string
return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
OverflowError: signed integer is greater than maximum
, szKey=Traceback (most recent call last):
File "/usr/lib64/../share/gdb/python/libstdcxx/v6/printers.py", line 469, in to_string
return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
UnicodeDecodeError: 'gbk' codec can't decode bytes in position 12-13: illegal multibyte sequence
, dwDefault=0) at /home/smm/CH_Base/pub_api/source/ConfigIni.cpp:64
#13 0x000000000041a230 in Service::Service(std::basic_string const&) ()
#14 0x0000000000419f02 in __static_initialization_and_destruction_0 (__priority=, __initialize_p=)
at /home/smm/SMM_code/Agent/source/StartUpAgent.cpp:6
#15 global constructors keyed to agent() (__priority=, __initialize_p=) at /home/smm/SMM_code/Agent/source/StartUpAgent.cpp:12
#16 0x000000000041cf46 in __do_global_ctors_aux ()
#17 0x0000000000409c6b in _init ()
#18 0x00007f9a33bdcaa0 in ?? () from /lib64/libc.so.6
#19 0x000000000041ced5 in __libc_csu_init (argc=29227, argv=0x722b, envp=0x6) at elf-init.c:120
#20 0x00007f9a33bebb52 in __libc_start_main () from /lib64/libc.so.6
#21 0x000000000040a7e9 in _start () at ../sysdeps/x86_64/elf/start.S:113
smm_agent: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff5d1a945 in raise () from /lib64/libc.so.6
针对上面提出的文件我也尽力看了,可并没有找到有关malloc和free的代码。
希望各位能给我指点一下,应该重点从哪里入手。不胜感谢。
|
gdb smm_agent core进去
然后输入bt命令看下Call stack。
从你这信息,我看不出有什么问题!方便远程协助? QQ:282605114
然后输入bt命令看下Call stack。
从你这信息,我看不出有什么问题!方便远程协助? QQ:282605114