Find which program caused a core dump file

后端 未结 3 1158
灰色年华
灰色年华 2021-02-07 00:12

I\'ve been going through intense program/package installation recently, so I can\'t tell for sure which of the newly installed programs (or old programs) caused the appearance o

相关标签:
3条回答
  • 2021-02-07 00:24

    Often using the file program on the core file will show the errant executable, as explained by @Benj in the accepted answer (code from Benj's answer):

    # file /var/core/core
    /var/core/core:     ELF 64-bit MSB core file SPARCV9 Version 1, from 'crs_stat.bin'
    

    However, sometimes you may get a complaint about "too many program header sections":

    core.some-lib.nnnn.nnnn: ELF 64-bit LSB  core file x86-64, version 1 (SYSV), too many program header sections (1850)
    

    In this case, you can try some alternatives:

    • Tail the last several strings of the corefile (the app was about 25 back for me): strings core.some-lib.nnnn.nnnn | tail -50
    • Use gdb itself: gdb -c core.some-lib.nnnn.nnnn This will often tell you something like this: Core was generated by '/usr/local/bin/some-executable'
    0 讨论(0)
  • 2021-02-07 00:28

    You can simply use the file program to identify them:

    E.g

    # file /var/core/core
    /var/core/core:     ELF 64-bit MSB core file SPARCV9 Version 1, from 'crs_stat.bin'
    
    0 讨论(0)
  • you can navigate to the directory where the core.pid is and run gdb core core.pid

    0 讨论(0)
提交回复
热议问题