如何使用MONO进行线程转储? [英] How do I make a thread dump with MONO?

查看:182
本文介绍了如何使用MONO进行线程转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在使用MONO运行的挂起的应用程序中显示线程(堆栈跟踪)?

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

我知道我可以使用托管堆栈资源管理器(MSE)在.NET中完成此操作.因为应用程序仅在MONO上挂起,所以我需要在MONO上挂起.

I know that I can do it in .NET with the Managed Stack Explorer (MSE). Because the application hang only with MONO that I need to do it with MONO.

或者还有其他想法可以找到悬挂的地方吗?

Or there are any other ideas how I can find the place of hanging?

推荐答案

假设您使用的是Linux/Unix,而不是Windows,请向您的程序发送SIGQUIT信号.这可以通过

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

kill -QUIT $PID

其中$ PID是程序的pid.然后,Mono将所有线程的堆栈跟踪信息转储到stdout.请注意,尽管此后进程仍保持运行,但您不应期望它保持可用/稳定.

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.

有关某些背景,请参见 http://en.wikipedia.org/wiki/SIGQUIT

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

注意:线程转储将在您运行kill命令的终端窗口中 not 打印出来.它会出现在mono进程的stderr中.

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.

这篇关于如何使用MONO进行线程转储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆