How do I make a thread dump with MONO?

后端 未结 2 481
走了就别回头了
走了就别回头了 2021-01-01 15:11

How can I show the threads (stacktraces) in a hanging application that run with MONO?

I know that I can do it in .NET with the Managed Stack Explorer (MSE). Because

2条回答
  •  悲哀的现实
    2021-01-01 15:38

    Assuming you're on Linux/Unix, not Windows, send a SIGQUIT signal to your program. This can be done with

    kill -QUIT $PID
    

    where $PID is the pid of your program. Mono will then dump stack traces of all threads to stdout. Note that although the process stays running after this, you should not expect it to remain usable/stable.

    See http://en.wikipedia.org/wiki/SIGQUIT for some background.

    Note: The thread dump will not print out in the terminal window where you ran the kill command. It will appear in the stderr of the mono process.

提交回复
热议问题