光复西路隔夜堆栈

这篇主要记录项目中发生的一些相对隐晦的宕机bug,这些bug通常无法通过简单的查看堆栈快速定位问题。这里只是作为一个汇总,并且如果有新的bug会继续更新。每个bug会在连接的文章中做更详细的分析(蓝色部分)

1.2018-06double free ,多线程重复析构

#0  0xb7784ca2 in ?? ()(gdb) bt#0  0xb7784ca2 in ?? ()#1  0xb7166687 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56#2  0xb7169ab3 in __GI_abort () at abort.c:89#3  0xb71a0fd3 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0xb72a001c "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175#4  0xb71ab4ca in malloc_printerr (action=, str=0xb72a0110 "double free or corruption (!prev)", ptr=0x90c6418) at malloc.c:4996#5  0xb71ac13d in _int_free (av=0xb72e4420, p=, have_lock=0) at malloc.c:3840#6  0xb739382f in operator delete(void*) () from /usr/lib/i386-linux-gnu/libstdc++.so.6#7  0x08099fb6 in ListServer::Tick (this=0xbff694ac) at main.cpp:139#8  0x080997d7 in appMain (argc=4, argv=0xbff69694) at main.cpp:214#9  0x080998ed in main (argc=4, argv=0xbff69694) at main.cpp:239

2.2018-07指针在MemoryStream扩充时变成了无效地址,继续修改指针位置的值时破坏了系统内存,在后续分配内存时发生错误

#0  0xf74c3a74 in ?? () from /lib/i386-linux-gnu/libc.so.6#1  0xf74c49d8 in malloc () from /lib/i386-linux-gnu/libc.so.6#2  0x0894573d in evWatchMalloc (size=512) at ev_memory_watch.cpp:97#3  0x08528896 in operator new (size=512) at main.cpp:55#4  0x085288bc in operator new[] (nSize=512) at main.cpp:66#5  0x089751a6 in google::protobuf::internal::RepeatedPtrFieldBase::Reserve (this=0x298d0420, new_size=65) at google/protobuf/repeated_field.cc:51#6  0x0812c38a in google::protobuf::internal::RepeatedPtrFieldBase::Add::TypeHandler> (this=0x298d0420) at ../../engine/ext_libs/protobuf-2.6.1/src/google/protobuf/repeated_field.h:904#7  0x08126561 in google::protobuf::RepeatedPtrField::Add (this=0x298d0420) at ../../engine/ext_libs/protobuf-2.6.1/src/google/protobuf/repeated_field.h:1124#8  0x08124c56 in PssSave::Save_Copy::add_copies (this=0x298d0410) at ../protocol/saveload/save_copy.pb.h:630#9  0x0810fc3f in CCopySystem::_OnPlayerSave (this=0xb7250f0, player=..., _msg=0x298e38f0, mem_data=0x175f9088) at gs_copy/gs_copy.cpp:561#10 0x08135e4e in std::_Mem_fn::operator()(CCopySystem*, CPlayer&, PssSave::SaveData*&&, EvMemoryStream*&&) const (this=0xd6342f8,    __object=0xb7250f0) at /usr/include/c++/4.8/functional:601

3.2018-07dbserver与mysql断开连接,重连时会第二次处理请求,此时部分对象已经在第一次处理过程中被销毁

#0  0x080a7a0e in std::_Rb_tree, std::_Select1st>, std::less, std::allocator> >::_M_begin (this=0x0) at /usr/include/c++/4.8/bits/stl_tree.h:508#1  0x080a63cb in std::_Rb_tree, std::_Select1st>, std::less, std::allocator> >::find (this=0x0, __k=...) at /usr/include/c++/4.8/bits/stl_tree.h:1805#2  0x080a1fbd in std::map, std::allocator > >::find (this=0x0, __x=...) at /usr/include/c++/4.8/bits/stl_map.h:837

#3  0x08098b46 in GDict::find (this=0x0, key=0x81419cc "_id") at util/gs_dict.cpp:1503

#4  0x08081cc4 in GDict::sure (this=0x0, key=0x81419cc "_id") at sdk/gs_dict.h:255

#5  0x08080dcf in RoleCacheMgr::UpdateCache (this=0x9252e60, connect_id=1, token_num=5856851) at role_cache.cpp:271

#6  0x0805324c in MysqlDriver::MyQueryUpdate (this=0x92518d8, p_db_cmd=0xb954f20, result_ptr=0xa9e79f0) at database/mysql/mysql_driver.cpp:2410

#7  0x0804fe28 in MysqlDriver::ProcessCommand (this=0x92518d8, p_cmd=0xb954f20) at database/mysql/mysql_driver.cpp:832

#8  0x0806e5df in WorkThread::ProcessCommand (this=0x9261060, pp_commands=0x9290a78, count=1) at database/database.cpp:477

#9  0x0806e1f2 in WorkThread::OnRun (this=0x9261060) at database/database.cpp:384

#10 0x080f6a78 in EvThread::ThreadProc (args=0x9260288) at ev_thread.cpp:103

#11 0xf7771f72 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0

#12 0xf72353ee in clone () from /lib/i386-linux-gnu/libc.so.6

4.2019-07登录系统管理clt的镜像map中的指针没有删除成功,在析构之后变成野指针而被调用

#0 0x08524692 in BasePoolPipe::GetName (this=0x0) at ./login_sys/api/login_sys_api.h:112

#1 0x08526617 in CheckRelogin (pOldClient=0x19ce9428, pClient=0x193cd8e0, pPlayer=0x152bb5a0) at login_sys/impl/login_sys.cpp:319

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 我曾多次在培训课上向学员提问:作为管理者,你最不喜欢的工作项目是什么?其中“绩效评估”作为最日常的管理工作却最频繁...
    布道小课堂阅读 1,014评论 0 10
  • 001 即兴演讲,是我们每个人心中的痛。 为什么这样说涅? 有人说,即兴演讲是蚂蚁眼中的大山,必须面对又绕不过去;...
    98a254a9c4a7阅读 1,205评论 0 2
  • 我们明白并且清楚的知道选择什么未来就会怎样,有人说选择更重要有人说努力更重要,到底哪个更重要?可能都很重要...
    町沐阅读 362评论 0 4