JP2014206807A - Software inspection method and program - Google Patents

Software inspection method and program Download PDF

Info

Publication number
JP2014206807A
JP2014206807A JP2013082833A JP2013082833A JP2014206807A JP 2014206807 A JP2014206807 A JP 2014206807A JP 2013082833 A JP2013082833 A JP 2013082833A JP 2013082833 A JP2013082833 A JP 2013082833A JP 2014206807 A JP2014206807 A JP 2014206807A
Authority
JP
Japan
Prior art keywords
software
memory
dynamic
inspected
tracker
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.)
Pending
Application number
JP2013082833A
Other languages
Japanese (ja)
Inventor
仁 三嶽
Hitoshi Mitake
仁 三嶽
森田 和孝
Kazutaka Morita
和孝 森田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2013082833A priority Critical patent/JP2014206807A/en
Publication of JP2014206807A publication Critical patent/JP2014206807A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To inspect software targeting a state of a memory, a child process or a thread by a process when the software is executed.SOLUTION: A software inspection method of an inspection device that inspects software using a scenario in which a predetermined state of a process and a corresponding operation when the software is executed are described includes: a monitoring step in which a dynamic tracker of the inspection device monitors a memory, a child process, or a thread by a process to be inspected; an instruction step in which an inspection unit of the inspection device instructs the dynamic tracker to operate based upon the information on the memory, child process, or thread monitored by the dynamic tracker and the scenario; and a control step in which the dynamic tracker controls the process to be inspected as instructed by the inspection unit.

Description

本発明は、ソフトウェア検査方法及びプログラムに関する。特に、本発明は、複数のプロセスが複数のマシンで実行される分散システム環境においても、複数のプロセスの内部の状態に基づくテストやデバッグの実行を可能とするソフトウェア検査技術に関する。   The present invention relates to a software inspection method and program. In particular, the present invention relates to a software inspection technique that enables execution of tests and debugs based on internal states of a plurality of processes even in a distributed system environment in which a plurality of processes are executed on a plurality of machines.

複雑なプロトコルを実装した分散システムをデバッグする場合、その分散システムの形式的なモデルをモデル記述言語を用いて作成し、モデル検査器を利用してプロトコルが要求される性質を満たすか検査するという方法が広く採用されている(非特許文献1参照)。   When debugging a distributed system that implements a complex protocol, a formal model of the distributed system is created using a model description language, and a model checker is used to check whether the protocol satisfies the required properties. The method is widely adopted (see Non-Patent Document 1).

この方法では、分散システムの各ノードの状態遷移を形式的に記述した状態遷移機械のモデルを作成し、それらの分散システム全体を状態遷移機械の直積として定義する。このように定義された状態遷移機械について、起こり得るすべての遷移を辿り、それぞれの状態について与えられた性質が満たされているかどうか検査することで、プロトコルにバグが含まれていないことを検査する。   In this method, a state transition machine model in which the state transition of each node of the distributed system is formally described is created, and the entire distributed system is defined as a direct product of the state transition machine. For a state machine defined in this way, it follows all possible transitions and checks that the protocol is free of bugs by checking that the given properties are satisfied for each state. .

上記の方法は網羅的な検査を行うために必要とされる時間的コストが比較的小さいという点では優れているが、作成したモデルと実装との乖離が無いことを機械的に確認する術がないという欠点を持つ。そのため、検査対象を実装そのものとするモデル検査技術も存在する(非特許文献2参照)。   The above method is excellent in that the time cost required for conducting a comprehensive inspection is relatively small, but there is a technique for mechanically confirming that there is no discrepancy between the created model and the implementation. Has the disadvantage of not. For this reason, there is a model checking technique in which the inspection target is the mounting itself (see Non-Patent Document 2).

非特許文献2で紹介されている技術はWindows(登録商標)上で動作するアプリケーションを対象としており、Win32 APIの呼び出しを契機として検査器に状態の更新を通知する。検査器は状態の更新の通知を受け取ると、Win32 APIの呼び出しを失敗させるかどうかを判断し、検査対象のプロセスに指示を送る。   The technique introduced in Non-Patent Document 2 is intended for applications that run on Windows (registered trademark), and notifies the tester of state updates when the Win32 API is called. Upon receiving the status update notification, the tester determines whether or not to fail the Win32 API call and sends an instruction to the process to be tested.

Gerard J. Holzmann. The Model Checker SPIN. Journal: IEEE Transactions on Software Engineering, vol. 23, no. 5, pp. 279-295, 1997.Gerard J. Holzmann. The Model Checker SPIN. Journal: IEEE Transactions on Software Engineering, vol. 23, no. 5, pp. 279-295, 1997. Junfeng Yang, Tisheng Chen, Ming Wu, Zhilei Xu, Xuezheng Liu, Haoxiang Lin, Mao Yang, Fan Long, Lintao Zhang, Lidong Zhou. MODIST: Transparent Model Checking of Unmodified Distributed Systems. In proceedings of the Networked Systems Design and Implementation - NSDI , pp. 213-228, 2009.Junfeng Yang, Tisheng Chen, Ming Wu, Zhilei Xu, Xuezheng Liu, Haoxiang Lin, Mao Yang, Fan Long, Lintao Zhang, Lidong Zhou.MODIST: Transparent Model Checking of Unmodified Distributed Systems.In proceedings of the Networked Systems Design and Implementation- NSDI, pp. 213-228, 2009.

非特許文献2で紹介されている技術は、実装を検査対象として網羅的な検査を行うことを可能にしているが、検査器に状態の更新を通知するタイミングがOS(Operating System)のシステムコール呼び出しに限定されている。そのため、プロセスのメモリ内の状態の変化を契機としてフォールトインジェクションを行うことが出来ないという課題を持っている。   The technology introduced in Non-Patent Document 2 makes it possible to perform a comprehensive inspection with the implementation as the inspection target, but the OS (Operating System) system call is issued when the status update is notified to the tester. Limited to calls. For this reason, there is a problem that fault injection cannot be performed in response to a change in the state of the process memory.

本発明は、ソフトウェアが実行されたときのプロセスによるメモリ、子プロセス又はスレッドの状態を対象として、ソフトウェアを検査することを目的とする。   An object of the present invention is to inspect software for a state of a memory, a child process, or a thread by a process when the software is executed.

本発明の一形態に係るソフトウェア検査方法は、
ソフトウェアが実行されたときのプロセスにおける所定の状態及び対応する動作を記述したシナリオを用いてソフトウェアを検査する検査装置におけるソフトウェア検査方法であって、
前記検査装置の動的追跡器が、検査対象のプロセスによるメモリ、子プロセス又はスレッドを監視する監視ステップと、
前記検査装置の検査器が、前記動的追跡器により監視されたメモリ、子プロセス又はスレッドの情報とシナリオとに基づき、前記動的追跡器に対して動作を指示する指示ステップと、
前記動的追跡器が、前記検査器からの指示に基づいて、検査対象のプロセスを制御する制御ステップと、
を有することを特徴とする。
A software inspection method according to an aspect of the present invention includes:
A software inspection method in an inspection apparatus for inspecting software using a scenario describing a predetermined state and a corresponding operation in a process when software is executed,
A monitoring step in which a dynamic tracker of the inspection device monitors a memory, a child process or a thread by a process to be inspected;
An instructing step for instructing the dynamic tracker to perform an operation based on memory and child process or thread information and scenarios monitored by the dynamic tracker;
A control step in which the dynamic tracker controls a process to be inspected based on an instruction from the inspector;
It is characterized by having.

また、本発明の一形態に係るプログラムは、
ソフトウェアが実行されたときのプロセスにおける所定の状態及び対応する動作を記述したシナリオを用いてソフトウェアを検査する検査装置として、コンピュータを機能させるためのプログラムであって、当該コンピュータを
検査対象のプロセスによるメモリ、子プロセス又はスレッドを監視する動的追跡手段、及び
前記動的追跡手段により監視されたメモリ、子プロセス又はスレッドの情報とシナリオとに基づき、前記動的追跡手段に対して動作を指示する検査手段、
として機能させ、
前記動的追跡手段は、前記検査手段からの指示に基づいて、検査対象のプロセスを制御することを特徴とする。
A program according to an aspect of the present invention is
A program that causes a computer to function as an inspection device that inspects software using a scenario that describes a predetermined state and a corresponding operation in the process when the software is executed. The computer depends on the process to be inspected. Dynamic tracking means for monitoring a memory, a child process or a thread, and instructing the dynamic tracking means to perform an operation based on information and a scenario of the memory, child process or thread monitored by the dynamic tracking means. Inspection means,
Function as
The dynamic tracking unit controls a process to be inspected based on an instruction from the inspection unit.

本発明の実施例によれば、ソフトウェアが実行されたときのプロセスによるメモリ、子プロセス又はスレッドの状態を対象として、ソフトウェアを検査することが可能になる。   According to the embodiment of the present invention, it is possible to inspect the software for the state of a memory, a child process, or a thread by a process when the software is executed.

本発明の実施例に係るソフトウェア検査装置のブロック図The block diagram of the software inspection apparatus which concerns on the Example of this invention. 本発明の実施例に係るソフトウェア検査装置内の動的追跡器のフローチャートThe flowchart of the dynamic tracker in the software test | inspection apparatus based on the Example of this invention. 本発明の実施例に係るソフトウェア検査装置内の検査器のフローチャートThe flowchart of the test | inspector in the software test | inspection apparatus based on the Example of this invention. 本発明の実施例に係るソフトウェア検査装置において複数のプロセスを検査するときの例Example when inspecting a plurality of processes in a software inspection apparatus according to an embodiment of the present invention

以下、本発明の実施例について詳細に説明する。   Examples of the present invention will be described in detail below.

本発明の実施例では、ソフトウェアが実行されたときのプロセスにおける所定の状態及び対応する動作を記述したシナリオを用いてソフトウェアを検査するソフトウェア検査装置について説明する。典型的には、ソフトウェア検査装置は、記憶装置にロードされたプログラムに従ってデータを処理するコンピュータである。   In the embodiment of the present invention, a software inspection apparatus that inspects software using a scenario describing a predetermined state and a corresponding operation in a process when the software is executed will be described. Typically, a software inspection device is a computer that processes data according to a program loaded in a storage device.

図1に、本発明の実施例に係るソフトウェア検査装置のブロック図を示す。ソフトウェア検査装置は、シナリオ記憶部101と、動的追跡器103と、検査器105とを有する。   FIG. 1 shows a block diagram of a software inspection apparatus according to an embodiment of the present invention. The software inspection device includes a scenario storage unit 101, a dynamic tracker 103, and an inspection device 105.

シナリオ記憶部101は、メモリ上における変数のアドレス情報を格納するシンボルテーブルと、ソフトウェアが実行されたときのプロセスにおける所定の状態及び対応する動作を記述したシナリオとを記憶する記憶装置である。シンボルテーブルは、検査対象のプロセスのグローバル変数が割り当てられているメモリ上のアドレス情報と、実行時に確保されるメモリ上のアドレス情報とを定義したテーブルである。これらのアドレス情報は、例えばDWARFと呼ばれるデバッグ用フォーマットから取得される。シナリオは、ユーザにより記述された検査器105に与える動作の組み合わせである。例えば、シナリオにより記述される動作には、プロセスが特定の状態になった場合、フォールトインジェクション又はアサーションの確認のような動作を行わせることが含まれる。   The scenario storage unit 101 is a storage device that stores a symbol table that stores address information of variables in a memory and a scenario that describes a predetermined state and a corresponding operation in a process when software is executed. The symbol table is a table that defines address information on a memory to which global variables of a process to be inspected are assigned and address information on a memory secured at the time of execution. Such address information is acquired from, for example, a debugging format called DWARF. The scenario is a combination of operations given to the inspector 105 described by the user. For example, the operation described by the scenario includes causing an operation such as fault injection or confirmation of assertion to be performed when the process enters a specific state.

動的追跡器103は、検査対象のプロセスによるメモリ、子プロセス又はスレッドを監視する。例えば、動的追跡器103は、(1)メモリ上の状態の変化、(2)メモリの確保と開放、(3)子プロセス又はスレッドの作成と終了のうちいずれかに該当する変化が発生した場合に、検査器105に通知する。   The dynamic tracker 103 monitors a memory, a child process, or a thread by a process to be inspected. For example, in the dynamic tracker 103, a change corresponding to one of (1) a change in the state of the memory, (2) allocation and release of the memory, and (3) creation and termination of the child process or thread has occurred. In this case, the tester 105 is notified.

検査器105は、動的追跡器103により監視されたメモリ、子プロセス又はスレッドの情報とシナリオとに基づき、動的追跡器103に対して動作を指示する。例えば、検査器105は、動的追跡器103から通知されたメモリ、子プロセス又はスレッドの情報がシナリオに記述された所定の状態を満たす場合、動的追跡器103に対してフォールトインジェクション又はアサーションの確認のような動作を指示する。動的追跡器103は、検査器105からの指示に基づいて、検査対象のプロセスを制御する。   The tester 105 instructs the dynamic tracker 103 to operate based on the memory, child process or thread information monitored by the dynamic tracker 103 and the scenario. For example, when the memory, child process, or thread information notified from the dynamic tracker 103 satisfies a predetermined state described in the scenario, the tester 105 performs fault injection or assertion on the dynamic tracker 103. Instruct the operation like confirmation. The dynamic tracker 103 controls a process to be inspected based on an instruction from the inspector 105.

以下に、ソフトウェア検査装置の動作の詳細について説明する。   Details of the operation of the software inspection apparatus will be described below.

<動的追跡器の動作>
図2に、本発明の実施例に係るソフトウェア検査装置内の動的追跡器103のフローチャートを示す。
<Operation of dynamic tracker>
FIG. 2 shows a flowchart of the dynamic tracker 103 in the software inspection apparatus according to the embodiment of the present invention.

動的追跡器103は、検査対象のプロセスについて、以下のいずれかの事象が発生するまで、プログラムカウンタが指す命令を実行する(ステップS101)。そして、以下のいずれかの事象が発生した場合にその情報を検査器105に通知する。なお、以下の事象は、これらの事象が発生した場合にプログラムが中断されるため、トラップとも呼ばれる。事象の発生は、プログラムの動的追跡ツール(例:DynamoRIO)などを利用して捕捉される。   The dynamic tracker 103 executes an instruction indicated by the program counter until any of the following events occurs in the process to be inspected (step S101). Then, when any of the following events occurs, the information is notified to the tester 105. The following events are also called traps because the program is interrupted when these events occur. The occurrence of an event is captured using a program dynamic tracking tool (eg DynamoRIO).

動的追跡器103が捕捉する事象には、(1)メモリ上の状態の変化、(2)メモリの確保と開放、(3)子プロセス又はスレッドの作成と終了が存在する。   Events captured by the dynamic tracker 103 include (1) state change on the memory, (2) memory allocation and release, and (3) child process or thread creation and termination.

(1)メモリ上の状態の変化
本発明の実施例では、ソフトウェアの実装が取りうる状態を、そのソフトウェアが実行されたプロセスのグローバル変数として使用されるメモリ領域、及び実行時に確保されるメモリ領域の状態と定義する。動的追跡器103は、検査対象のプロセスのグローバル変数が割り当てられているページと、実行時に確保されるメモリを含むページの書き込みの権限を実行時に削除し、そのページへの書き込みが発生した場合にセグメンテーション違反を通知するシグナルハンドラが呼ばれるように設定する。なお、グローバル変数が割り当てられているページと、実行時に確保されるメモリを含むページとは、シナリオ記憶部101のシンボルテーブルに定義されたアドレス情報から取得される。
(1) Changes in the state on the memory In the embodiment of the present invention, the states that can be implemented by the software are defined as a memory region that is used as a global variable of a process in which the software is executed, and a memory region that is secured at the time of execution. It is defined as the state of. When the dynamic tracker 103 deletes the right to write the page including the global variable of the process to be inspected and the page including the memory allocated at the time of execution, and writing to the page occurs Is set to be called to signal the segmentation violation. The page to which the global variable is assigned and the page including the memory secured at the time of execution are acquired from the address information defined in the symbol table of the scenario storage unit 101.

動的追跡器103は、セグメンテーション違反が発生したか否かを判断し(ステップS103)、セグメンテーション違反が発生した場合(ステップS103:Yes)、メモリ上の状態の変化が生じたと判断する。検査対象のプロセスが書き込みを禁止したページにアクセスしていない場合(ステップS105:No)、動的追跡器103は、ソフトウェアのバグであると判断し、処理を終了する(ステップS107)。監視対象のプロセスが書き込みを禁止したページにアクセスしている場合(ステップS105:Yes)、動的追跡器103は、シグナルハンドラの内部で書き込みが試みられたメモリ上のアドレスと、書き込まれた値と、書き込まれた値のサイズとを、セグメンテーション違反を発生させたプログラムカウンタが指す命令をデコードすることで求める(ステップS109)。   The dynamic tracker 103 determines whether a segmentation violation has occurred (step S103). If a segmentation violation has occurred (step S103: Yes), the dynamic tracker 103 determines that a change in the state on the memory has occurred. When the process to be inspected does not access the page for which writing has been prohibited (step S105: No), the dynamic tracker 103 determines that the bug is a software bug and ends the process (step S107). When the process to be monitored is accessing a page for which writing is prohibited (step S105: Yes), the dynamic tracker 103 reads the address on the memory in which writing is attempted within the signal handler and the written value. And the size of the written value is obtained by decoding the instruction pointed to by the program counter that caused the segmentation violation (step S109).

動的追跡器103は、求められたメモリ上のアドレスと、書き込まれた値と、書き込まれた値のサイズとを後述のメッセージとして構成し、別のプロセスとして動作している検査器105に送信する(ステップS111)。検査器105は、送られてきた情報に基づいて、保持してあるシステム全体のプロセスの状態を更新する。検査器105は、後述するように、システム全体のプロセスの状態を基に、指示を表現する値を動的追跡器103に送り返すため、動的追跡器103は、検査器105から返信されるデータを待つ。   The dynamic tracker 103 configures the obtained address on the memory, the written value, and the size of the written value as a message to be described later, and transmits the message to the inspector 105 operating as another process. (Step S111). The tester 105 updates the state of the process of the entire system that is held based on the sent information. As will be described later, the tester 105 sends back a value representing an instruction to the dynamic tracker 103 based on the state of the process of the entire system, so that the dynamic tracker 103 returns data returned from the tester 105. Wait for.

ここで、検査器105に通知される具体的なメッセージの構成は以下の3つ組になる:
(ポインタ型:更新が行われたメモリ上のアドレス、整数型:書き込まれた値、整数型:書き込まれた値のバイト数)
(2)メモリの確保と開放
動的追跡器103は、ヒープ上に確保されたメモリの状態を追跡するため、ライブラリの提供するメモリの確保又は開放を行う関数と、それらが内部的に呼び出すシステムコールの呼び出しも検査器105に通知する必要がある。
Here, the specific message configuration notified to the inspector 105 includes the following three sets:
(Pointer type: address in memory where update was performed, integer type: written value, integer type: number of bytes of written value)
(2) Securing and releasing memory The dynamic tracker 103 is a function for securing or releasing memory provided by the library and a system that calls them internally in order to track the state of the memory secured on the heap. It is necessary to notify the tester 105 of a call.

ステップS103においてセグメンテーション違反が発生していない場合(ステップS103:No)、動的追跡器103は、メモリの確保又は開放、子プロセス若しくはスレッドの生成又は終了が発生したと判断する。このうち、メモリの確保又は開放について以下に説明する。   If no segmentation violation has occurred in step S103 (step S103: No), the dynamic tracker 103 determines that memory allocation or release, child process or thread generation or termination has occurred. Among these, the securing or releasing of the memory will be described below.

メモリの確保又は開放が発生した場合、動的追跡器103は、メモリの確保又は開放を検査器105に通知する(ステップS113)。検査器105に通知される具体的なメッセージの構成は以下のようになる:
メモリの確保の場合:(ポインタ型:割り当てられた先頭のアドレス、整数型:割り当てられた領域のバイト数)
メモリの開放の場合:(ポインタ型:開放される先頭のアドレス)
検査器105は、後述するように、システム全体のプロセスの状態を基に、指示を表現する値を動的追跡器103に送り返すため、動的追跡器103は、検査器105から返信されるデータを待つ(ステップS115)。
When the memory is secured or released, the dynamic tracker 103 notifies the tester 105 of the memory secured or released (step S113). A specific message configuration notified to the inspector 105 is as follows:
For memory allocation: (Pointer type: assigned start address, integer type: number of bytes in the allocated area)
When releasing memory: (Pointer type: First address to be released)
As will be described later, the tester 105 sends back a value representing an instruction to the dynamic tracker 103 based on the state of the process of the entire system, so that the dynamic tracker 103 returns data returned from the tester 105. (Step S115).

(3)子プロセス又はスレッドの作成と終了
動的追跡器103は、検査対象のプロセスが新しい子プロセス又はスレッドの作成又は終了を行う場合、その事象を検査器105に通知する(ステップS113)。子プロセスやスレッドにより行われる処理や、スレッド毎に確保されるメモリ領域の追跡のために、この事象は追跡される必要がある。検査器に通知される具体的なメッセージの構成は以下のようになる
子プロセスの生成の場合:(整数型:新しいプロセスのプロセスID)
子プロセスの終了の場合:(整数型:終了したプロセスのプロセスID)
スレッドの生成の場合:(整数型:新しいスレッドのスレッドID)
スレッドの終了の場合:(整数型:終了したスレッドのスレッドID)
検査器105は、動的追跡器103が捕捉した上記の3つの事象に応じて内部で保存されている検査対象のプロセスの状態を更新する。そして、検査対象のプロセスの状態に基づき、後述するユーザから与えられたシナリオを実行する。
(3) Creation and Termination of Child Process or Thread When the process to be inspected creates or terminates a new child process or thread, the dynamic tracker 103 notifies the inspector 105 of the event (step S113). This event needs to be tracked for processing performed by a child process or thread, or for tracking a memory area reserved for each thread. When creating a child process, the specific message configuration notified to the tester is as follows: (integer type: process ID of the new process)
For child process termination: (Integer type: Process ID of the terminated process)
When creating a thread: (Integer type: Thread ID of the new thread)
For thread termination: (Integer type: thread ID of terminated thread)
The inspector 105 updates the state of the process to be inspected internally stored in response to the above three events captured by the dynamic tracker 103. Then, based on the state of the process to be inspected, a scenario given by the user described later is executed.

検査対象のプロセスは検査器105から動的追跡器103を介して返された値を基に動作を行う。指示が返されるまでは処理を進行させない。指示と指示に対応して実行する動作の組み合わせは以下の3種類である。
(1)[指示]何も行わない:[動作]処理を進行させる
(2)[指示]ネットワークエラーを発生させる:[動作]プロセスが作成したTCP(Transmission Control Protocol)のコネクションを全て破棄する
(3)[指示]ディスクエラーを発生させる:[動作]プロセスが開いているファイルを全て閉じ、そのプロセスが作成したファイル全てを削除する
いずれの場合も、動的追跡器103は、動作の実行後、退避されたプログラムカウンタの値をセグメンテーション違反を発生させた命令のサイズだけ加算し、次の命令の実行を再開する。
The process to be inspected operates based on the value returned from the inspector 105 via the dynamic tracker 103. Do not proceed until the instruction is returned. There are the following three types of combinations of instructions and operations to be executed in response to the instructions.
(1) [Instruction] Do nothing: [Action] Proceed with processing (2) [Instruction] Generate a network error: [Action] Discard all TCP (Transmission Control Protocol) connections created by the process ( 3) [Instruction] Cause disk error: [Action] Close all open files in process and delete all files created by that process Then, the value of the saved program counter is added by the size of the instruction that caused the segmentation violation, and execution of the next instruction is resumed.

上記の3種類の指示と動作の組み合わせの中から、検査器105から何もせずに次の命令を実行するように指示された場合(ステップS117:Yes)、すなわち、上記の指示のうち(1)が指示された場合、動的追跡器103は、次のプログラムカウンタが指す命令を実行する(ステップS101)。   Among the combinations of the above three types of instructions and operations, when the inspector 105 instructs to execute the next instruction without doing anything (step S117: Yes), that is, among the above instructions (1 ) Is instructed, the dynamic tracker 103 executes the instruction indicated by the next program counter (step S101).

一方、検査器105からフォールトインジェクション又はアサーションの確認が指示された場合(ステップS117:No)、動的追跡器103は、フォールトインジェクション又はアサーションの確認を行う(ステップS119)。フォールトインジェクションとは、意図的にエラーを発生させてエラー処理の異常を検査することを意味する。例えば、フォールトインジェクションは、上記の指示のうち(2)及び(3)が対応する。アサーションとは、システムの前提として記述された充足すべき要件が、実行時に充足されない場合にエラーや例外、メッセージ表示、処理中断等を発生させる機能を意味する。フォールトインジェクション又はアサーションによる検査を行うため、動的追跡器103は、次のプログラムカウンタが指す命令を実行する(ステップS101)。   On the other hand, when confirmation of fault injection or assertion is instructed from the inspector 105 (step S117: No), the dynamic tracker 103 confirms fault injection or assertion (step S119). Fault injection means that an error is intentionally generated to check for error handling errors. For example, fault injection corresponds to (2) and (3) among the above instructions. Assertion means a function that generates an error, an exception, a message display, a process interruption, or the like when a requirement to be satisfied described as a system premise is not satisfied at the time of execution. In order to perform inspection by fault injection or assertion, the dynamic tracker 103 executes an instruction pointed to by the next program counter (step S101).

<検査器の動作>
図3に、本発明の実施例に係るソフトウェア検査装置内の検査器105のフローチャートを示す。
<Operation of inspection device>
FIG. 3 shows a flowchart of the inspector 105 in the software inspection apparatus according to the embodiment of the present invention.

検査器105は、検査対象のプロセスから通知された事象を基に動作を行う。このため、検査器105は、新たな検査対象のプロセスの開始又は検査中のプロセスの状態の更新を動的追跡器103から受信するまで待つ(ステップS201)。新たな検査対象のプロセスの開始である場合(ステップS203:Yes)、新しいプロセスを表現するためのデータを確保して初期化する(ステップS205)。新たな検査対象のプロセスの開始ではない場合(ステップS203:No)、検査器105は、対応するプロセスの状態を更新する。   The inspector 105 operates based on the event notified from the process to be inspected. For this reason, the inspector 105 waits until it receives from the dynamic tracker 103 the start of a new process to be inspected or the update of the state of the process under inspection (step S201). If it is the start of a new process to be inspected (step S203: Yes), data for expressing the new process is secured and initialized (step S205). If it is not the start of a new inspection target process (step S203: No), the inspector 105 updates the state of the corresponding process.

なお、検査器105に与えるシナリオは以下のような状態とそれに対応する検査器105の動作の組み合わせの繰り返しとして記述され、シナリオ記憶部101に格納されている:
(プロセス1の状態,プロセス2の状態,...,プロセスnの状態)->検査器の動作
プロセス1つにつき保存される状態は、最初に作成された親プロセスと全ての子プロセスの、全てのグローバル変数、動的に確保されたメモリの使用状況、スレッド数、スレッド毎に確保されたメモリ領域となる。便宜的にこのプロセスの状態を目的の状態と呼ぶ。
The scenario given to the tester 105 is described as a repetition of a combination of the following state and the operation of the tester 105 corresponding to the following state, and is stored in the scenario storage unit 101:
(Process 1 status, Process 2 status, ..., Process n status)-> Inspector operation The status saved for each process is the first created parent process and all child processes. All global variables, the dynamically used memory usage status, the number of threads, and the memory area reserved for each thread. For convenience, the state of this process is called the target state.

目的の状態は、保存されているプロセスの状態の上に定義される条件として記述される。例えば、目的の状態は、所定の条件を満たすプロセスの状態として記述される。   The target state is described as a condition defined on top of the stored process state. For example, the target state is described as the state of a process that satisfies a predetermined condition.

上記のように、各プロセスから通知されてきた事象を基に検査器105は各プロセスの状態を更新する。各プロセスの状態が上記の目的の状態と一致した場合(ステップS209:Yes)、検査器105は、上記シナリオの記述例における矢印の右側に記述された動作を行う(ステップS211)。検査器105の動作の例としては、フォールトインジェクションや分散システム全体の状態に対するアサーションの確認、またはそれらの組み合わせなどがあげられる。各プロセスの状態が目的の状態と一致しない場合(ステップS209:No)、検査器105は、新たな検査対象のプロセスの開始又は検査中のプロセスの状態の更新を動的追跡器103から受信するまで待つ(ステップS201)。   As described above, the tester 105 updates the state of each process based on the event notified from each process. When the state of each process coincides with the target state (step S209: Yes), the tester 105 performs the operation described on the right side of the arrow in the description example of the scenario (step S211). Examples of the operation of the inspector 105 include fault injection, confirmation of assertion with respect to the state of the entire distributed system, or a combination thereof. When the state of each process does not match the target state (step S209: No), the inspector 105 receives from the dynamic tracker 103 the start of a new process to be inspected or the update of the state of the process being inspected. (Step S201).

なお、ユーザによるシナリオの記述を容易にするために、各プロセスの状態として、特殊な2つの記法を用意する。
ワイルドカード:任意の状態であることを許可する。状態の更新の通知が発生してもそのプロセスの停止は行わない。
無条件停止:n-1番目の検査器の動作が終了した後、n番目のプロセスkの状態が無条件停止だった場合、プロセスkには状態の更新を許可しない。
In order to facilitate the description of the scenario by the user, two special notations are prepared as the state of each process.
Wild card: Allow any state. Even if a status update notification occurs, the process is not stopped.
Unconditional stop: If the state of the nth process k is an unconditional stop after the operation of the n-1st tester is finished, the process k is not allowed to update the state.

これらの記法を用い、ユーザは検査したい状態遷移の系列を個別のシナリオとして記述することが可能になる。ユーザは各プロセスの初期状態と終了状態に加えてその間の遷移を記述し、その合成を作成することで、検査を行いたい全てのシナリオを生成することが出来る。   Using these notations, the user can describe a sequence of state transitions to be examined as an individual scenario. In addition to the initial state and end state of each process, the user describes the transitions between them, and by creating a composite of them, it is possible to generate all the scenarios to be examined.

検査器105が全ての目的の状態を達成していない場合、すなわち、シナリオの全てが終了していない場合(ステップS213:No)、検査器105は、新たな検査対象のプロセスの開始又は検査中のプロセスの状態の更新を動的追跡器103から受信するまで待つ(ステップS201)。全ての目的の状態を達成した場合、すなわち、シナリオの全てが終了した場合(ステップS213:Yes)、検査器105は処理を終了する。   When the inspector 105 does not achieve all the target states, that is, when all the scenarios are not completed (step S213: No), the inspector 105 starts or inspects a new process to be inspected. The process waits until an update of the process state is received from the dynamic tracker 103 (step S201). When all the target states are achieved, that is, when all the scenarios are completed (step S213: Yes), the inspector 105 ends the process.

<複数のプロセスを検査するときの例>
図4に、本発明の実施例に係るソフトウェア検査装置において複数のプロセスを検査するときの例を示す。図4は、動的追跡器103が、それぞれ検査対象のプロセス1〜nの状態s1〜snを追跡し、検査器105に通知している様子を示す。
<Example when inspecting multiple processes>
FIG. 4 shows an example when a plurality of processes are inspected in the software inspection apparatus according to the embodiment of the present invention. FIG. 4 shows a state where the dynamic tracker 103 tracks the states s1 to sn of the processes 1 to n to be inspected and notifies the inspector 105 of them.

一例として、分散ストレージシステムにおいてディスクエラーを正しく処理できているかどうかを検査するシナリオについて説明する。この分散ストレージシステムはオブジェクトの単位でデータを保存し、保存の際に冗長度を設定出来るものとする。この分散ストレージシステムを4つの計算機で動作させ、冗長度を3に設定しているものとする(図4においてn=4)。つまり、1つのオブジェクトを保存した際、4つの計算機のうち3つにそのオブジェクトは保存されることになる。そして、動作中のシステムが利用している計算機が故障して動作の続行が不可能になった場合、その計算機が保存していたオブジェクトを、別の計算機から復元して冗長度を回復するための修復作業を行うものとする。そして、設定された冗長度を満たせない数の計算機しか利用出来ない状態になった場合、ユーザからの書き込みの要求を全て拒否する、という挙動を行うものとする。   As an example, a scenario for checking whether or not a disk error can be correctly processed in a distributed storage system will be described. In this distributed storage system, data is stored in units of objects, and redundancy can be set at the time of storage. It is assumed that this distributed storage system is operated by four computers and the redundancy is set to 3 (n = 4 in FIG. 4). That is, when one object is stored, the object is stored in three of the four computers. If the computer used by the operating system fails and the operation cannot be continued, the object saved by that computer is restored from another computer to restore redundancy. Repair work shall be performed. Then, when only a number of computers that cannot satisfy the set redundancy can be used, a behavior of rejecting all write requests from the user is performed.

このシステムのプロセスは初期化が完了した後、runningという真偽値型のグローバル変数がtrueに設定されるものとする。また、修復作業中はrecovery_workというポインタ型の変数が非NULLに設定され、完了後にNULLになるものとする。   This system process is assumed to have a boolean global variable called running set to true after initialization is complete. It is also assumed that a pointer type variable called recovery_work is set to non-null during repair work, and becomes null after completion.

検査するシナリオは、このシステムが4つの計算機を利用している状況で、最初に1つの計算機が故障し、それを検出した他の計算機が修復作業を開始した段階で、さらにもう1つの計算機が故障した場合、書き込みの要求が受け付けられないかということを検査する、という内容である。この場合、シナリオは以下のように記述される:
(proc0: running == true, proc1: running == true, proc2: running == true, proc3: running == true) -> kill proc3
(proc0: recovery_work != NULL, proc1: recovery_work != NULL, proc3, recover_work != NULL) -> kill proc3, assert(DENIED == write object proc0)
網羅的な検査を行いたい場合は、最初に強制終了させるプロセス、次に強制終了させるプロセス、書き込みを試されるプロセスの4*3*2=24通りの全てを網羅すれば、このシナリオを網羅的に検査することが出来る。
The scenario to be checked is that when this system uses four computers, when one computer fails first and another computer that detects it starts repair work, another computer In the case of a failure, the content is to check whether a write request is accepted. In this case, the scenario is described as follows:
(proc0: running == true, proc1: running == true, proc2: running == true, proc3: running == true)-> kill proc3
(proc0: recovery_work! = NULL, proc1: recovery_work! = NULL, proc3, recover_work! = NULL)-> kill proc3, assert (DENIED == write object proc0)
If you want to perform an exhaustive inspection, this scenario can be covered by covering all 4 * 3 * 2 = 24 processes of the process that is forcibly terminated first, the process that is forcibly terminated, and the process for which writing is attempted. Can be inspected.

このシナリオを用いて、図1を参照して説明した通り、動的追跡器103は、監視対象のプロセス1〜n(上記のシナリオにおけるproc0〜proc3)によるメモリ、子プロセス又はスレッドの状態s1〜sn(上記のシナリオにおけるrunningというグローバル変数の値)を監視し、状態の遷移を検査器105に同期的に通知する。また、動的追跡器103は、検査器105に通知した状態に対する返信に応じた動作を行う。   Using this scenario, as described with reference to FIG. 1, the dynamic tracker 103 uses the statuses s1 to s1 of the memories, child processes, and threads by the monitored processes 1 to n (proc0 to proc3 in the above scenario). sn (the value of the global variable called running in the above scenario) is monitored, and the state transition is notified to the tester 105 synchronously. The dynamic tracker 103 performs an operation according to a reply to the state notified to the inspector 105.

検査器105は、動的追跡器103から通知された状態の組(s1,...sn)を更新し、初期化時に与えられた上記のシナリオを記述したファイルに基づき、検査対象のプロセス1〜n(上記のシナリオではproc0〜proc3)の進行を制御する。   The inspector 105 updates the state set (s1,... Sn) notified from the dynamic tracker 103, and based on the file describing the scenario given at the time of initialization, the inspecting process 1 Controls the progress of ~ n (proc0 ~ proc3 in the above scenario).

<本発明の実施例の効果>
非特許文献2で紹介されている技術では、システムコールの呼び出しのみを事象として検査器に通知している。この手法では、プログラム内部のメモリの状態を得るためにはシステムコールの呼び出しの履歴からメモリの状態を推定する必要がある。また、推定によって得られた状態であるため、実際の状態との乖離の可能性は常に残ってしまう。
<Effect of the embodiment of the present invention>
In the technology introduced in Non-Patent Document 2, only the call of a system call is notified to the tester as an event. In this method, in order to obtain the memory state in the program, it is necessary to estimate the memory state from the call history of system calls. Moreover, since it is a state obtained by estimation, the possibility of deviation from the actual state always remains.

本発明の実施例では、メモリ上の状態のコピーを確実に作ることが可能となる。そのため、目的の状態に対する条件としてシナリオを記述する際、検査対象のプロセスの変数を項として記述することが可能になる。このため、本発明の実施例では、単一システムのデバッグを行う際に利用出来るアサーションと同じ利便性を、分散システムのデバッグに提供することが可能になる。   In the embodiment of the present invention, it is possible to reliably make a copy of the state on the memory. Therefore, when describing a scenario as a condition for a target state, it is possible to describe a variable of a process to be inspected as a term. For this reason, in the embodiment of the present invention, it is possible to provide the same convenience for debugging a distributed system as the assertion that can be used when debugging a single system.

本発明の実施例によれば、実装したソフトウェアに対し、プロセスのメモリ状態の変化に応じた網羅的な検査を可能とすることで、精度の高い検査を効果的に実行することが可能になる。また、検査器での動作実行にあたり、利用者は検査を行いたい全シナリオを効率的に生成可能であり、検査対象の状態遷移の系列について各プロセスの初期状態と終了状態だけではなく、その間の遷移を含めて個別のシナリオとして記述可能となり、シナリオ生成効率の向上が図られる。   According to the embodiment of the present invention, it is possible to execute a highly accurate inspection effectively by enabling a comprehensive inspection corresponding to a change in the memory state of a process for installed software. . In addition, when executing operations with the tester, the user can efficiently generate all scenarios that the user wants to inspect, and not only the initial state and end state of each process but also the sequence of state transitions to be inspected. It is possible to describe as individual scenarios including transitions, and the scenario generation efficiency is improved.

また、本発明の実施例よれば、非分散システムのデバッグ時に利用するアサーションと同様の利便性を、分散システムのデバッグに提供することが可能になる。   Further, according to the embodiment of the present invention, it is possible to provide the same convenience as the assertion used when debugging a non-distributed system for debugging the distributed system.

101 シナリオ記憶部
103 動的追跡器
105 検査器
101 scenario storage unit 103 dynamic tracker 105 tester

Claims (6)

ソフトウェアが実行されたときのプロセスにおける所定の状態及び対応する動作を記述したシナリオを用いてソフトウェアを検査する検査装置におけるソフトウェア検査方法であって、
前記検査装置の動的追跡器が、検査対象のプロセスによるメモリ、子プロセス又はスレッドを監視する監視ステップと、
前記検査装置の検査器が、前記動的追跡器により監視されたメモリ、子プロセス又はスレッドの情報とシナリオとに基づき、前記動的追跡器に対して動作を指示する指示ステップと、
前記動的追跡器が、前記検査器からの指示に基づいて、検査対象のプロセスを制御する制御ステップと、
を有するソフトウェア検査方法。
A software inspection method in an inspection apparatus for inspecting software using a scenario describing a predetermined state and a corresponding operation in a process when software is executed,
A monitoring step in which a dynamic tracker of the inspection device monitors a memory, a child process or a thread by a process to be inspected;
An instructing step for instructing the dynamic tracker to perform an operation based on memory and child process or thread information and scenarios monitored by the dynamic tracker;
A control step in which the dynamic tracker controls a process to be inspected based on an instruction from the inspector;
A software inspection method.
前記監視ステップは、前記動的追跡器が、検査対象のプロセスのグローバル変数が割り当てられているメモリ上のページと、実行時に確保されるメモリ上のページの書き込み権限を削除することにより、メモリ上の状態の変化を監視する、請求項1に記載のソフトウェア検査方法。   In the monitoring step, the dynamic tracker deletes the right to write the page on the memory to which the global variable of the process to be inspected is allocated and the page on the memory secured at the time of execution, thereby deleting the memory on the memory. The software inspection method according to claim 1, wherein a change in the state of the software is monitored. 前記監視ステップは、前記動的追跡器が、検査対象のプロセスによるメモリの確保と開放とを監視する、請求項1又は2に記載のソフトウェア検査方法。   The software monitoring method according to claim 1, wherein in the monitoring step, the dynamic tracker monitors whether a memory to be allocated and released by a process to be inspected. 前記監視ステップは、前記動的追跡器が、検査対象のプロセスによる子プロセス又はスレッドの生成と終了とを監視する、請求項1乃至3のうちいずれか1項に記載のソフトウェア検査方法。   4. The software inspection method according to claim 1, wherein in the monitoring step, the dynamic tracker monitors generation and termination of a child process or a thread by a process to be inspected. 5. 前記指示ステップは、前記動的追跡器により監視されたメモリ、子プロセス又はスレッドの情報がシナリオに記述された所定の状態を満たす場合、前記動的追跡器に対してフォールトインジェクション又はアサーションの確認を指示する、請求項1乃至4のうちいずれか1項に記載のソフトウェア検査方法。   When the memory, child process, or thread information monitored by the dynamic tracker satisfies a predetermined state described in a scenario, the instruction step confirms fault injection or assertion for the dynamic tracker. The software inspection method according to claim 1, wherein the software inspection method is instructed. ソフトウェアが実行されたときのプロセスにおける所定の状態及び対応する動作を記述したシナリオを用いてソフトウェアを検査する検査装置として、コンピュータを機能させるためのプログラムであって、当該コンピュータを
検査対象のプロセスによるメモリ、子プロセス又はスレッドを監視する動的追跡手段、及び
前記動的追跡手段により監視されたメモリ、子プロセス又はスレッドの情報とシナリオとに基づき、前記動的追跡手段に対して動作を指示する検査手段、
として機能させ、
前記動的追跡手段は、前記検査手段からの指示に基づいて、検査対象のプロセスを制御するプログラム。
A program that causes a computer to function as an inspection device that inspects software using a scenario that describes a predetermined state and a corresponding operation in the process when the software is executed. The computer depends on the process to be inspected. Dynamic tracking means for monitoring a memory, a child process or a thread, and instructing the dynamic tracking means to perform an operation based on information and a scenario of the memory, child process or thread monitored by the dynamic tracking means. Inspection means,
Function as
The dynamic tracking unit is a program for controlling a process to be inspected based on an instruction from the inspection unit.
JP2013082833A 2013-04-11 2013-04-11 Software inspection method and program Pending JP2014206807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013082833A JP2014206807A (en) 2013-04-11 2013-04-11 Software inspection method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013082833A JP2014206807A (en) 2013-04-11 2013-04-11 Software inspection method and program

Publications (1)

Publication Number Publication Date
JP2014206807A true JP2014206807A (en) 2014-10-30

Family

ID=52120326

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013082833A Pending JP2014206807A (en) 2013-04-11 2013-04-11 Software inspection method and program

Country Status (1)

Country Link
JP (1) JP2014206807A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019067274A (en) * 2017-10-04 2019-04-25 富士通株式会社 Generation program, generation method, and information processing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019067274A (en) * 2017-10-04 2019-04-25 富士通株式会社 Generation program, generation method, and information processing apparatus

Similar Documents

Publication Publication Date Title
US8468501B2 (en) Partial recording of a computer program execution for replay
US9720808B2 (en) Offline debugging using a replicated operating environment
CN107077412B (en) Automated root cause analysis for single or N-tier applications
US10255086B2 (en) Determining optimal methods for creating virtual machines
US20050223362A1 (en) Methods and systems for performing unit testing across multiple virtual machines
US20100313185A1 (en) Access to test-ready virtual environments
Viennot et al. Transparent mutable replay for multicore debugging and patch validation
US7984332B2 (en) Distributed system checker
US20170102888A1 (en) Backup storage of vital debug information
US10146653B2 (en) Automated system-level failure and recovery
US9086969B2 (en) Establishing a useful debugging state for multithreaded computer program
US11748245B2 (en) Object-oriented regression-candidate filter
CA2904253C (en) Computer system using in-service software upgrade
US20140173569A1 (en) Managing window focus while debugging a graphical user interface program
US10795793B1 (en) Method and system for simulating system failures using domain-specific language constructs
US20200034284A1 (en) Automatic bug reproduction using replication and cpu lockstep
JP2010539577A (en) Method for processing the amount of information handled during the debug phase of airborne operations software and device for implementing the method
US10860411B2 (en) Automatically detecting time-of-fault bugs in cloud systems
US10229033B2 (en) System, method and apparatus for debugging of reactive applications
Montrucchio et al. Software-implemented fault injection in operating system kernel mutex data structure
JP2014206807A (en) Software inspection method and program
CN115757099A (en) Automatic test method and device for platform firmware protection recovery function
Gao et al. Common data guided crash injection for cloud systems
JP2012181737A (en) Computer system
Alourani et al. T-basir: Finding shutdown bugs for cloud-based applications in cloud spot markets