Analyzing core file of shared object

若如初见. 提交于 2019-12-11 07:24:40

问题


Tests :

[1] creating divide of 0 in executable hat was compiled with optimization (O2) and debugging symbols , thus a core was generated.

[2] creating divide of 0 in shared object hat was compiled with optimization (O2) and debugging symbols , thus a core was generated.

Results:

[First] analysing the core generated by [1] was succeeded and an exact location of the crush could be seen in GDB/Totalview.

[Second] analysing the core generated by [2] was NOT succeeded and a hex numeric location was the output of the crush.

can someone tell how can i get [2] to succeed ?


回答1:


Check with ldd that your shared object can be found.

If not, try with shell variable LD_LIBRARY_PATH to set its path and try again gdb <executable> core.

Another option is to edit config /etc/ld.so.conf and run ldconfig.




回答2:


Solved it , i was opening the core file like this :

  1. gdb core core-file-name
  2. file location-of-binary

then the binary symbols was loaded, BUT Not any shared objects !!!!!

going this way :

  1. gdb -c core-file-name location-of-binary

this caused binary symbols to be loaded BUT ALSO shared objects symbols to be loaded as well !!!

thanks for the help.



来源:https://stackoverflow.com/questions/3502340/analyzing-core-file-of-shared-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!