打印

一个core dump的日志和分析

[复制链接]
346|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
keer_zu|  楼主 | 2023-2-16 11:27 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

# ./EM
===***= 1136
init start
messageHandle thread waiting items
init end
=6=432
===***= 1136
init start
messageHandle thread waiting items
init end
=6=432
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=432
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=432
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=432
===***= 1136
init start
messageHandle thread waiting items
init end
=6=432
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=432
onAlive alive is 0
messageHandle thread receve items size =1
free malloc object that is not allocatedmessageHandle thread waiting items
:=6=432
/builds/workspace/710-SDP/build_aarch64/lib/c/alloc/dlist.c:1053
Abort (core dumped)
#

使用特权

评论回复
沙发
keer_zu|  楼主 | 2023-2-17 10:53 | 只看该作者
# ./EM
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
messageHandle thread receve items size =1
Memory fault (core dumped)
# ls
EM                EM.15.core        EM.5.core         EMClient.hop      EMClient.sop      EMClient_1.exh
# cat EMClient_1.exh
# ./EM
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
----------+ 5427:
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
----------+ 5432:
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
----------+ 5439:
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
messageHandle thread receve items size =1
Memory fault (core dumped)
# ./EM
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
----------+ 5427:
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
----------+ 5432:
messageHandle thread waiting items
=6=435
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
===***= 1139
init start
messageHandle thread waiting items
init end
=6=435
----------+ 1053:
----------+ 1054:
onAlive alive is 1
messageHandle thread receve items size =1
messageHandle thread waiting items
=6=435
----------+ 5439:
----------+ 5240:
----------+ 5264:
===***= 1139
----------+ 5267:
init start
messageHandle thread waiting items
init end
=6=435
----------+ 5268:
----------+ 5273:
----------+ 5280:
----------+ 5287:
----------+ 1039:
----------+ 1053:
messageHandle thread receve items size =1
----------+ 1054:
Memory fault (core dumped)

使用特权

评论回复
板凳
keer_zu|  楼主 | 2023-2-17 15:23 | 只看该作者
nobo::infra::em::EMClient sClient(nobo::infra::em::FG_IPC);
void testPrint(int level, const char *format, ...){
        va_list arg;
        va_start(arg, format);
        vprintf(format, arg);
        va_end(arg);
}

使用特权

评论回复
地板
keer_zu|  楼主 | 2023-2-17 18:00 | 只看该作者
因为获取的core文件的分析结果gdb分析后,发现栈已经损坏,所以就加了许多打印来定位。
新的用例一直没有core dump。知道添加了第四个CASE后,逐步加打印排除导致最后core dump的触发代码,定位到下面这行:



看来和这个Queue有关,而且是push操作导致的

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1352

主题

12436

帖子

53

粉丝