简体   繁体   English

为什么syslog和gdb显示同一共享库的不同加载地址?

[英]Why do syslog and gdb show different load address for the same shared library?

I'm facing a segmentation fault. 我正面临分段错误。 Syslog reports the following: Syslog报告以下内容:

segfault at 0 ip 00000000f71ff256 sp 00000000f44fee50 error 4 in libprotobuf-c.so.0.0.0[f71f8000+f000]

So, libprotobuf-c.so is loaded at 0xf71f8000 . 因此,libprotobuf-c.so加载到0xf71f8000 When I loaded the respective core file in gdb and tried info sharedlibrary , it shows FROM address as 0xf71f9f70 which is different from what syslog showed. 当我在gdb中加载相应的核心文件并尝试使用info sharedlibrary ,它将FROM地址显示为0xf71f9f70 ,这与syslog显示的不同。 I'm not able to understand this mismatch. 我无法理解这种不匹配。 Could someone please help? 有人可以帮忙吗?

0xf71f9f70  0xf7204028  Yes (*)     /usr/lib/libprotobuf-c.so.0

So, libprotobuf-c.so is loaded at 0xf71f8000 . 因此,libprotobuf-c.so加载到0xf71f8000 When I loaded the respective core file in gdb and tried info sharedlibrary, it shows FROM address as 0xf71f9f70 which is different from what syslog showed. 当我在gdb中加载相应的核心文件并尝试使用info sharedlibrary时,它将FROM地址显示为0xf71f9f70 ,这与syslog显示的不同。

Actually they are the same. 实际上他们一样的。 GDB shows start of .text as the From address. GDB显示.text作为From地址的开头。

If you do readelf -WS /usr/lib/libprotobuf-c.so.0 | grep '\\.text' 如果你做readelf -WS /usr/lib/libprotobuf-c.so.0 | grep '\\.text' readelf -WS /usr/lib/libprotobuf-c.so.0 | grep '\\.text' , you'll discover that .text starts at 0xf71f9f70 - 0xf71f8000 == 0x1f70 . readelf -WS /usr/lib/libprotobuf-c.so.0 | grep '\\.text'0xf71f9f70 - 0xf71f8000 == 0x1f70 readelf -WS /usr/lib/libprotobuf-c.so.0 | grep '\\.text' ,你会发现.text0xf71f9f70 - 0xf71f8000 == 0x1f70开始0xf71f9f70 - 0xf71f8000 == 0x1f70

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM