在windbg时要注意sos.dll的版本

来源:互联网 发布:原油库存数据公布 编辑:程序博客网 时间:2024/05/16 14:34

前段时间项目遇到一些问题,抓了一个dump后拿回家里的机器上分析。按着方法一步一步走,走到!clrstack的时候,问题出现了——看不到托管环境下的method name。我觉得这这!clrstack看不到method name可真没什么作用了。随后请教了几个朋友,都说没碰到过着情况。

第二天去了公司先打开windbg,open这个dump,载入sos后先来一个~*e!clrstack。邪门,method name都出来了。

从操作系统,windbg版本,symbols等几个方面都下手分析了一下,未果。问人吧,问了一圈都没有解决。问了熊力,他说他可以看到,说明问题肯定不奇怪,而且肯定是某个细节的问题。挂虚拟机,测之,问题依旧,大悦,终于出问题了。

后来我把我公司机器上的sos和家里机器的sos拿过来比较,大小不一样,用!eeversion来看,版本号确实不一样。问题解决——选用合适的版本!

但是为什么出现这种情况呢?

发了email问tess,可惜的是tess大姐渡假期去了,但是庆幸的是Tom假期结束,也给了回复:

So the problem here is that we do not guarantee that newer versions of SOS will be able to debug older versions of CLR.  You must match the version of SOS to the version of the runtime (unless we are explicitly giving them private bits for SOS to fix a bug in it).  From the output below, !eeversion is telling you that the one that won’t walk the stack does not match the runtime’s version.  This is why it won’t walk the stack.
We always try to make SOS backwards compatible, but it’s not something we guarantee.

估计知道这个事情的人不多,特此分享。如遇雷同,麻烦留言谢过后立刻能解决。

原创粉丝点击