What is a good way to dump a Linux core file from inside a process?

前端 未结 8 1976
醉梦人生
醉梦人生 2020-12-08 23:14

We have a server (written in C and C++) that currently catches a SEGV and dumps some internal info to a file. I would like to generate a core file and write it to disk at th

8条回答
  •  一向
    一向 (楼主)
    2020-12-08 23:37

    use backtrace and backtrace_symbols glibc calls to get the trace, just keep in mind that backtrace_symbols uses malloc internally and in case of heap corruption it might fail.

提交回复
热议问题