JP2006277115A - Abnormality detection program and abnormality detection method - Google Patents
Abnormality detection program and abnormality detection method Download PDFInfo
- Publication number
- JP2006277115A JP2006277115A JP2005092780A JP2005092780A JP2006277115A JP 2006277115 A JP2006277115 A JP 2006277115A JP 2005092780 A JP2005092780 A JP 2005092780A JP 2005092780 A JP2005092780 A JP 2005092780A JP 2006277115 A JP2006277115 A JP 2006277115A
- Authority
- JP
- Japan
- Prior art keywords
- abnormality detection
- operation information
- abnormality
- application program
- spontaneous
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
この発明は、オペレーティングシステム上で動作するアプリケーションプログラムの動作異常を検出する異常検出プログラムおよび異常検出方法に関し、特に、監視対象となるアプリケーションプログラムを改修することなく効率的にアプリケーションプログラムの動作異常を検出することができる異常検出プログラムおよび異常検出方法に関する。 The present invention relates to an anomaly detection program and an anomaly detection method for detecting an anomaly in an application program that operates on an operating system, and more particularly to efficiently detect an anomaly in an application program without modifying the application program to be monitored. The present invention relates to an abnormality detection program and an abnormality detection method that can be performed.
従来、オペレーティングシステム上で動作するアプリケーションプログラムが無限ループに陥ったり、資源競合の結果ハングアップしたりといったプログラムの動作異常を検出する異常検出プログラムが知られている。 Conventionally, an abnormality detection program that detects an abnormal operation of a program such as an application program running on an operating system falling into an infinite loop or being hung up as a result of resource contention is known.
たとえば、動作異常の監視対象となるアプリケーションプログラムにプログラム異常を検出するためのコードを埋め込むことにより、アプリケーションプログラムの動作異常を検出する異常検出プログラムがある。しかし、市販のアプリケーションプログラムのように、ソースコードの改修をエンドユーザがおこなうことができないプログラムについては、かかるコードを埋め込むことができないので動作異常の検出対象とすることができないという問題があった。 For example, there is an abnormality detection program for detecting an operation abnormality of an application program by embedding a code for detecting the program abnormality in an application program to be monitored for operation abnormality. However, there is a problem that a program that cannot be modified by an end user, such as a commercially available application program, cannot be embedded in such a code and cannot be detected as an abnormal operation.
このため、動作異常の検出対象となるアプリケーションプログラムのコード改修を必要としない動作異常検出技術が提案されている。たとえば、特許文献1には、アプリケーションプログラムの暴走が引き起こすバスエラーの継続時間を計時するタイマをCPU側に用意してアプリケーションプログラムの動作異常を検出する技術が開示されている。また、特許文献2には、アプリケーションプログラムがディスプレイなどに表示する画面の表示に要する時間を計時することによりアプリケーションプログラムの動作異常を検出する技術が開示されている。
For this reason, there has been proposed an operation abnormality detection technique that does not require code modification of an application program to be detected as an operation abnormality. For example,
しかしながら、かかる特許文献1を用いたとしても、バスエラーを引き起こさない動作異常を検出することはできない。たとえば、アプリケーションプログラムの無限ループは、バスエラーを引き起こさない動作異常の一つである。この無限ループは、他のアプリケーションの動作に悪影響をおよぼすばかりか、場合によってはシステムダウンを引き起こすこともあるため検出対象とすべき動作異常である。しかし、特許文献1を用いても無限ループによる動作異常を検出することはできない。
However, even if this
また、特許文献2を用いたとしても、表示画面を有しないアプリケーションプログラムの動作異常を検出することはできない。たとえば、オペレーティングシステム上で動作する通信デーモンなどの常駐プロセスは表示画面を有しないので、特許文献2を用いてもかかる常駐プロセスの動作異常を検出することはできない。
Even if
また、アプリケーションプログラムは複数のプロセスにより構成されることが通常であるが、従来の異常検出プログラムは、アプリケーションプログラムのメインプロセスが終了した場合に、メインプロセスが生成した子プロセスの監視を継続しておこなうことができないという問題があった。このような監視できないプロセスが残存すると、他のアプリケーションに悪影響をおよぼす場合があるので、これらのプロセスを確実に監視対象とする必要がある。 In addition, the application program is usually composed of a plurality of processes. However, the conventional abnormality detection program continues to monitor the child processes generated by the main process when the main process of the application program ends. There was a problem that it could not be done. If such a process that cannot be monitored remains, it may adversely affect other applications. Therefore, it is necessary to reliably monitor these processes.
これらのことから、動作異常の検出対象となるアプリケーションプログラムの改修をおこなうことなく、アプリケーションプログラムを構成するすべてのプロセスについて、無限ループなどの動作異常を効率的かつ確実に検出する異常検出プログラムをいかにして実現するかが大きな課題となっている。 For these reasons, there is no need to develop an abnormality detection program that efficiently and reliably detects anomalies such as infinite loops for all processes that make up an application program, without revising the application programs that are subject to detection of anomalies. How to achieve this is a major issue.
この発明は、上述した従来技術による問題点を解消するためになされたものであり、動作異常の検出対象となるアプリケーションプログラムの改修をおこなうことなく、かかるアプリケーションプログラムの動作異常を効率的に検出することができる異常検出プログラムおよび異常検出方法を提供することを目的とする。 The present invention has been made to solve the above-described problems caused by the prior art, and efficiently detects an operation abnormality of such an application program without revising the application program to be detected. An object of the present invention is to provide an abnormality detection program and an abnormality detection method.
上述した課題を解決し、目的を達成するため、請求項1の発明に係る異常検出プログラムは、オペレーティングシステム上で動作するアプリケーションプログラムの動作異常を検出する異常検出プログラムであって、前記アプリケーションプログラムに属するプロセスの動作情報を前記オペレーティングシステムから取得する取得手順と、前記動作情報取得手順が取得した前記動作情報に基づいて前記アプリケーションプログラムの動作異常を判定する判定手順とをコンピュータに実行させることを特徴とする。
In order to solve the above-described problems and achieve the object, an abnormality detection program according to the invention of
また、請求項2の発明に係る異常検出プログラムは、請求項1の発明において、前記取得手順が取得する前記動作情報は、前記プロセスのコンテキストスイッチ回数を含んだことを特徴とする。 An abnormality detection program according to a second aspect of the present invention is the abnormality detection program according to the first aspect, wherein the operation information acquired by the acquisition procedure includes the number of context switches of the process.
また、請求項3の発明に係る異常検出プログラムは、請求項2の発明において、前記コンテキストスイッチ回数は、前記プロセスが自らの指示で発生させたコンテキストスイッチの回数をあらわす自発的コンテキストスイッチ回数と、該プロセス以外の要因により引き起こされたコンテキストスイッチの回数をあらわす他発的コンテキストスイッチ回数とに区分されていることを特徴とする。 An abnormality detection program according to a third aspect of the present invention is the abnormality detection program according to the second aspect of the invention, wherein the number of context switches is a number of spontaneous context switches that represents the number of context switches generated by the process according to its own instruction. The number of times of context switching caused by factors other than the process is divided into the number of times of spontaneous context switching.
また、請求項4の発明に係る異常検出プログラムは、請求項1、2または3の発明において、前記取得手順が取得する前記動作情報は、前記プロセスの実行状態をあらわすプロセス状態を含んだことを特徴とする。 According to a fourth aspect of the present invention, there is provided the abnormality detection program according to the first, second, or third aspect of the invention, wherein the operation information acquired by the acquisition procedure includes a process state representing an execution state of the process. Features.
また、請求項5の発明に係る異常検出プログラムは、請求項4の発明において、前記判定手順は、前記プロセス状態が変化しないまま所定時間経過したならば、前記コンテキストスイッチ回数に基づいて前記アプリケーションプログラムの動作異常を判定することを特徴とする。 An abnormality detection program according to a fifth aspect of the present invention is the abnormality detection program according to the fourth aspect of the present invention, wherein, in the determination procedure, the application program is based on the number of context switches when a predetermined time elapses without changing the process state. It is characterized by determining an abnormal operation.
また、請求項6の発明に係る異常検出プログラムは、請求項5の発明において、前記判定手順は、前記プロセス状態が実行中のまま所定時間経過した場合であって、前記自発的コンテキストスイッチ回数が変化せず、かつ、前記他発的コンテキストスイッチ回数が変化した場合に、前記プロセスが無限ループに陥ったと判定することを特徴とする。 The abnormality detection program according to a sixth aspect of the present invention is the abnormality detection program according to the fifth aspect, wherein the determination procedure is a case where a predetermined time has elapsed while the process state is being executed, and the number of spontaneous context switch times is It is characterized in that it is determined that the process has fallen into an infinite loop when there is no change and the number of times of the spontaneous context switch is changed.
また、請求項7の発明に係る異常検出プログラムは、請求項5または6の発明において、前記判定手順は、前記プロセス状態が実行中のまま所定時間経過した場合であって、前記自発的コンテキストスイッチ回数が変化せず、かつ、前記他発的コンテキストスイッチ回数も変化しない場合に、前記プロセスがCPU待ち異常に陥ったと判定することを特徴とする。 An abnormality detection program according to a seventh aspect of the present invention is the abnormality detection program according to the fifth or sixth aspect, wherein the determination procedure is a case where a predetermined time elapses while the process state is being executed, and the spontaneous context switch If the number of times does not change and the number of times of the spontaneous context switch does not change, it is determined that the process has fallen into a CPU waiting abnormality.
また、請求項8の発明に係る異常検出プログラムは、請求項5、6または7の発明において、前記判定手順は、前記プロセス状態が実行待ちのまま所定時間経過した場合であって、前記自発的コンテキストスイッチ回数が変化せず、かつ、前記他発的コンテキストスイッチ回数も変化しない場合に、前記プロセスがI/O待ち異常に陥ったと判定することを特徴とする。 According to an eighth aspect of the present invention, there is provided the abnormality detection program according to the fifth, sixth or seventh aspect, wherein the determination procedure is a case where the process state is waiting for execution and a predetermined time has elapsed, When the number of context switches does not change and the number of spontaneous context switches does not change, it is determined that the process has fallen into an I / O waiting abnormality.
また、請求項9の発明に係る異常検出プログラムは、請求項1〜8のいずれか一つに記載の発明において、前記取得手順が取得する動作情報は、前記アプリケーションプログラムに属する前記プロセスの親子関係を含んだことを特徴とする。
The abnormality detection program according to the invention of claim 9 is the invention according to any one of
また、請求項10の発明に係る異常検出プログラムは、請求項9の発明において、前記判定手順は、前記アプリケーションプログラムに属する子プロセスの親プロセスが終了して該子プロセスがゾンビプロセスとなった場合であっても該ゾンビプロセスを含む該アプリケーションプログラムの動作異常の判定を継続することを特徴とする。
The abnormality detection program according to the invention of
また、請求項11の発明に係る異常検出プログラムは、請求項1〜10のいずれか一つに記載の発明において、前記動作情報は、前記アプリケーションプログラムに属するプロセスのプロセス優先度を含んだことを特徴とする。
An abnormality detection program according to an invention of claim 11 is the invention according to any one of
また、請求項12の発明に係る異常検出プログラムは、請求項1〜11のいずれか一つに記載の発明において、前記オペレーティングシステムは、前記アプリケーションプログラムに属するプロセスのプロセスディスクリプタごとに前記動作情報を収集して前記取得手順に提供する提供手順をコンピュータに実行させることを特徴とする。 An abnormality detection program according to a twelfth aspect of the present invention is the abnormality detection program according to any one of the first to eleventh aspects, wherein the operating system stores the operation information for each process descriptor of a process belonging to the application program. A provision procedure that is collected and provided to the acquisition procedure is executed by a computer.
また、請求項13の発明に係る異常検出プログラムは、請求項1〜12のいずれか一つに記載の発明において、前記アプリケーションプログラムに属するプロセスには、マルチスレッドプロセスが含まれることを特徴とする。 An abnormality detection program according to a thirteenth aspect of the present invention is the abnormality detection program according to any one of the first to twelfth aspects, wherein the process belonging to the application program includes a multi-thread process. .
また、請求項14の発明に係る異常検出方法は、オペレーティングシステム上で動作するアプリケーションプログラムの動作異常を検出する異常検出方法であって、前記アプリケーションプログラムに属するプロセスの動作情報を前記オペレーティングシステムから取得する取得工程と、前記動作情報取得工程が取得した前記動作情報に基づいて前記アプリケーションプログラムの動作異常を判定する判定工程とを含んだことを特徴とする。 An abnormality detection method according to the invention of claim 14 is an abnormality detection method for detecting an operation abnormality of an application program operating on an operating system, and acquires operation information of a process belonging to the application program from the operating system. And a determination step of determining an operation abnormality of the application program based on the operation information acquired by the operation information acquisition step.
また、請求項15の発明に係る異常検出方法は、請求項14の発明において、前記オペレーティングシステムは、前記アプリケーションプログラムに属するプロセスのプロセスディスクリプタごとに前記動作情報を収集して前記取得工程に提供する提供工程を含んだことを特徴とする。 According to a fifteenth aspect of the present invention, in the abnormality detection method according to the fifteenth aspect, the operating system collects the operation information for each process descriptor of a process belonging to the application program and provides it to the acquisition step. A providing step is included.
請求項1にかかる異常検出プログラムによれば、アプリケーションプログラムに属するプロセスの動作情報をオペレーティングシステムから取得し、取得した動作情報に基づいてアプリケーションプログラムの動作異常を判定するよう構成したので、動作異常の検出対象となるアプリケーションプログラムの改修をおこなうことなく、かかるアプリケーションプログラムの動作異常を効率的に検出することができるという効果を奏する。 According to the abnormality detection program of the first aspect, the operation information of the process belonging to the application program is acquired from the operating system, and the operation abnormality of the application program is determined based on the acquired operation information. There is an effect that the operation abnormality of the application program can be efficiently detected without modifying the application program to be detected.
また、請求項2にかかる異常検出プログラムによれば、取得手順が取得する動作情報は、プロセスのコンテキストスイッチ回数を含むよう構成したので、アプリケーションプログラムを構成するプロセスのCPU権の取得および開放の状態を把握することによりアプリケーションプログラムの動作異常を効率的に検出することができるという効果を奏する。
According to the abnormality detection program according to
また、請求項3にかかる異常検出プログラムによれば、コンテキストスイッチ回数は、プロセスが自らの指示で発生させたコンテキストスイッチの回数をあらわす自発的コンテキストスイッチ回数と、かかるプロセス以外の要因により引き起こされたコンテキストスイッチの回数をあらわす他発的コンテキストスイッチ回数とに区分されるよう構成したので、アプリケーションプログラムを構成するプロセスのCPU権の取得および開放の状態を詳細に把握することによりアプリケーションプログラムの動作異常を効率的に検出することができるという効果を奏する。
According to the abnormality detection program of
また、請求項4にかかる異常検出プログラムによれば、取得手順が取得する動作情報は、プロセスの実行状態をあらわすプロセス状態を含むよう構成したので、アプリケーションプログラムを構成するプロセスの実行状態を把握することによりアプリケーションプログラムの動作異常を効率的に検出することができるという効果を奏する。 According to the abnormality detection program of claim 4, the operation information acquired by the acquisition procedure is configured to include a process state representing the execution state of the process. Therefore, the execution state of the process constituting the application program is grasped. As a result, the operation abnormality of the application program can be efficiently detected.
また、請求項5にかかる異常検出プログラムによれば、判定手順は、プロセス状態が変化しないまま所定時間経過したならば、コンテキストスイッチ回数に基づいてアプリケーションプログラムの動作異常を判定するよう構成したので、動作異常と判定するための閾値を柔軟に設定することができるという効果を奏する。 According to the abnormality detection program according to claim 5, the determination procedure is configured to determine the operation abnormality of the application program based on the number of context switches when the predetermined time has passed without changing the process state. There is an effect that the threshold value for determining the abnormal operation can be set flexibly.
また、請求項6にかかる異常検出プログラムによれば、判定手順は、プロセス状態が実行中のまま所定時間経過した場合であって、自発的コンテキストスイッチ回数が変化せず、かつ、他発的コンテキストスイッチ回数が変化した場合に、プロセスが無限ループに陥ったと判定するよう構成したので、無限ループによる動作異常を効率的に検出することができるという効果を奏する。 According to the abnormality detection program of claim 6, the determination procedure is a case where a predetermined time has passed while the process state is being executed, the spontaneous context switch count does not change, and the spontaneous context Since the configuration is such that it is determined that the process has fallen into an infinite loop when the number of times of switching changes, there is an effect that it is possible to efficiently detect an abnormal operation due to the infinite loop.
また、請求項7にかかる異常検出プログラムによれば、判定手順は、プロセス状態が実行中のまま所定時間経過した場合であって、自発的コンテキストスイッチ回数が変化せず、かつ、他発的コンテキストスイッチ回数も変化しない場合に、プロセスがCPU待ち異常に陥ったと判定するよう構成したので、CPU待ちによる動作異常を効率的に検出することができるという効果を奏する。 According to the abnormality detection program of claim 7, the determination procedure is a case where a predetermined time has passed while the process state is being executed, and the number of spontaneous context switches does not change, and the spontaneous context When the number of switches does not change, it is determined that the process has fallen into the CPU wait abnormality, so that an operational abnormality due to the CPU wait can be efficiently detected.
また、請求項8にかかる異常検出プログラムによれば、判定手順は、プロセス状態が実行待ちのまま所定時間経過した場合であって、自発的コンテキストスイッチ回数が変化せず、かつ、他発的コンテキストスイッチ回数も変化しない場合に、プロセスがI/O待ち異常に陥ったと判定するよう構成したので、I/O待ちによる動作異常を効率的に検出することができるという効果を奏する。 According to the abnormality detection program according to claim 8, the determination procedure is a case where a predetermined time has passed while the process state is waiting to be executed, and the number of spontaneous context switches does not change, and the spontaneous context If the number of switches does not change, it is determined that the process has fallen into an I / O wait abnormality, so that an operational abnormality due to an I / O wait can be efficiently detected.
また、請求項9にかかる異常検出プログラムによれば、取得手順が取得する動作情報は、アプリケーションプログラムに属するプロセスの親子関係を含むよう構成したので、監視対象となるアプリケーションプログラムを構成するすべてのプロセスの動作異常を効率的に検出することができるという効果を奏する。 According to the abnormality detection program of claim 9, since the operation information acquired by the acquisition procedure is configured to include the parent-child relationship of processes belonging to the application program, all the processes constituting the application program to be monitored It is possible to efficiently detect the abnormal operation.
また、請求項10にかかる異常検出プログラムによれば、判定手順は、アプリケーションプログラムに属する子プロセスの親プロセスが終了してかかる子プロセスがゾンビプロセスとなった場合であってもゾンビプロセスを含むアプリケーションプログラムの動作異常の判定を継続するよう構成したので、監視対象となるアプリケーションプログラムに属するプロセスが終了し、プロセスの親子関係が崩れた場合であっても動作異常監視を継続することができるという効果を奏する。
Further, according to the abnormality detection program according to
また、請求項11にかかる異常検出プログラムによれば、動作情報は、アプリケーションプログラムに属するプロセスのプロセス優先度を含むよう構成したので、プロセス優先度を考慮した動作異常判定をおこなうことにより、動作異常判定の精度を向上させることができるという効果を奏する。 According to the abnormality detection program according to claim 11, since the operation information includes the process priority of the process belonging to the application program, the operation abnormality is determined by performing the operation abnormality determination in consideration of the process priority. There is an effect that the accuracy of determination can be improved.
また、請求項12にかかる異常検出プログラムによれば、オペレーティングシステムは、アプリケーションプログラムに属するプロセスのプロセスディスクリプタごとに動作情報を収集して取得手順に提供する提供手順をコンピュータに実行させるよう構成したので、アプリケーション監視に必要な情報の提供を効率的におこなうことができるという効果を奏する。 According to the abnormality detection program of the twelfth aspect, the operating system is configured to cause the computer to execute the providing procedure for collecting operation information for each process descriptor of the process belonging to the application program and providing the acquisition procedure. Thus, it is possible to efficiently provide information necessary for application monitoring.
また、請求項13にかかる異常検出プログラムによれば、アプリケーションプログラムに属するプロセスには、マルチスレッドプロセスが含まれるよう構成したので、監視対象となるアプリケーションプログラムにマルチスレッドプロセスが含まれる場合であっても、非マルチスレッドプロセスと同様に取り扱うことにより、プロセスの動作異常を効率的に検出することができるという効果を奏する。 According to the abnormality detection program of the thirteenth aspect, since the process belonging to the application program is configured to include the multi-thread process, the application program to be monitored includes the multi-thread process. However, when handled in the same manner as a non-multi-thread process, it is possible to efficiently detect an abnormal operation of the process.
また、請求項14にかかる異常検出方法によれば、アプリケーションプログラムに属するプロセスの動作情報をオペレーティングシステムから取得し、取得した動作情報に基づいてアプリケーションプログラムの動作異常を判定するよう構成したので、動作異常の検出対象となるアプリケーションプログラムの改修をおこなうことなく、かかるアプリケーションプログラムの動作異常を効率的に検出することができるという効果を奏する。 In addition, according to the abnormality detection method of the fourteenth aspect, the operation information of the process belonging to the application program is acquired from the operating system, and the operation abnormality of the application program is determined based on the acquired operation information. There is an effect that it is possible to efficiently detect the operation abnormality of the application program without modifying the application program to be detected.
また、請求項15にかかる異常検出方法によれば、オペレーティングシステムは、アプリケーションプログラムに属するプロセスのプロセスディスクリプタごとに動作情報を収集して取得手順に提供する提供工程を含むよう構成したので、アプリケーション監視に必要な情報の提供を効率的におこなうことができるという効果を奏する。 According to the abnormality detection method of the fifteenth aspect, the operating system is configured to include a providing step of collecting operation information for each process descriptor of the process belonging to the application program and providing the acquisition procedure. It is possible to efficiently provide information necessary for the operation.
以下に添付図面を参照して、この発明に係る異常検出プログラムおよび異常検出方法の好適な実施例を詳細に説明する。なお、以下の実施例においては、本発明を、オペレーティングシステムとしてLinux(登録商標)が動作するコンピュータに適用した場合について説明することとする。 Exemplary embodiments of an abnormality detection program and an abnormality detection method according to the present invention will be described below in detail with reference to the accompanying drawings. In the following embodiments, a case will be described in which the present invention is applied to a computer that runs Linux (registered trademark) as an operating system.
図1は、本発明に係るプログラムの異常検出処理の概念を示す図である。同図に示すように、本発明に係るプログラムの異常検出処理では、オペレーティングシステム上で動作するアプリケーションプログラムの1つとして監視プロセス100が設けられ、監視対象となる各アプリケーションの動作異常を監視する。この監視対象となるアプリケーションプログラム(図1に示す「監視対象アプリ」)は、複数のプロセスからなることが通常である。
FIG. 1 is a diagram showing the concept of a program abnormality detection process according to the present invention. As shown in the figure, in the abnormality detection process for a program according to the present invention, a
これらのプロセスがオペレーティングシステム上に生成されると、各プロセスに対応するプロセスディスクリプタがオペレーティングシステム内で管理される。オペレーティングシステムは、このプロセスディスクリプタを用いて各プロセスのスケジューリングをおこなったり、入出力などの資源の割り当てをおこなったりすることになる。 When these processes are generated on the operating system, process descriptors corresponding to the respective processes are managed in the operating system. The operating system performs scheduling of each process using this process descriptor and allocates resources such as input / output.
オペレーティングシステム内に設けられた動作情報提供部200は、かかるプロセスディスクリプタごとのプロセスの動作情報を取得し、取得した動作情報を上記監視プロセス100に提供する処理部である。なお、Linux(登録商標)は、ソースコードが公開されているオペレーティングシステムの1つであり、RAP(Resource Archive Project)によりオペレーティングシステムの機能拡張がおこなわれている。かかる動作情報提供部200は、Linux(登録商標)を機能拡張することにより設けられる処理部である。
The operation
監視プロセス100は、動作情報提供部200に動作情報取得要求をおこなうことにより監視対象アプリに属するプロセスの動作情報を取得する。そして、取得した動作情報に基づいて各プロセスに動作異常があるか否かを判定することにより監視対象アプリの動作異常を検出する。また、動作異常を検出した場合には、プロセスの強制終了などの異常時処理をおこなう。
The
従来、アプリケーションプログラムを監視する場合には、監視対象となるアプリケーションプログラムに所定のソースコードを追記する改修をおこなうことが通常であった。また、かかる改修をおこなう必要のないアプリ異常検出方法も提案されていたが、検出可能な動作異常が制限されており、アプリケーションプログラムがCPUを占有してしまう無限ループや、リアルタイムに実行する必要のあるアプリケーションプログラムがI/OまちやCPU待ちのため長期間動作を待たされるといった動作異常を効率的に検出することができないという問題があった。 Conventionally, when monitoring an application program, it has been usual to make a modification by adding a predetermined source code to the application program to be monitored. In addition, although an application abnormality detection method that does not require such modification has been proposed, the detectable operation abnormality is limited, and the application program must occupy the CPU or be executed in real time. There has been a problem that it is impossible to efficiently detect an operation abnormality in which an application program waits for a long period of time because of waiting for an I / O town or a CPU.
本発明に係る異常検出処理では、オペレーティングシステム内で管理されるプロセスディスクリプタと対応する動作情報をオペレーティングシステム側で収集し、オペレーティングシステム上で動作する監視プロセス100がかかる動作情報を取得し、取得した動作情報に基づいて監視対象アプリの動作異常を検出することとしている。
In the abnormality detection processing according to the present invention, the operation information corresponding to the process descriptor managed in the operating system is collected on the operating system side, and the
このように、監視プロセス100は、監視対象アプリを直接的に監視するのではなく、オペレーティングシステム内のプロセスディスクリプタに対応する動作情報を用いて監視対象アプリを間接的に監視することとした。したがって、監視対象アプリの改修をおこなうことなく監視対象アプリの動作異常を検出することができるとともに、オペレーティングシステム内の詳細なプロセス動作情報を取得することができるので、監視対象アプリに属するプロセスのさまざまな動作異常を効率的に検出することができる。
As described above, the
次に、本発明に係る異常検出処理において用いられる動作情報と、かかる動作情報に基づいて判定される異常種別との関係について図2を用いて説明する。図2は、動作情報と異常種別との関係を示す図である。本発明に係る異常検出処理では、CPU上で動作するプロセスの切り替え(以下、「コンテキストスイッチ」と言う)に着目し、コンテキストスイッチ回数の変化と異常種別との関係を用いて監視対象アプリの動作異常を検出することとした。 Next, the relationship between the operation information used in the abnormality detection process according to the present invention and the abnormality type determined based on the operation information will be described with reference to FIG. FIG. 2 is a diagram illustrating the relationship between the operation information and the abnormality type. In the abnormality detection processing according to the present invention, attention is paid to switching of processes operating on the CPU (hereinafter referred to as “context switch”), and the operation of the monitoring target application is performed using the relationship between the change in the number of context switches and the abnormality type. Anomaly was detected.
ここで、かかるコンテキストスイッチについて説明しておく。シングルCPUのコンピュータ上にマルチプロセス環境を実現するためには、CPU上で動作する各プロセスを順次切替えることにより、あたかも複数のプロセスが同時に動作しているようにスケジューリングする必要がある。たとえば、リアルタイムスケジューリングの場合にはタイマ割込みによりコンテキストスイッチがおこなわれ、実行中のプロセスにかわって実行待ちのプロセスがCPUにロードされる。また、ラウンドロビンスケジューリングの場合には各プロセスにタイムスライスを割り当て、このタイムスライスを使い切ったならばコンテキストスイッチがおこなわれ実行プロセスが切替えられる。 Here, the context switch will be described. In order to realize a multi-process environment on a single CPU computer, it is necessary to perform scheduling so that a plurality of processes are simultaneously operating by sequentially switching processes operating on the CPU. For example, in the case of real-time scheduling, context switching is performed by a timer interrupt, and a process waiting for execution is loaded on the CPU in place of the process being executed. In the case of round robin scheduling, a time slice is assigned to each process, and when this time slice is used up, a context switch is performed to switch the execution process.
また、かかるコンテキストスイッチには、自発的コンテキストスイッチと他発的コンテキストスイッチとがある。ここで、自発的コンテキストスイッチとは、CPU上で実行中のプロセスが入出力処理やセマフォなどのリソースを獲得するために、CPU上での実行権を自ら開放することにより引き起こすコンテキストスイッチのことをいう。また、他発的コンテキストスイッチとは、上述したオペレーティングシステムのスケジューリングなどにより実行中のプロセス以外の要因で引き起こされるコンテキストスイッチのことをいう。 Such context switches include a spontaneous context switch and a spontaneous context switch. Here, the spontaneous context switch is a context switch that is caused by releasing the execution right on the CPU itself so that the process running on the CPU acquires resources such as input / output processing and semaphore. Say. Further, the spontaneous context switch refers to a context switch caused by factors other than the process being executed due to the above-described scheduling of the operating system or the like.
そして、これらのコンテキストスイッチのカウントアップは、たとえば、以下のような手順でおこなわれる。すなわち、オペレーティングシステムが上記した自発的コンテキストスイッチを検出した場合、CPUを開放したプロセスから他のプロセスへ制御を移すとともに、メモリ上の自発的コンテキストスイッチ回数をインクリメントする。一方、上記した他発的コンテキストスイッチを検出した場合には、実行中のプロセスの実行を中断させ、割り込みプロセスへ制御を移すとともに、メモリ上の他発的コンテキストスイッチ回数をインクリメントする。 The count up of these context switches is performed, for example, in the following procedure. That is, when the operating system detects the above-described spontaneous context switch, the control is transferred from the process that releases the CPU to another process, and the number of spontaneous context switches on the memory is incremented. On the other hand, when the above-described other context switch is detected, the execution of the process being executed is interrupted, the control is transferred to the interrupt process, and the number of other context switches on the memory is incremented.
なお、このようなコンテキストスイッチのカウントアップ機能を備えないオペレーティングシステムを用いる場合であっても、プロセスがハードウェアにI/O要求を出した回数や、割り込みが発生した回数などをモニタすることにより、かかるカウントアップ機能を実現することができる。 Even when an operating system that does not have such a context switch count-up function is used, the number of times that a process issues an I / O request to the hardware, the number of times an interrupt occurs, and the like are monitored. Such a count-up function can be realized.
このように、コンテキストスイッチは実行プロセスが切り替わる際に引き起こされるので、かかるコンテキストスイッチ回数に着目することによりプロセスの動作異常を検出することが可能となる。 As described above, since the context switch is caused when the execution process is switched, it is possible to detect an abnormal operation of the process by paying attention to the number of context switches.
具体的には、図2に示したように、無限ループによる動作異常の場合には、プロセス状態が実行中であり、他発的コンテキストスイッチ回数は増加しているものの自発的コンテキストスイッチ回数が変化していない状態となる。すなわち、オペレーティングシステムのスケジューリングによりコンテキストスイッチが引き起こされているもののプロセスの処理は完了していないので、自発的なコンテキストスイッチを引き起こしていない状態が継続していることをあらわしている。したがって、かかる状態が所定時間継続しているプロセスは、無限ループによりCPUを長時間使用している可能性が高いので動作異常であると判定する。 Specifically, as shown in FIG. 2, in the case of an abnormal operation due to an infinite loop, the process state is being executed and the number of spontaneous context switches has increased, but the number of spontaneous context switches has changed. It will be in a state that is not. That is, although the context switch is caused by the scheduling of the operating system, the processing of the process is not completed, so that the state that does not cause the spontaneous context switch continues. Therefore, it is determined that a process in which such a state continues for a predetermined time is abnormal in operation because it is highly likely that the CPU has been used for a long time due to an infinite loop.
また、CPU待ちによる動作異常の場合には、プロセス状態が実行中であり、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数のいずれもが変化しない状態となる。かかる状態が所定時間継続した場合には、他のプロセスによりプロセスの実行が阻害されている可能性が高いのでCPU待ちによる動作異常であると判定する。 In the case of an abnormal operation due to waiting for the CPU, the process state is being executed, and neither the number of spontaneous context switches nor the number of spontaneous context switches changes. If this state continues for a predetermined time, it is highly likely that the execution of the process is hindered by another process, so it is determined that the operation is abnormal due to the CPU waiting.
また、I/O待ちによる動作異常の場合には、プロセスが待機中であり、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数のいずれもが変化しない状態となる。かかる状態が所定時間継続した場合には、他のプロセスとのリソースの競合などによりプロセスのI/O処理が阻害されている可能性が高いのでI/O待ちによる動作異常であると判定する。 In the case of an abnormal operation due to waiting for I / O, the process is waiting, and neither the number of spontaneous context switches nor the number of spontaneous context switches changes. If such a state continues for a predetermined time, it is highly likely that the I / O processing of the process is hindered due to resource contention with another process, and so it is determined that the operation is abnormal due to I / O waiting.
このように、本発明に係る異常検出処理では、コンテキストスイッチに着目し、かかるコンテキストスイッチ回数の変化とプロセス状態の継続時間とを関連づけることにより動作異常を検出することとしたので、効率的に監視対象アプリの動作異常を検出することができる。 As described above, in the abnormality detection processing according to the present invention, attention is paid to the context switch, and the operation abnormality is detected by associating the change in the number of context switches with the duration of the process state. An abnormal operation of the target application can be detected.
また、本発明に係る異常検出処理では、監視対象アプリを構成するすべてのプロセスを監視対象とすることができる。かかる監視対象アプリのプロセス構成について図3を用いて説明しておく。図3は、監視対象アプリのプロセス構成を示す図である。 In the abnormality detection process according to the present invention, all processes constituting the monitoring target application can be set as monitoring targets. The process configuration of the monitoring target application will be described with reference to FIG. FIG. 3 is a diagram illustrating a process configuration of the monitoring target application.
同図に示すように、監視対象アプリは、メインプロセスとなる親プロセス101と、かかる親プロセスがforkなどのシステムコールを発行することにより生成される子プロセス102とから構成されることが通常である。なお、かかる子プロセス102がさらに子プロセス102を生成する場合もあるので、監視対象アプリは、プロセスの親子関係の階層構造から構成される場合が多い。
As shown in the figure, the monitoring target application is usually composed of a
本発明に係る異常検出処理では、プロセス生成時にオペレーティングシステム上に生成されるプロセスディスクリプタを用いて間接的に監視対象アプリの動作異常を検出することとしている。具体的には、オペレーティングシステム内に設けられた動作情報提供部200がプロセスディスクリプタの内容からプロセスの親子関係を関連づけて保持することとしている。
In the abnormality detection processing according to the present invention, an operation abnormality of the monitoring target application is indirectly detected using a process descriptor generated on the operating system at the time of process generation. Specifically, the operation
通常のLinux(登録商標)などのUNIX(登録商標)オペレーティングシステムは、親プロセスが消滅した場合には、かかる親プロセスが生成した子プロセスはマスタープロセスの配下に置かれ、いわゆるゾンビプロセスとなる。したがって、従来の異常検出処理では、親プロセスが消滅した後には、監視対象アプリに属する子プロセスを認識することができないため監視を継続することができないという問題があった。 In a UNIX (registered trademark) operating system such as a normal Linux (registered trademark), when a parent process disappears, a child process generated by the parent process is placed under the master process and becomes a so-called zombie process. Therefore, the conventional abnormality detection process has a problem that monitoring cannot be continued because the child process belonging to the monitoring target application cannot be recognized after the parent process disappears.
本発明に係る異常検出処理では、上述したようにプロセス生成時にプロセスの親子関係を関連づけて保持することとしているので、監視対象アプリのメインプロセスが終了した後であっても、監視対象アプリを構成する子プロセスの監視を継続しておこなうことができる。なお、メインプロセス以外のプロセスが終了した場合であっても、プロセス生成時の親子関係をたどることにより、同様に監視を継続することができる。 In the abnormality detection processing according to the present invention, since the parent-child relationship of the processes is associated and held at the time of process generation as described above, the monitoring target application is configured even after the main process of the monitoring target application ends. It is possible to continue to monitor the child process. Even when a process other than the main process ends, monitoring can be continued in the same manner by following the parent-child relationship at the time of process generation.
次に、本発明に係る異常検出処理を含むコンピュータ1の構成について図4を用いて説明する。図4は、異常検出処理を含むコンピュータ1の構成を示す機能ブロック図である。同図に示すように、コンピュータ1は、監視処理部10と、動作情報提供処理部15と、記憶部20とを備えている。なお、監視処理部10はオペレーティングシステム上で動作する監視プログラムが備える処理部であり、動作情報提供処理部15はオペレーティングシステムが備える処理部である。
Next, the configuration of the
監視処理部10は、アプリケーション起動部10aと、動作情報取得部10bと、動作異常判定部10cと、動作異常時処理部10dとをさらに備えており、動作情報提供処理部15は、動作情報提供部15aと、動作情報管理部15bとをさらに備えている。また、記憶部20は、監視処理部10が用いる監視対象データ20aと、動作情報提供処理部15が用いる動作情報20bとをさらに備えている。
The
監視処理部10は、監視対象アプリを生成して監視対象データ20aを記憶部20に書き込むとともに動作情報提供処理部15から動作情報20bを取得し、監視対象データ20aおよび動作情報20bに基づいて監視対象アプリの動作異常を判定し、動作異常に対する処理を実行する処理部である。
The
アプリケーション起動部10aは、監視対象アプリを生成するとともに、監視対象アプリに関する情報を監視対象データ20aとして記憶部20に書き込む処理部である。ここで、かかる監視対象データ20aの一例について図5を用いて説明しておく。図5は、監視対象データ20aの一例を示す図である。
The
同図に示すように、アプリケーション起動部10aが監視対象アプリを起動した場合には、起動したアプリ名と、起動したアプリのメインプロセスのメインプロセスIDとを含む情報が監視対象データ20aとして記憶部20に書き込まれる。たとえば、図5に示した場合について説明すると、アプリケーション起動部10aは、アプリA、アプリBおよびアプリCの3つのアプリを監視対象としており、各監視対象アプリのメインプロセスIDは、それぞれ、200、240および300であることを示している。
As shown in the figure, when the
なお、本実施例においては、監視処理部10が、起動したアプリ名と、起動したアプリのメインプロセスのプロセスIDとを含む監視対象データ20aを記憶部20に記憶し、のちに取得するプロセスの動作情報20bと関連づける場合について説明するが、監視対象データ20aは、かかるプロセスIDを含まないものとすることもできる。この場合には、動作情報20bにプロセス名を含ませることとし、このプロセス名と監視対象データ20aに含まれるアプリ名とを関連づけることにより監視対象アプリに属するプロセスを認識することになる。
In the present embodiment, the
図4の説明に戻り、動作情報取得部10bについて説明する。動作情報取得部10bは、所定のタイミングで動作情報提供処理部15に動作情報取得要求をおこなってプロセスの動作情報20bを取得し、取得した動作情報20bを動作異常判定部10cに渡す処理をおこなう処理部である。ここで、動作情報取得部10bが取得するプロセスの動作情報20bの一例について図6を用いて説明しておく。図6は、動作情報20bの一例を示す図である。
Returning to the description of FIG. 4, the operation
図6に示すように、この動作情報20bは、プロセスIDと、親プロセスIDと、プロセス動作状態と、動作状態継続時間と、他発的コンテキストスイッチ回数と、自発的コンテキストスイッチ回数とを含んだ情報であり、動作情報提供処理部15が収集し、動作情報取得部10bの求めに応じて提供する情報である。
As shown in FIG. 6, the
図6に示したように、動作情報20bは、プロセスIDと親プロセスIDとを含んでおり、監視対象アプリに属するプロセスが生成された際に、このプロセスのプロセスIDと、かかるプロセスを生成した親プロセスIDとが動作情報提供処理部15によりセットされる。したがって、監視対象アプリに属するプロセスが終了して親子関係が崩れた場合であっても動作情報20bの親プロセスIDをたどることで、監視対象アプリに属するすべてのプロセスに関する情報を監視プロセスに対して提供することができる。
As shown in FIG. 6, the
ここで、親プロセスが終了した場合におけ監視対象アプリのプロセス構成について図7を用いて説明する。図7は、親プロセスが終了した場合における監視対象アプリのプロセス構成を示す図である。同図に示すように、親プロセス101が終了した場合であっても、監視プロセス100は、監視対象アプリケーションに属する子プロセス102の監視を継続することができる。
Here, the process configuration of the monitoring target application when the parent process ends will be described with reference to FIG. FIG. 7 is a diagram illustrating a process configuration of the monitoring target application when the parent process is terminated. As shown in the figure, even when the
その理由は、動作情報20bには、監視対象アプリに属するプロセスが生成された際に、プロセスIDと、その親プロセスIDがセットされているため、親プロセスが終了した場合であってもプロセスツリーをたどることにより監視対象アプリに属するすべてのプロセスを把握することができるからである。なお、監視対象アプリに属するすべてのプロセスが終了した際に、動作情報提供処理部15は、動作情報20bからかかる監視対象アプリに属するプロセスに関する情報を削除することになる。
The reason is that the process information and its parent process ID are set in the
図6の説明に戻って、プロセス動作状態について説明する。プロセス動作状態は、プロセスの実行状態をあらわす項目であり、「実行中」または「実行待ち」の状態がある。「実行中」状態とは、プロセスがCPU権を取得してCPU上で動作中である状態、またはCPU上で動作していたプロセスが他発的コンテキストスイッチにより他のプロセスにCPU権を横取りされた状態をあらわす。また、「実行待ち」状態とは、CPU上で動作していたプロセスがCPU権を自ら開放して自発的コンテキストスイッチを引き起こした状態をあらわす。 Returning to the description of FIG. 6, the process operation state will be described. The process operation state is an item representing the execution state of the process, and includes a state of “executing” or “waiting for execution”. The “running” state is a state in which a process has acquired the CPU right and is operating on the CPU, or a process that has been operating on the CPU is intercepted by another process by a spontaneous context switch. It shows the state. The “waiting to execute” state represents a state in which a process operating on the CPU releases the CPU right and causes a spontaneous context switch.
動作状態継続時間は、プロセス動作状態が変化せず継続している時間をあらわす項目である。たとえば、プロセス動作状態が「実行待ち」から「実行中」に変化し、「実行中」のまま1secが経過した場合には、この動作状態継続時間は1secとなる。 The operation state continuation time is an item representing the time during which the process operation state continues without changing. For example, when the process operation state changes from “Waiting for execution” to “Now executing” and 1 sec has passed while “In execution”, the operation state duration is 1 sec.
他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数は、上述した他発的コンテキストスイッチおよび自発的コンテキストスイッチが、プロセス動作状態が変化しない状態で何回発生したかを累計したものである。したがって、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数は、プロセス動作状態が変化した場合にはリセットされ、あらたに累計が開始される。なお、これらの回数をリセットせずに、プロセス動作状態が変化した時点の回数との差分をとることとしてもよい。 The number of spontaneous context switches and the number of spontaneous context switches are the cumulative number of times that the above-mentioned spontaneous context switch and spontaneous context switch occur in a state where the process operation state does not change. Therefore, the number of spontaneous context switches and the number of spontaneous context switches are reset when the process operation state changes, and a new accumulation is started. In addition, it is good also as taking the difference with the frequency | count at the time of a process operation state changing, without resetting these frequency | counts.
次に、プロセスの動作情報20bのデータ例について図8を用いて説明する。図8は、動作情報のデータの一例を示す図である。同図の51に示したデータは、プロセスIDが200のプロセスを親として、プロセスIDが204、210および230の子プロセスが生成されている状態を示したものである。この状態において、プロセスIDが200のプロセスが終了した場合には、動作情報20bは同図の52に示したようになる。このように、プロセスが終了した場合であっても、プロセスIDと親プロセスIDは消去されることなく残るため、プロセスIDおよび親プロセスIDを用いてプロセスツリーをたどることができる。したがって、監視対象アプリに属するプロセスを継続して監視することができる。
Next, a data example of the
図4の説明に戻り、動作異常判定部10cについて説明する。動作異常判定部10cは、動作情報取得部10bが動作情報提供処理部15から取得した動作情報20bと、監視対象データ20aとを用いて監視対象アプリの動作異常を判定する処理をおこなう処理部である。
Returning to the description of FIG. 4, the operation
具体的には、この動作異常判定部10cは、図5に示したアプリ名とメインプロセスIDとを含む監視対象データ20aと、図6に示したプロセスIDと親プロセスIDとを含む動作情報20bとを関連付けることによりプロセスがどの監視対象アプリに属するかを把握する。そして、各プロセスのプロセス状態、動作状態継続時間、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数を用いてかかるプロセスに動作異常が発生しているか否かを判定する。
Specifically, the operation
たとえば、図2に示したように、無限ループによる動作異常の場合には、プロセス状態が実行中であり、他発的コンテキストスイッチ回数は増加しているものの自発的コンテキストスイッチ回数が変化していない状態となる。すなわち、オペレーティングシステムのスケジューリングによりコンテキストスイッチが引き起こされているもののプロセスの処理は完了していないので、自発的にはコンテキストスイッチを引き起こしていない状態が継続していることをあらわしている。したがって、かかる状態が所定時間継続した場合には、無限ループによりCPUを占有している可能性が高いので動作異常であると判定する。 For example, as shown in FIG. 2, in the case of an abnormal operation due to an infinite loop, the process state is being executed and the number of spontaneous context switches has increased, but the number of spontaneous context switches has not changed. It becomes a state. That is, although the context switch is caused by the scheduling of the operating system, the processing of the process is not completed, so that the state that does not cause the context switch spontaneously continues. Therefore, when such a state continues for a predetermined time, it is highly likely that the CPU is occupied by an infinite loop, so that it is determined that the operation is abnormal.
また、CPU待ちによる動作異常の場合には、プロセス状態が実行中であり、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数のいずれもが変化しない状態となる。かかる状態が所定時間継続した場合には、他のプロセスによりプロセスの実行が阻害されている可能性が高いのでCPU待ちによる動作異常であると判定する。 In the case of an abnormal operation due to waiting for the CPU, the process state is being executed, and neither the number of spontaneous context switches nor the number of spontaneous context switches changes. If this state continues for a predetermined time, it is highly likely that the execution of the process is hindered by another process, so it is determined that the operation is abnormal due to the CPU waiting.
また、I/O待ちによる動作異常の場合には、プロセスが待機中であり、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数のいずれもが変化しない状態となる。かかる状態が所定時間継続した場合には、他のプロセスとのリソースの競合などによりプロセスのI/O処理が阻害されている可能性が高いのでI/O待ちによる動作異常であると判定する。 In the case of an abnormal operation due to waiting for I / O, the process is waiting, and neither the number of spontaneous context switches nor the number of spontaneous context switches changes. If such a state continues for a predetermined time, it is highly likely that the I / O processing of the process is hindered due to resource contention with another process, and so it is determined that the operation is abnormal due to I / O waiting.
なお、動作異常判定部10cは、上述した各プロセスのプロセス状態、動作状態継続時間、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数に加え、他のプロセス情報を用いて判定処理をおこなうことができる。たとえば、プロセスのスケジューリングポリシー、スケジューリングの優先度を含んだスケジューリングパラメータ、消費したCPU割り当て時間をあらわすティックカウンタ値、プロセスの実行時間などを用いることにより、動作異常判定の精度を向上させることが可能となる。
The operation
たとえば、無限ループ動作異常と判定するような場合であっても、プロセスのスケジューリング優先度が高ければ、無限ループに陥っているのではなく単に正常処理をつづけていることがある。このような場合に、プロセスのスケジューリング優先度を加味して動作異常継続時間の閾値を設定することにより、無限ループの動作異常判定の精度を向上させることができる。 For example, even when it is determined that the infinite loop operation is abnormal, if the scheduling priority of the process is high, the normal processing may be continued instead of falling into the infinite loop. In such a case, it is possible to improve the accuracy of the operation abnormality determination of the infinite loop by setting the threshold value of the operation abnormality duration in consideration of the scheduling priority of the process.
動作異常時処理部10dは、動作異常判定部10cが動作異常であると判定した場合に、該当する監視対象アプリの終了処理や、エラー表示処理などをおこなう処理部である。また、動作情報提供処理部15は、プロセスディスクリプタごとにオペレーティングシステム内に作成されるプロセス情報を収集して動作情報20bとして記憶部20に書き込むととともに、監視プログラムの動作情報取得部10bの求めに応じてかかる動作情報20bを提供する処理をおこなう処理部である。
The abnormal operation processing unit 10d is a processing unit that performs termination processing of the corresponding monitoring target application, error display processing, and the like when the abnormal
動作情報提供部15aは、動作情報取得部10bから動作情報取得要求を受け付けると記憶部20から動作情報20bを読み出して動作情報取得部10bに渡す処理をおこなう処理部である。また、動作情報管理部15bは、オペレーティングシステム内に作成されるプロセス情報を収集し、収集したプロセス情報を動作情報20bとして記憶部20に書き込む処理をおこなう処理部である。
The motion information providing unit 15a is a processing unit that performs a process of reading the
記憶部20は、RAM(Random Access Memory)などのメモリから構成され、監視対象データ20aおよび動作情報20bを記憶する記憶部である。監視対象データ20aは、アプリケーション起動部10aにより記憶部20に書き込まれ、動作異常判定部10cにより読み出されるデータである。なお、監視対象データ20aは、図5を用いてすでに説明したように、アプリ名およびメインプロセスIDを含んだデータである。
The
また、動作情報20bは、動作情報管理部15bにより記憶部20に書き込まれ、動作情報提供部15aにより読み出されるプロセス情報である。なお、動作情報20bは、図6を用いてすでに説明したように、プロセスID、親プロセスID、動作状態継続時間、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数を含んだプロセス情報である。
The
次に、上述した監視プログラムが監視対象アプリの動作異常を検出する場合の処理手順について図9〜図11を用いて説明する。図9は、無限ループによる動作異常を検出する場合における処理手順を示すフローチャートである。 Next, a processing procedure when the above-described monitoring program detects an abnormal operation of the monitoring target application will be described with reference to FIGS. FIG. 9 is a flowchart showing a processing procedure in the case of detecting an operation abnormality due to an infinite loop.
図9に示すように、まず、動作異常判定部10cが動作情報取得部10bから動作情報20bを受け取ると(ステップS101)、動作情報20bのプロセス動作状態および動作状態継続時間を参照し、所定時間継続してプロセス動作状態が「実行中」であるか否かを判定する(ステップS102)。そして、所定時間継続して「実行中」ではない場合には(ステップS102否定)、無限ループによる動作異常はないと判定して(ステップS105)処理を終了する。
As shown in FIG. 9, first, when the operation
つづいて、所定時間継続して「実行中」である場合には(ステップS102肯定)、取得した動作情報20bの自発的コンテキストスイッチ回数を参照し、自発的コンテキストスイッチ回数に変化があるか否かを判定する(ステップS103)。そして、自発的コンテキストスイッチ回数に変化がある場合には(ステップS103否定)、無限ループによる動作異常はないと判定して(ステップS105)処理を終了する。
Subsequently, when “execution” continues for a predetermined time (Yes in step S102), the number of spontaneous context switches is referred to by referring to the number of spontaneous context switches in the acquired
つづいて、自発的コンテキストスイッチ回数に変化がない場合には(ステップS103肯定)、取得した動作情報20bの他発的コンテキストスイッチ回数を参照し、他発的コンテキストスイッチ回数に変化があるか否かを判定する(ステップS104)。そして、他発的コンテキストスイッチに変化がない場合には(ステップS104肯定)、無限ループによる動作異常はないと判定して(ステップS105)処理を終了する。一方、他発的コンテキストスイッチ回数に変化がある場合には(ステップS104否定)、無限ループによる動作異常があると判定して(ステップS106)処理を終了する。
Subsequently, when there is no change in the number of voluntary context switches (Yes in step S103), the number of other context switches in the acquired
次に、監視プログラムがCPU待ちによる動作異常を検出する場合の処理手順について図10を用いて説明する。図10は、CPU待ちによる動作異常を検出する場合における処理手順を示すフローチャートである。 Next, a processing procedure when the monitoring program detects an operation abnormality caused by waiting for the CPU will be described with reference to FIG. FIG. 10 is a flowchart showing a processing procedure in the case of detecting an operation abnormality caused by waiting for the CPU.
図10に示すように、まず、動作異常判定部10cが動作情報取得部10bから動作情報20bを受け取ると(ステップS201)、動作情報20bのプロセス動作状態および動作状態継続時間を参照し、所定時間継続してプロセス動作状態が「実行中」であるか否かを判定する(ステップS202)。そして、所定時間継続して「実行中」ではない場合には(ステップS202否定)、CPU待ちによる動作異常はないと判定して(ステップS206)処理を終了する。
As shown in FIG. 10, first, when the operation
つづいて、所定時間継続して「実行中」である場合には(ステップS202肯定)、取得した動作情報20bの自発的コンテキストスイッチ回数を参照し、自発的コンテキストスイッチ回数に変化があるか否かを判定する(ステップS203)。そして、自発的コンテキストスイッチ回数に変化がある場合には(ステップS203否定)、CPU待ちによる動作異常はないと判定して(ステップS206)処理を終了する。
Subsequently, when “execution” continues for a predetermined time (Yes at step S202), the number of spontaneous context switches is referred to by referring to the number of spontaneous context switches in the acquired
つづいて自発的コンテキストスイッチ回数に変化がない場合には(ステップS203肯定)、取得した動作情報20bの他発的コンテキストスイッチ回数を参照し、他発的コンテキストスイッチ回数に変化があるか否かを判定する(ステップS204)。そして、他発的コンテキストスイッチに変化がある場合には(ステップS204否定)、CPU待ちによる動作異常はないと判定して(ステップS206)処理を終了する。一方、他発的コンテキストスイッチ回数に変化がない場合には(ステップS204肯定)、CPU待ちによる動作異常があると判定して(ステップS205)処理を終了する。
Subsequently, when there is no change in the number of spontaneous context switches (Yes at Step S203), the number of other context switches in the acquired
次に、監視プログラムがI/O待ちによる動作異常を検出する場合の処理手順について図11を用いて説明する。図11は、I/O待ちによる動作異常を検出する場合における処理手順を示すフローチャートである。 Next, a processing procedure when the monitoring program detects an operation abnormality due to I / O waiting will be described with reference to FIG. FIG. 11 is a flowchart showing a processing procedure in the case of detecting an operation abnormality due to waiting for I / O.
図11に示すように、まず、動作異常判定部10cが動作情報取得部10bから動作情報20bを受け取ると(ステップS301)、動作情報20bのプロセス動作状態および動作状態継続時間を参照し、所定時間継続してプロセス動作状態が「待機中(実行待ち)」であるか否かを判定する(ステップS302)。そして、所定時間継続して「待機中」ではない場合には(ステップS302否定)、I/O待ちによる動作異常はないと判定して(ステップS306)処理を終了する。
As shown in FIG. 11, first, when the operation
つづいて、所定時間継続して「待機中」である場合には(ステップS302肯定)、取得した動作情報20bの自発的コンテキストスイッチ回数を参照し、自発的コンテキストスイッチ回数に変化があるか否かを判定する(ステップS303)。そして、自発的コンテキストスイッチ回数に変化がある場合には(ステップS303否定)、I/O待ちによる動作異常はないと判定して(ステップS306)処理を終了する。
Subsequently, when “waiting” continues for a predetermined time (Yes in step S302), the number of spontaneous context switches in the acquired
つづいて、自発的コンテキストスイッチ回数に変化がない場合には(ステップS303肯定)、取得した動作情報20bの他発的コンテキストスイッチ回数を参照し、他発的コンテキストスイッチ回数に変化があるか否かを判定する(ステップS304)。そして、他発的コンテキストスイッチに変化がある場合には(ステップS304否定)、I/O待ちによる動作異常はないと判定して(ステップS306)処理を終了する。一方、他発的コンテキストスイッチ回数に変化がない場合には(ステップS304肯定)、CPU待ちによる動作異常があると判定して(ステップS305)処理を終了する。
Subsequently, when there is no change in the number of voluntary context switches (Yes in step S303), the number of other context switches in the acquired
上述してきたように、本実施例に係る異常検出処理では、動作情報提供部がオペレーティングシステム上で動作するプロセスの動作情報を収集して監視処理部に提供し、監視処理部の動作異常判定部は、動作情報提供部により提供された動作情報に含まれるプロセス動作状態、動作状態継続時間、他発的コンテキストスイッチ回数および自発的コンテキストスイッチ回数に基づいて監視対象のアプリケーションプログラムに属するプロセスの動作異常を判定するよう構成したので、監視対象となるアプリケーションプログラムの改修をおこなうことなく、かかるアプリケーションプログラムの動作異常を効率的に検出することができる。 As described above, in the abnormality detection processing according to the present embodiment, the operation information providing unit collects operation information of a process operating on the operating system and provides it to the monitoring processing unit, and the operation abnormality determining unit of the monitoring processing unit Is an abnormal operation of a process belonging to an application program to be monitored based on the process operation state, the operation state duration, the number of spontaneous context switches, and the number of spontaneous context switches included in the operation information provided by the operation information providing unit. Therefore, it is possible to efficiently detect an abnormal operation of the application program without modifying the application program to be monitored.
以上のように、本発明にかかる異常検出プログラムおよび異常検出方法は、アプリケーションプログラムの動作異常検出に有用であり、特に、市販アプリケーションなどの改修をおこなうことができないアプリケーションプログラムの動作異常検出に適している。 As described above, the abnormality detection program and the abnormality detection method according to the present invention are useful for detecting an operation abnormality of an application program, and are particularly suitable for detecting an operation abnormality of an application program that cannot be modified such as a commercial application. Yes.
1 データ提供装置
10 監視処理部
10a アプリケーション起動部
10b 動作情報取得部
10c 動作異常判定部
10d 動作異常時処理部
15 動作情報提供処理部
15a 動作情報提供部
15b 動作情報管理部
20 記憶部
20a 監視対象データ
20b 動作情報
51、52 動作情報例
100 監視プロセス
101 親プロセス
102 子プロセス
200 動作情報提供部
DESCRIPTION OF
Claims (15)
前記アプリケーションプログラムに属するプロセスの動作情報を前記オペレーティングシステムから取得する取得手順と、
前記動作情報取得手順が取得した前記動作情報に基づいて前記アプリケーションプログラムの動作異常を判定する判定手順とを
コンピュータに実行させることを特徴とする異常検出プログラム。 An abnormality detection program for detecting an operation abnormality of an application program operating on an operating system,
An acquisition procedure for acquiring operation information of a process belonging to the application program from the operating system;
An abnormality detection program that causes a computer to execute a determination procedure for determining an operation abnormality of the application program based on the operation information acquired by the operation information acquisition procedure.
前記アプリケーションプログラムに属するプロセスの動作情報を前記オペレーティングシステムから取得する取得工程と、
前記動作情報取得工程が取得した前記動作情報に基づいて前記アプリケーションプログラムの動作異常を判定する判定工程とを
含んだことを特徴とする異常検出方法。 An abnormality detection method for detecting an operation abnormality of an application program operating on an operating system,
An acquisition step of acquiring operation information of a process belonging to the application program from the operating system;
A determination step of determining an operation abnormality of the application program based on the operation information acquired by the operation information acquisition step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005092780A JP4562568B2 (en) | 2005-03-28 | 2005-03-28 | Abnormality detection program and abnormality detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005092780A JP4562568B2 (en) | 2005-03-28 | 2005-03-28 | Abnormality detection program and abnormality detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006277115A true JP2006277115A (en) | 2006-10-12 |
JP4562568B2 JP4562568B2 (en) | 2010-10-13 |
Family
ID=37211842
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005092780A Expired - Fee Related JP4562568B2 (en) | 2005-03-28 | 2005-03-28 | Abnormality detection program and abnormality detection method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4562568B2 (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009134695A (en) * | 2007-11-07 | 2009-06-18 | Ricoh Co Ltd | Information processor, image processor, application execution method and application execution program |
WO2009104344A1 (en) * | 2008-02-22 | 2009-08-27 | 日本電気株式会社 | Information technology (it) system behavior measurement and analysis system and method therefor |
JP2010211574A (en) * | 2009-03-11 | 2010-09-24 | Nec Corp | Information processing system, monitoring method, and monitoring program |
JP2011175570A (en) * | 2010-02-25 | 2011-09-08 | Hitachi Ltd | Computer, method for detecting fault in computer, and program |
US8438567B2 (en) | 2007-11-07 | 2013-05-07 | Ricoh Company, Ltd. | Information processing device and image processing apparatus |
JP2013533553A (en) * | 2010-09-07 | 2013-08-22 | ヒョンダイ モーター カンパニー | System test method |
US9354996B2 (en) | 2010-06-28 | 2016-05-31 | Hyundai Motor Company | System test apparatus |
EP3176700A1 (en) | 2015-12-01 | 2017-06-07 | Fujitsu Limited | Information processing device and information processing method |
US9753808B2 (en) | 2012-12-06 | 2017-09-05 | Denso Corporation | Data processing device having resetting feature without interfering with user interface unit |
US9958846B2 (en) | 2013-03-08 | 2018-05-01 | Denso Corporation | Data processing device |
CN110825593A (en) * | 2019-11-11 | 2020-02-21 | 腾讯科技(深圳)有限公司 | Method, device and equipment for detecting abnormal state of process and storage medium |
CN113835961A (en) * | 2021-09-23 | 2021-12-24 | 中国联合网络通信集团有限公司 | Alarm information monitoring method, device, server and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05233333A (en) * | 1992-02-21 | 1993-09-10 | Fujitsu Ltd | Task start-up state detecting system |
JPH086813A (en) * | 1994-06-23 | 1996-01-12 | Hitachi Ltd | Trace control system |
JPH09179754A (en) * | 1995-12-21 | 1997-07-11 | Mitsubishi Electric Corp | Task monitoring device and its method |
JPH10198583A (en) * | 1997-01-10 | 1998-07-31 | Nec Corp | Detection/processing system/method for idle running process |
JPH10214208A (en) * | 1997-01-31 | 1998-08-11 | Meidensha Corp | System for monitoring abnormality of software |
JPH10269110A (en) * | 1997-03-26 | 1998-10-09 | Toshiba Corp | Method for avoiding hang-up of computer system, and computer system using the same method |
JPH11232143A (en) * | 1998-02-18 | 1999-08-27 | Oki Electric Ind Co Ltd | Multithread monitor method |
JP2000181755A (en) * | 1998-12-17 | 2000-06-30 | Fuji Xerox Co Ltd | Method and device for abnormality detection, multitask system, and recording medium |
-
2005
- 2005-03-28 JP JP2005092780A patent/JP4562568B2/en not_active Expired - Fee Related
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05233333A (en) * | 1992-02-21 | 1993-09-10 | Fujitsu Ltd | Task start-up state detecting system |
JPH086813A (en) * | 1994-06-23 | 1996-01-12 | Hitachi Ltd | Trace control system |
JPH09179754A (en) * | 1995-12-21 | 1997-07-11 | Mitsubishi Electric Corp | Task monitoring device and its method |
JPH10198583A (en) * | 1997-01-10 | 1998-07-31 | Nec Corp | Detection/processing system/method for idle running process |
JPH10214208A (en) * | 1997-01-31 | 1998-08-11 | Meidensha Corp | System for monitoring abnormality of software |
JPH10269110A (en) * | 1997-03-26 | 1998-10-09 | Toshiba Corp | Method for avoiding hang-up of computer system, and computer system using the same method |
JPH11232143A (en) * | 1998-02-18 | 1999-08-27 | Oki Electric Ind Co Ltd | Multithread monitor method |
JP2000181755A (en) * | 1998-12-17 | 2000-06-30 | Fuji Xerox Co Ltd | Method and device for abnormality detection, multitask system, and recording medium |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8438567B2 (en) | 2007-11-07 | 2013-05-07 | Ricoh Company, Ltd. | Information processing device and image processing apparatus |
JP2009134695A (en) * | 2007-11-07 | 2009-06-18 | Ricoh Co Ltd | Information processor, image processor, application execution method and application execution program |
WO2009104344A1 (en) * | 2008-02-22 | 2009-08-27 | 日本電気株式会社 | Information technology (it) system behavior measurement and analysis system and method therefor |
US8495652B2 (en) | 2008-02-22 | 2013-07-23 | Nec Corporation | IT system behavior measurement and analysis system and method thereof |
JP2010211574A (en) * | 2009-03-11 | 2010-09-24 | Nec Corp | Information processing system, monitoring method, and monitoring program |
JP2011175570A (en) * | 2010-02-25 | 2011-09-08 | Hitachi Ltd | Computer, method for detecting fault in computer, and program |
US9354996B2 (en) | 2010-06-28 | 2016-05-31 | Hyundai Motor Company | System test apparatus |
JP2013533553A (en) * | 2010-09-07 | 2013-08-22 | ヒョンダイ モーター カンパニー | System test method |
US9753808B2 (en) | 2012-12-06 | 2017-09-05 | Denso Corporation | Data processing device having resetting feature without interfering with user interface unit |
US9958846B2 (en) | 2013-03-08 | 2018-05-01 | Denso Corporation | Data processing device |
EP3176700A1 (en) | 2015-12-01 | 2017-06-07 | Fujitsu Limited | Information processing device and information processing method |
US10339028B2 (en) | 2015-12-01 | 2019-07-02 | Fujitsu Limited | Log storage via application priority level |
CN110825593A (en) * | 2019-11-11 | 2020-02-21 | 腾讯科技(深圳)有限公司 | Method, device and equipment for detecting abnormal state of process and storage medium |
CN113835961A (en) * | 2021-09-23 | 2021-12-24 | 中国联合网络通信集团有限公司 | Alarm information monitoring method, device, server and storage medium |
CN113835961B (en) * | 2021-09-23 | 2023-05-16 | 中国联合网络通信集团有限公司 | Alarm information monitoring method, device, server and storage medium |
Also Published As
Publication number | Publication date |
---|---|
JP4562568B2 (en) | 2010-10-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4562568B2 (en) | Abnormality detection program and abnormality detection method | |
US5872909A (en) | Logic analyzer for software | |
US8286139B2 (en) | Call stack sampling for threads having latencies exceeding a threshold | |
US8949671B2 (en) | Fault detection, diagnosis, and prevention for complex computing systems | |
CN106681811B (en) | Multithreading scheduling method and device based on thread pool | |
US8132170B2 (en) | Call stack sampling in a data processing system | |
US20100017583A1 (en) | Call Stack Sampling for a Multi-Processor System | |
US7383470B2 (en) | Method, system, and apparatus for identifying unresponsive portions of a computer program | |
US8286134B2 (en) | Call stack sampling for a multi-processor system | |
US7958402B2 (en) | Generate diagnostic data for overdue thread in a data processing system | |
JP5648187B2 (en) | Computer system and monitoring method | |
KR20130031860A (en) | System testing method | |
US20120180057A1 (en) | Activity Recording System for a Concurrent Software Environment | |
WO2012095762A1 (en) | Activity recording system for a concurrent software environment | |
US8332069B2 (en) | Fault tolerance method and apparatus for robot software component | |
JP5623557B2 (en) | Method, apparatus, and computer program in a multi-threaded computing environment for collecting diagnostic data | |
JP4992740B2 (en) | Multiprocessor system, failure detection method, and failure detection program | |
WO2009123343A1 (en) | Contention analysis device, contention analysis method, and program | |
CN112035839A (en) | Detection method and device for race condition vulnerability exploitation | |
CN102549510B (en) | Method for testing the real-time capability of an operating system | |
JP5365273B2 (en) | Information processing system, monitoring method, and monitoring program | |
JPH0245838A (en) | Program execution condition monitoring method | |
JPH09179754A (en) | Task monitoring device and its method | |
WO2009147738A1 (en) | Information processor, its control method and monitor program | |
JP2005182594A (en) | Computer and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080222 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091029 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100511 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100706 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20100727 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100727 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130806 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140806 Year of fee payment: 4 |
|
LAPS | Cancellation because of no payment of annual fees |