今天发现服务器挂了,自己调试了一下core,只能知道是循环解包引起的,却不知道怎么看到底是哪个包,以及包的内容。就请教了下阿里云的同学,他帮我处理了问题。做下笔记:
1.gdb /home/titan2/engine/bin/gateway 进入gdb调试。
2.core-file core.gateway.3868 加载core
3.这里是最重要的,通过f 查看,只能发现各种循环嵌套的调用,用info args, info locals,都无法看到有用的值。
用p命令查看变量,只能看到一堆指针地址。这时候,其实还可以查看类的成员变量。通过看成员变量,其实就能看出一些端倪。
std::vector of length 2563693, capacity 3276800 = {9 '\t', 15 '\017', 1 '\001', 6 '\006', 29 '\035', 99 'c',
104 'h', 97 'a', 110 'n', 103 'g', 101 'e', 77 'M', 105 'i', 110 'n', 101 'e', 72 'H', 101 'e', 114 'r', 111 'o',
6 '\006', 3 '\003', 49 '1', 6 '\006', 3 '\003', 48 '0', 10 '\n', 11 '\v', 1 '\001', 3 '\003', 122 'z', 5 '\005',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y', 5 '\005',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x', 5 '\005',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 21 '\025', 110 'n', 111 'o', 114 'r',
109 'm', 97 'a', 108 'l', 105 'i', 122 'z', 101 'e', 100 'd', 10 '\n', 11 '\v', 1 '\001', 3 '\003', 122 'z',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 21 '\025', 110 'n',
111 'o', 114 'r', 109 'm', 97 'a', 108 'l', 105 'i', 122 'z', 101 'e', 100 'd', 10 '\n', 11 '\v', 1 '\001', 3 '\003',
122 'z', 5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 21 '\025', 110 'n',
111 'o', 114 'r', 109 'm', 97 'a', 108 'l', 105 'i', 122 'z', 101 'e', 100 'd', 10 '\n', 11 '\v', 1 '\001', 3 '\003',
122 'z', 5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000'...}
104 'h', 97 'a', 110 'n', 103 'g', 101 'e', 77 'M', 105 'i', 110 'n', 101 'e', 72 'H', 101 'e', 114 'r', 111 'o',
6 '\006', 3 '\003', 49 '1', 6 '\006', 3 '\003', 48 '0', 10 '\n', 11 '\v', 1 '\001', 3 '\003', 122 'z', 5 '\005',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y', 5 '\005',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x', 5 '\005',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 21 '\025', 110 'n', 111 'o', 114 'r',
109 'm', 97 'a', 108 'l', 105 'i', 122 'z', 101 'e', 100 'd', 10 '\n', 11 '\v', 1 '\001', 3 '\003', 122 'z',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 21 '\025', 110 'n',
111 'o', 114 'r', 109 'm', 97 'a', 108 'l', 105 'i', 122 'z', 101 'e', 100 'd', 10 '\n', 11 '\v', 1 '\001', 3 '\003',
122 'z', 5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 21 '\025', 110 'n',
111 'o', 114 'r', 109 'm', 97 'a', 108 'l', 105 'i', 122 'z', 101 'e', 100 'd', 10 '\n', 11 '\v', 1 '\001', 3 '\003',
122 'z', 5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 121 'y',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 120 'x',
5 '\005', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000'...}
这是一个无比巨大的vector,通过打印,可以知道changeMineHero z y x normalize z y x normalize
基本就知道了具体位置。
最后他还做了一步打印出map实际内容,这个就有点困难了,需要去下载gdb print boost脚本 超出我的能力范围了。
没有评论:
发表评论