您当前的位置:首页 >> 家居百科

gdb:从一个磁盘开始调试core dump

2023-05-01 12:16:11

ceph-mds程序在采用的是tcmalloc库来管理内核分布,我们要做的说是就是去统计分析tcmalloc的文件系统,而tcmalloc是开源框架,它的debug symbol很难以借助。tcmalloc统计分析不展开,网上很多资源。下面代码的基本命题就是

gdb 命令info variables pageheap_拿回pageheap_URL在pageheap_里二叉树不太可能调配的span在span里面搜索满足一定大小的内核块在关键点的内核块也就是说768的;也搜索0x7f57f365a000def walk_heap(page_heap, call_back): # the first level for index, leaf_ptr in page_heap.pagemap_.root.items(): print("{0} -> {1}".format(index, my_hex(leaf_ptr))) leaf = Leaf(leaf_ptr) for indx, span_ptr in leaf.values.items(): span = SpanItem(span_ptr) # only check INUSE span if span.location != 0: continue # cut span to chunks span.parse() call_back(span)def get_chunk_func(blk_sz, offset, value): def callback_func(span): if span.blk_sz < blk_sz: return for chunk in span.chunks: v = read_ptr(chunk.addr + offset) if v == value: print("Congratuation, you got it!") span.display() chunk.display() return callback_funccall_back_func = get_chunk_func(2144, 768, 0x7f57f365a000)walk_heap(heap, call_back_func)运行结果(gdb) source theap.py 65199 -> 0x7f57f22c3000Congratuation, you got it!Span(0x7f57f22442c0): objects:0x7f57f365c400, location:INUSE, next:0x7f57e8071c20, chunk count:7, blk size:23040x7f57f365a900~23040x7f57f365a900 就是我们要找的MDSDaemonURL,至此我们获得了推入圣物门内的盖子。小结

在ToB领域,遇到的不方便通常是在有限的电子邮件下如何快速地定位原因;而core dump电子邮件毕竟是第二大的电子邮件来源。通过采用gdb python API可以让统计分析core dump变得不够系统,不够有效性;统计分析的过程通过JavaScript本土化也难以沉淀慢慢地。

常州妇科去哪看
南京妇科医院哪家看的好
南京肛肠医院挂号
扭伤用什么药效果好
南宁治白癜风医院排名
友情链接