Board logo

标题: AIX 下的 core dump 分析入门-3 [打印本页]

作者: look_w    时间: 2018-1-13 22:15     标题: AIX 下的 core dump 分析入门-3

查看多线程相关信息
如果以下环境变量采用默认的 OFF 值,则系统会完全禁止适当的调试列表,这意味着 dbx 命令将显示不出任何对象:
AIXTHREAD_MUTEX_DEBUG
AIXTHREAD_COND_DEBUG
AIXTHREAD_RWLOCK_DEBUG
可以使用
export AIXTHREAD_MUTEX_DEBUG=ON
打开 AIXTHREAD_MUTEX_DEBUG。
core dump 分析的局限性
不要期待能依赖 core dump 分析解决所有的问题,下面是一个简单的模拟缓冲区溢出的例子,在这个例子中由于缓冲区溢出覆盖了调用栈信息,从而完全丢失了定位依据:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
root@/tmp#>xlC test.C -g -o test2
root@/tmp#>
root@/tmp#>./test
input str!

012345678901234567890123456789
Segmentation fault(coredump)
root@/tmp#>dbx ./test2 core
Type 'help' for help.
[using memory image in core]
reading symbolic information ...

Segmentation fault in test2. at 0x34353634
0x34353634 (???) warning: Unable to access address 0x34353634 from core
(dbx) where
warning: Unable to access address 0x34353634 from core
warning: Unable to access address 0x34353634 from core
warning: Unable to access address 0x34353630 from core
warning: Unable to access address 0x34353630 from core
warning: Unable to access address 0x34353634 from core
warning: Unable to access address 0x34353634 from core
warning: Unable to access address 0x34353630 from core
warning: Unable to access address 0x34353630 from core
warning: Unable to access address 0x34353634 from core
warning: Unable to access address 0x36373841 from core
test2.() at 0x34353634
warning: Unable to access address 0x36373839 from core
warning: Unable to access address 0x36373839 from core
(dbx)






欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0