Linuxプログラムは応答しません。どのルーチンがそのフリーズを引き起こしたかをどうやって知ることができますか?

Alexander.Iljushkin

会社のサーバーアプリケーションで問題が発生しました。次回はこのエラーを再現できないと思うので、それを殺すことはできません。そのため、このプログラムのフリーズの原因について、その中の関数やルーチンを含むがこれらに限定されない最大の情報を取得するにはどうすればよいか知りたいです。

どのプロシージャが現在実行されているかを知る方法は?

アルパー

あなたがプロセスをデバッグすることができますgdb --pid=PIDし、backtraceあなたが機能を見つけるためにスタックトレースを提供します。

--pid=PID          Attach to running process PID.

の例 sleep

$ sleep 1000 &
[2] 13221
$ gdb --pid=13221
GNU gdb (GDB) Fedora 7.7.1-13.fc20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 13221
Reading symbols from /usr/bin/sleep...Reading symbols from /usr/bin/sleep...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x0000003122abc970 in __nanosleep_nocancel () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install coreutils-8.21-21.fc20.x86_64
(gdb) backtrace 
#0  0x0000003122abc970 in __nanosleep_nocancel () from /lib64/libc.so.6
#1  0x00000000004040cf in rpl_nanosleep ()
#2  0x0000000000403f30 in xnanosleep ()
#3  0x00000000004018ed in main ()
(gdb) 

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Related 関連記事

ホットタグ

アーカイブ