美文网首页
蜀手隔夜堆栈

蜀手隔夜堆栈

作者: 李相赫的乐芙兰 | 来源:发表于2018-07-24 18:44 被阅读69次

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

1.#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

double free ,多线程重复析构

2.#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

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

3.#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

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

相关文章

  • 蜀手隔夜堆栈

    这篇主要记录项目中发生的一些相对隐晦的宕机bug,这些bug通常无法通过简单的查看堆栈快速定位问题。这里只是作为一...

  • 日本电视台出现“天价《神奇宝贝》卡片”,共31张,价值超700万

    如果你们时常有留意隔夜君的文章,那就一定看到过不少《海贼王》手办的介绍。 隔夜君之所以热衷于给你们带来解读,除了手...

  • Go 堆栈的理解

    在讲Go的堆栈之前,先温习一下堆栈基础知识。 什么是堆栈?在计算机中堆栈的概念分为:数据结构的堆栈和内存分配中堆栈...

  • 三种常见的计算模型

    堆栈机 堆栈机,全称为“堆栈结构机器”,即英文的 “Stack Machine”。基于堆栈机模型实现的计算机,无论...

  • 初识堆栈

    什么是堆栈 引出堆栈 在学习堆栈之前,我们需要从之前寄存器和内存中引出堆栈,我们要思考堆栈有什么必要性?现在假设我...

  • Linux内核——用户堆栈和内核堆栈

    定义 每个进程都有用户堆栈和内核堆栈两个堆栈。进程在用户态时使用用户堆栈,陷入到内核态时便使用内核堆栈。 切换过程...

  • 数据结构和算法(三) - 栈

    堆栈数据结构在概念上与物理的堆栈相同。将元素添加到堆栈时,将其放在堆栈顶部。从堆栈中删除元素时,始终会删除最顶层的...

  • 《隔夜相思 隔夜仇》

    有时候,人的情绪是在所难免的。不管在什么时候,每个人都有相思和仇恨。相思是在所难免,亲是愁的一方面。 无论如何要迈...

  • 咏荷

    晓放轻舟不为鱼,烟波十里尽芙蕖。 风摇玉面千千手,隔夜清芬满碧裾。

  • 隔夜饭菜危害大,为什么专家营养师都说不能吃?咱也不能浪费呀

    隔夜水,隔夜茶,隔夜饭,隔夜菜等等,似乎所有“隔夜”,都与健康挂钩,在各种专家,营养师,网文的说法下,都不知道该相...

网友评论

      本文标题:蜀手隔夜堆栈

      本文链接:https://www.haomeiwen.com/subject/aepymftx.html