JP2009032233A - Exclusive control fault candidate extraction device, exclusive control fault candidate extraction method, and exclusive control fault candidate extraction program - Google Patents
Exclusive control fault candidate extraction device, exclusive control fault candidate extraction method, and exclusive control fault candidate extraction program Download PDFInfo
- Publication number
- JP2009032233A JP2009032233A JP2008022983A JP2008022983A JP2009032233A JP 2009032233 A JP2009032233 A JP 2009032233A JP 2008022983 A JP2008022983 A JP 2008022983A JP 2008022983 A JP2008022983 A JP 2008022983A JP 2009032233 A JP2009032233 A JP 2009032233A
- Authority
- JP
- Japan
- Prior art keywords
- exclusive control
- function
- shared resource
- list
- defect candidate
- 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.)
- Withdrawn
Links
Images
Abstract
Description
この発明は排他制御不具合候補抽出装置、排他制御不具合候補抽出方法、および排他制御不具合候補抽出プログラムに関し、特に、ソフトウェアの排他制御に関する不具合を検出する排他制御不具合候補抽出装置、排他制御不具合候補抽出方法、および排他制御不具合候補抽出プログラムに関する。 The present invention relates to an exclusive control defect candidate extraction apparatus, an exclusive control defect candidate extraction method, and an exclusive control defect candidate extraction program, and more particularly to an exclusive control defect candidate extraction apparatus and an exclusive control defect candidate extraction method for detecting defects related to software exclusive control. , And an exclusive control defect candidate extraction program.
リアルタイムOS(Operating System)上で動作するタスクは、必要に応じてグローバル変数や表示装置などのリソースをタスク間で共有する。各タスクがタスク間で共有しているリソース(以下、共有リソースという)に対してアクセスする際には、リアルタイムOSが提供する排他制御機構であるセマフォ等を用いて他タスクのアクセスを不可能な状態にした(ロックした)後にアクセスし、アクセス終了後にロックを解除することが必要である。したがって、タスクが共有リソースに対してアクセスするプログラムを作成する場合、プログラム作成者は、ロック、共有リソースへのアクセス、およびロック解除の順に実行されるプログラムを作成する必要がある。 Tasks that operate on a real-time OS (Operating System) share resources such as global variables and display devices as needed. When a task accesses a resource shared between tasks (hereinafter referred to as a shared resource), it is impossible to access other tasks using a semaphore that is an exclusive control mechanism provided by the real-time OS. It is necessary to access after setting (locked) and releasing the lock after the access is completed. Therefore, when creating a program for a task to access a shared resource, the program creator needs to create a program that is executed in the order of locking, access to the shared resource, and unlocking.
しかし、プログラム作成者の不注意によりロックをかけることなく共有リソースにアクセスするモジュールが作成されてしまう場合がある。その場合、そのモジュールを利用した共有リソースへのアクセスが複数のタスクで同時に行なわれると、データ不整合などの不具合(以下、排他制御不具合)が発生してしまう可能性がある。 However, a module that accesses a shared resource without locking may be created due to carelessness of the program creator. In this case, if access to the shared resource using the module is performed simultaneously by a plurality of tasks, there is a possibility that a defect such as data inconsistency (hereinafter, exclusive control defect) may occur.
特開平3−288239号公報(以下、特許文献1)は、このような、共有リソースへのロック忘れによる不具合の発生を防ぐための、ロックをかけずに共有リソースにアクセスしている箇所を検出する技術を開示している。 Japanese Patent Laid-Open No. 3-288239 (hereinafter referred to as Patent Document 1) detects a location where a shared resource is accessed without locking, in order to prevent the occurrence of such a problem due to forgetting to lock the shared resource. The technology to do is disclosed.
詳しくは、特許文献1に開示されている技術では、ソースプログラムが入力として与えられると、ソースプログラムのコンパイル時に、データが共有リソースとして扱われるか否かのフラグがデータ割り当て認識領域A1に設定され、実行時にロックをかける命令列を生成する際にロックをかけたことを示すフラグ(以下、ロックフラグ)をロック認識領域に設定する命令列がオブジェクトプログラム内に生成され、実行時にロックを解除する命令列を生成する際にロックフラグを解除する命令列がオブジェクトプログラム内に生成され、最終的にロードモジュールが生成される。さらに、前記ロードモジュールをデバッガで実行し、あるタスクによりリソースへのアクセスが行なわれた場合に、データ割り当て認識領域A1が参照されて、そのリソースが共有リソースか否かが分かる。リソースが共有リソースの場合、さらにロックフラグが参照されることにより、その共有リソースに対してロックがかけられているか否かが分かる。ロックがかけられていない場合、未ロックの共有リソースへのアクセスが行なわれていることが分かる。特許文献1の技術では、上記手順により、未ロックの共有リソースへのアクセスを不具合として検出している。
しかしながら、特許文献1に開示されている技術では、未ロック時における共有領域へのデータ定義参照という排他制御不具合の検出を、動的解析により行なっている。このため、処理内の条件分岐を網羅するために、条件を変更しながら膨大な回数の動的解析を行なう必要があるという問題があった。これを第1の問題として提起する。
However, in the technique disclosed in
また、特許文献1に開示されている技術を用いて排他制御不具合を検出するためには、動的解析の実行に必要な環境を別途用意する必要があるという問題があった。これを第2の問題として提起する。
In addition, in order to detect an exclusive control failure using the technique disclosed in
上記第1の問題について詳細に説明する。
図30は、共有リソースAへアクセスする関数f1のソースプログラムを表わす図である。詳しくは、図30を参照して、行201は共有リソースに対してロックをかける関数、行202は共有リソースの値を読込む関数、行203は呼ばれる関数f1_1、行205は共有リソースへ値を書込む関数、行204は共有リソースに対してアンロックを行なう関数を表わしている。
The first problem will be described in detail.
FIG. 30 is a diagram illustrating a source program of the function f1 for accessing the shared resource A. Specifically, referring to FIG. 30,
図31は、共有リソースB,Cへアクセスする関数f2のソースプログラムを表わす図である。詳しくは、図31を参照して、行301は関数の条件を表わす。関数f2は、行301の条件の判断を含む、共有リソースにアクセスする関数(以下、排他制御関数と呼ぶ)である。図31の行群305は、行301の関数の条件に応じて、図32,図33のように2つのフローに分岐する。
FIG. 31 shows a source program of the function f2 for accessing the shared resources B and C. Specifically, referring to FIG. 31, a
図32のフローの場合、行群402の共有リソースB,Cへのアクセス(読込み/書込み)の前後で、共有リソースB,Cへのロック、アンロックがそれぞれ行401,403で行なわれているため排他制御不具合の問題はない。一方、図33のフローの場合、行502で共有リソースCへのアクセス(書込み)が行なわれる前に行501で共有リソースCに対してアンロックを行なっている。そのため、行502が排他制御不具合の原因となる。
In the case of the flow in FIG. 32, before and after the access (read / write) to the shared resources B and C in the
特許文献1の技術を利用して図31の排他制御関数の排他制御不具合を検出する場合、行301の条件判断において、図32,33のフローの排他制御不具合の有無の確認を行なう。そのために、行301の条件であるv2>0と、v2≦0との2つの場合の条件を満たすように設定を行ない、それぞれの場合についてデバッグツールを用いた動的な検証を行なう必要があった。このため、デバッグの際の設定不備により、図31の行301の条件のうちのv2≦0の条件の判断が漏れてしまった場合、図33の行502の排他制御不具合の検出が行なえなかったという問題がある。
When detecting the exclusive control failure of the exclusive control function of FIG. 31 using the technique of
本発明はこのような問題に鑑みてなされたものであって、処理量および処理時間を抑えて、静的解析を利用してソフトウェアの排他制御に関する不具合を精度よく検出することができる排他制御不具合候補抽出装置、排他制御不具合候補抽出方法、および排他制御不具合候補抽出プログラムを提供することを目的とする。 The present invention has been made in view of such problems, and is capable of accurately detecting defects related to software exclusive control using static analysis while suppressing the processing amount and processing time. An object is to provide a candidate extraction device, an exclusive control defect candidate extraction method, and an exclusive control defect candidate extraction program.
上記目的を達成するために、本発明のある局面に従うと、排他制御不具合候補抽出装置は、ソフトウェア構成より共有リソースにアクセスする関数である排他制御関数を抽出する排他制御関数抽出手段と、抽出された排他制御関数に対し、排他制御できているか否かを判定する処理を実行する排他制御判定実行手段とを備える。 In order to achieve the above object, according to one aspect of the present invention, an exclusive control defect candidate extracting device is extracted with an exclusive control function extracting unit that extracts an exclusive control function that is a function for accessing a shared resource from a software configuration. Exclusive control determination execution means for executing processing for determining whether or not exclusive control can be performed on the exclusive control function.
好ましくは、排他制御判定実行手段の実行する処理は、排他制御関数が、アンロック状態の共有リソースにアクセスしているか否かを判定する処理を含む。 Preferably, the process executed by the exclusive control determination execution unit includes a process of determining whether or not the exclusive control function is accessing the shared resource in the unlocked state.
好ましくは、排他制御判定実行手段の実行する処理は、排他制御関数が、ロック状態の共有リソースにアクセスした後に、共有リソースをアンロック状態とせずに処理を終了しているか否かを判定する処理を含む。 Preferably, the process executed by the exclusive control determination execution unit is a process for determining whether or not the exclusive control function ends the process without bringing the shared resource into the unlocked state after accessing the shared resource in the locked state. including.
好ましくは、排他制御関数抽出手段は、ソフトウェア構成の複数のタスク上で利用される共有リソースにアクセスを行なう排他制御関数を抽出する。 Preferably, the exclusive control function extracting unit extracts an exclusive control function for accessing a shared resource used on a plurality of tasks of the software configuration.
より好ましくは、排他制御関数抽出手段は、ソフトウェア構成の複数のタスク上で利用される共有リソースにアクセスを行なう排他制御関数を特定する際、ソフトウェア構成の各タスクの起動時に最初に呼出される関数名のリストであるタスクメイン関数リストを用いて、各タスクの起動時に呼出されている関数を辿っていく処理を行なって、排他制御関数がソフトウェア構成の複数タスク上で利用される共有リソースにアクセスを行なうか否かを判定し、その判定結果に基づいて排他制御関数を特定する。 More preferably, when the exclusive control function extracting unit specifies an exclusive control function for accessing a shared resource used on a plurality of tasks in the software configuration, a function that is called first when each task in the software configuration is activated. The task main function list, which is a list of names, is used to trace the function called when each task is started, and the exclusive control function accesses shared resources used on multiple tasks in the software configuration. Is determined, and an exclusive control function is specified based on the determination result.
または、より好ましくは、排他制御関数抽出手段は、ソフトウェア構成の複数のタスク上で利用される共有リソースにアクセスを行なう排他制御関数を特定する際、ソフトウェア構成のうち、タスクを生成する関数名を呼出している箇所の記載に基づいてタスクの起動時に最初に呼出される関数名のリストであるタスクメイン関数リストを作成する処理と、タスクメイン関数リストから呼出されている関数を辿っていく処理とを行なって、排他制御関数が前記ソフトウェア構成の複数タスク上で利用される共有リソースにアクセスを行なうか否かを判定し、その判定結果に基づいて排他制御関数を特定する。 Alternatively, more preferably, when the exclusive control function extracting unit specifies an exclusive control function that accesses a shared resource used on a plurality of tasks in the software configuration, the function name that generates the task in the software configuration is selected. A process of creating a task main function list that is a list of function names that are first called when a task is started based on the description of the calling part, and a process of tracing a function that is called from the task main function list To determine whether or not the exclusive control function accesses a shared resource used on a plurality of tasks of the software configuration, and specifies the exclusive control function based on the determination result.
好ましくは、排他制御不具合候補抽出装置は、上記ソフトウェアの設計情報として、ソフトウェア構成に含まれる、共有リソースにアクセスする関数と、その共有リソースとの対応関係を取得する取得手段をさらに含み、排他制御関数抽出手段は、上記対応関係に基づいて排他制御関数を抽出する。 Preferably, the exclusive control defect candidate extraction device further includes an acquisition unit that acquires, as the software design information, a function for accessing a shared resource and a correspondence relationship between the shared resource included in the software configuration, and the exclusive control The function extracting means extracts the exclusive control function based on the correspondence relationship.
または、好ましくは、排他制御不具合候補抽出装置は、共有リソースごとに、共有リソースと共有リソースに対してロック・アンロックを行なう関数との対応関係を取得する取得手段と、ソフトウェア構成から上記対応関係に規定されている共有リソースへのアクセス関数を抽出するアクセス関数抽出手段とをさらに含み、排他制御関数抽出部は、ソフトウェア構成からアクセス関数を呼出している関数を排他制御関数として抽出する。 Alternatively, preferably, the exclusive control defect candidate extracting device acquires, for each shared resource, an acquisition unit that acquires a correspondence relationship between the shared resource and a function that locks / unlocks the shared resource, and the correspondence relationship from a software configuration. And an access function extracting means for extracting an access function to the shared resource defined in the above, and the exclusive control function extracting unit extracts a function calling the access function from the software configuration as an exclusive control function.
好ましくは、排他制御不具合候補抽出装置は、共有リソースとなりうる変数の宣言に使用する記憶領域を指定する修飾子を取得する修飾子取得手段と、上記ソフトウェアと記憶領域とを指定する修飾子のリストから前記共有リソースのリストを抽出する共有リソース抽出手段と、共有リソースのリストから上記ソフトウェアに含まれる共有リソースにアクセスする関数と共有リソースとの対応関係を抽出する対応関係抽出手段とをさらに含み、排他制御関数抽出手段は、上記対応関係に基づいて排他制御関数を抽出する。 Preferably, the exclusive control defect candidate extraction device includes a qualifier acquisition unit that acquires a qualifier that specifies a storage area that is used to declare a variable that can be a shared resource, and a list of qualifiers that specify the software and the storage area. A shared resource extraction unit that extracts the shared resource list from the shared resource list, and a correspondence relationship extraction unit that extracts a correspondence relationship between the shared resource and a function that accesses the shared resource included in the software from the shared resource list, The exclusive control function extracting means extracts the exclusive control function based on the correspondence relationship.
好ましくは、排他制御不具合候補抽出装置は、共有リソースとなりうる変数の宣言に使用する記憶領域を指定する修飾子を取得する修飾子取得手段と、共有リソースに対してロック・アンロックを行なう関数のリストを取得するロック・アンロック関数取得手段と、ソフトウェアと上記記憶領域を指定する修飾子のリストとから共有リソースのリストを抽出する共有リソース抽出手段と、ロック・アンロックを行なう関数のリストと共有リソースのリストとから、共有リソースごとに共有リソースと共有リソースに対してロック・アンロックを行なう関数との対応関係を抽出する対応関係抽出手段と、上記ソフトウェアから上記対応関係に規定されている共有リソースへのアクセス関数を抽出するアクセス関数抽出手段とをさらに含み、排他制御関数抽出手段は、上記ソフトウェアからアクセス関数を呼出している関数を排他制御関数として抽出する。 Preferably, the exclusive control defect candidate extraction device includes a qualifier acquisition unit that acquires a qualifier that specifies a storage area used for the declaration of a variable that can be a shared resource, and a function that locks / unlocks the shared resource. A lock / unlock function acquisition means for acquiring a list; a shared resource extraction means for extracting a list of shared resources from software and a list of modifiers that specify the storage area; a list of functions for performing lock / unlock; Correspondence extraction means for extracting a correspondence between a shared resource and a function that locks / unlocks the shared resource from the list of shared resources, and the correspondence defined by the software And an access function extracting means for extracting an access function to the shared resource. Control function extraction unit extracts a function that calls the access function from the software as an exclusive control function.
好ましくは、排他制御不具合候補抽出装置は、共有リソースごとに、共有リソースと、共有リソースに対してロック・アンロックを行なう関数と共有リソースへのアクセス関数との対応関係とを取得する取得手段と、共有リソースに直接アクセスしている箇所を上記ソフトウェアより抽出し、当該個所を特定の文字列に置き換える処理と、上記特定の文字列を共有リソースへのアクセス関数として上記対応関係に加える処理とを行なう変更手段とをさらに含み、排他制御関数抽出部は、上記ソフトウェアからアクセス関数を呼出している関数を排他制御関数として抽出する。 Preferably, the exclusive control defect candidate extraction device acquires, for each shared resource, a shared resource, a correspondence between a function that locks / unlocks the shared resource, and an access function to the shared resource, and Extracting a part directly accessing the shared resource from the software, replacing the part with a specific character string, and adding the specific character string to the correspondence as an access function to the shared resource And an exclusive control function extracting unit that extracts a function that calls the access function from the software as an exclusive control function.
本発明の他の局面に従うと、排他制御不具合候補抽出方法は、入力手段と、演算手段と、出力手段とを備える排他制御不具合候補抽出装置における排他制御不具合候補抽出方法であって、入力手段において、ソフトウェア構成を入力するステップと、演算手段において、ソフトウェア構成より共有リソースにアクセスする関数である排他制御関数を抽出するステップと、演算手段において、抽出された排他制御関数に対し、排他制御できているか否かを判定するステップと、出力手段において、その判断の結果を出力するステップとを備える。 According to another aspect of the present invention, an exclusive control defect candidate extraction method is an exclusive control defect candidate extraction method in an exclusive control defect candidate extraction apparatus that includes an input unit, a calculation unit, and an output unit. The step of inputting the software configuration, the step of extracting the exclusive control function that is a function for accessing the shared resource from the software configuration in the calculation means, and the calculation means can perform exclusive control on the extracted exclusive control function. And a step of outputting the result of the determination in the output means.
本発明のさらに他の局面に従うと、排他制御不具合候補抽出プログラムは、コンピュータに排他制御不具合候補抽出処理を実行させるプログラムであって、上記コンピュータは、入力手段と、演算手段と、出力手段とを備え、入力手段において、ソフトウェア構成を入力するステップと、演算手段において、ソフトウェア構成より共有リソースにアクセスする関数である排他制御関数を抽出するステップと、演算手段において、抽出された排他制御関数に対し、排他制御できているか否かを判定するステップと、出力手段において、判断の結果を出力するステップとを実行させる。 According to still another aspect of the present invention, the exclusive control defect candidate extraction program is a program that causes a computer to execute an exclusive control defect candidate extraction process, and the computer includes an input unit, a calculation unit, and an output unit. A step of inputting a software configuration in the input unit; a step of extracting an exclusive control function that is a function for accessing the shared resource from the software configuration in the calculation unit; and a step of extracting the exclusive control function in the calculation unit The step of determining whether or not the exclusive control can be performed and the step of outputting the result of the determination in the output means are executed.
本発明のさらに他の局面に従うと、記録媒体はコンピュータ読取可能な記録媒体であって、上述の排他制御不具合候補抽出プログラムを記録する。 According to still another aspect of the present invention, the recording medium is a computer-readable recording medium and records the above-described exclusive control defect candidate extraction program.
本発明によると、多くの処理量や処理時間を必要とせず、ソフトウェアの排他制御に関する不具合を精度よく検出することができる。さらに、検出を行なう際の操作者の手間を減らすことができる。 According to the present invention, a large amount of processing and processing time are not required, and defects related to software exclusive control can be accurately detected. Furthermore, it is possible to reduce the labor of the operator when performing detection.
以下に、図面を参照しつつ、本発明の実施の形態について説明する。以下の説明では、同一の部品および構成要素には同一の符号を付してある。それらの名称および機能も同じである。 Embodiments of the present invention will be described below with reference to the drawings. In the following description, the same parts and components are denoted by the same reference numerals. Their names and functions are also the same.
以下の実施の形態において、排他制御不具合候補抽出システムは排他制御不具合候補抽出装置としてのパーソナルコンピュータ等から構成される。そのハードウェア構成は一般的なパーソナルコンピュータのハードウェア構成と同様であって、全体を制御するCPU(Central Processing Unit)などで構成される演算部、ROM(Read Only Memory)やRAM(Random Access Memory)やHD(Hard Disk)などの記憶装置、CD−ROM(Compact Disk-Read Only Memory)などの記録媒体から情報を読取る読取装置、キーボードやマウスや通信装置などの情報を入力する入力装置、および通信装置や表示装置などの演算結果を出力する出力装置を含む。これらはバスで接続される。または、排他制御不具合候補抽出システムは複数の装置から構成されて、専用回線や無線通信回線などで接続されてもよい。 In the following embodiments, the exclusive control defect candidate extraction system includes a personal computer or the like as an exclusive control defect candidate extraction device. The hardware configuration is the same as that of a general personal computer, and includes a calculation unit including a central processing unit (CPU) that controls the whole, a read only memory (ROM), and a random access memory (RAM). ) And HD (Hard Disk) storage device, a CD-ROM (Compact Disk-Read Only Memory) read-out device for reading information, an input device for inputting information such as a keyboard, mouse and communication device, and It includes an output device that outputs calculation results such as a communication device and a display device. These are connected by a bus. Alternatively, the exclusive control defect candidate extraction system may be configured by a plurality of devices and connected by a dedicated line or a wireless communication line.
さらに、上述の記憶装置には、所定の記憶領域として、入力装置から入力される、後述するソースプログラムや設計情報などを記憶する領域と、CPUで実行される排他制御不具合候補抽出プログラムを記憶する領域とが含まれる。 Furthermore, the above-described storage device stores, as a predetermined storage area, an area for storing a source program and design information, which will be described later, input from the input device, and an exclusive control defect candidate extraction program executed by the CPU. And area.
[第1の実施の形態]
図1は、本発明の第1の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。図1に示される各構成は、排他制御不具合候補抽出システムのCPUが記憶装置に記憶される排他制御不具合候補抽出プログラムを実行することで実現される機能である。図1に示される構成の少なくとも一部が、上述の排他制御不具合候補抽出システムのハードウェア構成で実現されてもよい。
[First Embodiment]
FIG. 1 is a diagram illustrating a specific example of the configuration of the exclusive control defect candidate extraction system according to the first embodiment of this invention. Each configuration shown in FIG. 1 is a function realized by the CPU of the exclusive control defect candidate extraction system executing an exclusive control defect candidate extraction program stored in the storage device. At least a part of the configuration shown in FIG. 1 may be realized by the hardware configuration of the exclusive control defect candidate extraction system described above.
図1を参照して、本実施の形態にかかる排他制御不具合候補抽出システムは、ソースプログラム入力部101、設計情報入力部102、排他制御関数抽出部103、排他制御判定実行部104、および排他制御不具合候補出力部105を含んで構成される。
Referring to FIG. 1, an exclusive control defect candidate extraction system according to this exemplary embodiment includes a source
ソースプログラム入力部101は、排他制御不具合を抽出する対象となるソフトウェア構成であるソースプログラム106を取得し、格納する。
The source
設計情報入力部102は、ソースプログラム106の設計情報107を取得し、格納する。ここで、設計情報は、排他制御関数候補・共有リソース名対応表、共有リソース仕様書、およびタスクメイン関数リストを含む。
The design
「排他制御関数候補・共有リソース名対応表」とは、図2に示されるような、共有リソースにアクセスする関数とその共有リソース名との対応関係を表わした表形式のデータである。ここで、「共有リソース」とは、グローバル変数、関数内静的変数などの、タスク間で共有するリソースを指す。 The “exclusive control function candidate / shared resource name correspondence table” is tabular data representing the correspondence between a function that accesses a shared resource and the shared resource name, as shown in FIG. Here, “shared resource” refers to a resource shared between tasks, such as a global variable and a static variable within a function.
「共有リソース仕様書」とは、図3に示されるような、共有リソースごとに、共有リソースにアクセスするための関数であるAPI(Application Program Interface)の名前と、どのようなアクセスを行なうのかを表わす情報(タイプ)との対応関係を表わした情報である。「タイプ」には、共有リソースに対してロックをかけるlock、共有リソースに対してロックを解除するunlock、および共有リソースに対して読込みまたは書込みを行なうaccessの3種類が含まれる。 "Shared resource specification" is the name of API (Application Program Interface), which is a function for accessing shared resources, and what kind of access is performed for each shared resource as shown in FIG. This is information representing the correspondence relationship with the information (type) to be represented. “Type” includes three types: lock that locks the shared resource, unlock that unlocks the shared resource, and access that reads or writes to the shared resource.
「タスクメイン関数リスト」とは、図4に示されるような、各タスクの起動時に最初に呼出される関数名のリストである。 The “task main function list” is a list of function names that are called first when each task is started, as shown in FIG.
排他制御関数抽出部103は、ソースプログラム入力部101が取得したソースプログラム106と、設計情報入力部102が取得した設計情報107の中の排他制御関数・共有リソース名対応表およびタスクメイン関数リストとから、複数のタスクから呼出される排他制御関数を抽出する。
The exclusive control
図5は、排他制御関数抽出部103での処理の具体例を示すフローチャートである。図5のフローチャートは、具体的に、ソースプログラム入力部101がソースプログラム106として図30,図31のソースプログラムを含むソースプログラム、設計情報入力部102が設計情報107として図2の排他制御関数・共有リソース名対応表および図4のタスクメイン関数リストを取得した場合の、排他制御関数抽出部103の処理を表わしている。
FIG. 5 is a flowchart illustrating a specific example of processing in the exclusive control
図5を参照して、始めに、排他制御関数抽出部103は、ステップS801において、ソースプログラム入力部101から図30,図31のソースプログラムを含むソースプログラムと、設計情報入力部102から図2の排他制御関数・共有リソース名対応表Tableと、図4のタスクメイン関数リストTaskmainTableとをそれぞれ取得する。
Referring to FIG. 5, first, in step S801, the exclusive control
次に、排他制御関数抽出部103は、対応表Table内の共有リソースすべてについて処理を行なっていない場合(ステップS802でNO)、ステップS803において、対応表Tableから共有リソースを1つ取出し、同じく対応表Tableから、この共有リソースにアクセスする関数のリストF_servを生成する。図2の排他制御関数・共有リソース名対応表Tableの場合、共有リソースAが対応表Tableから取出された場合、リストF_servは{f1}となり、共有リソースBと共有リソースCとがそれぞれ取出された場合、リストF_servは{f2}となる。
Next, when the exclusive control
続いて、排他制御関数抽出部103は、ステップS804において、リストF_serv内の各関数f()について、関数f()を呼出す関数をソースプログラムから抽出して、これをリストF_serv内の関数を呼ぶ関数のリストF_use(F_serv)に追加する。たとえば、ソースプログラムの解析により、リストF_serv内の1関数である関数f1を呼出している関数が関数g1,関数g2の2つであることが分かった場合、関数g1と関数g2とがリストF_use(F_serv)に追加される。
Subsequently, in step S804, the exclusive control
続いて、排他制御関数抽出部103は、ステップS805において、リストF_use(F_serv)内の各関数g()について、関数g()を呼出す関数をソースプログラムから抽出し、再帰的にリストF_use(F_serv)に追加する。ここで、「再帰的」にとは、関数g()を呼出す関数として、たとえば、関数h()がリストF_use(F_serv)に追加された場合、この関数h()についても、これを呼出している関数をソースプログラムから抽出し、リストF_use(F_serv)に加えることを意味する。関数g()を呼出している関数が存在しない場合、リストF_use(F_serv)内の次の関数を関数g()として同様の処理を行なう。たとえば、リストF_use(F_serv)が{g1, g2}の場合、排他制御関数抽出部103は、関数g1を呼出している関数(たとえば関数h1,関数h2)をソースプログラムから抽出し、リストF_use(F_serv)に追加する(F_use(F_serv) = {g1, g2, h1, h2})。続いて、排他制御関数抽出部103は、リストF_use(F_serv)の次の要素の関数g2についても同様にこれを呼出している関数をソースプログラムから抽出し、リストF_use(F_serv)に追加する。続いて、リストF_use(F_serv)の次の要素の関数h1について、これを呼出している関数が存在しない場合、リストF_use(F_serv)には何も追加せず、次の要素の関数h2について、これを呼出している関数の抽出を行なう。以上のような処理をリストF_use(F_serv)のすべてに対して行なう。
Subsequently, in step S805, the exclusive control
続いて、排他制御関数抽出部103は、ステップS806において、リストF_use(F_serv)内に、タスクメイン関数リストTaskmainTable内にあるタスクメイン関数がいくつあるかを数え、これが2以上の場合(ステップS806でYES)、ステップS803で取出した共有リソースが2つ以上のタスクで利用されることがわかる。そのため、排他制御関数抽出部103は、ステップS807において、排他制御不具合候補検出の対象として、ステップS803で取出した共有リソースにアクセスを行なう排他制御関数のリストF_servを排他制御関数のリストF_exclusiveに加える。一方、リストF_use(F_serv)内に、タスクメイン関数リストTaskmainTable内にあるタスクメイン関数が1つだけしか存在しない場合(ステップS806でNO)、ステップS803で取出した共有リソースは単一のタスクからのみ利用されることがわかる。そのため、排他制御関数抽出部103はこの共有リソースにアクセスを行なう排他制御関数F_servを排他制御不具合検出の対象としない。
Subsequently, in step S806, the exclusive control
排他制御関数抽出部103は、以上の処理を排他制御関数・共有リソース名対応表Table内のすべての共有リソースに対して行ない、ステップS808において、排他制御関数リストF_exclusiveを排他制御判定実行部104に出力する。
The exclusive control
排他制御判定実行部104は、排他制御関数抽出部103が出力した排他制御関数リストF_exclusiveと、設計情報入力部102が取得した排他制御関数・共有リソース名対応表および共有リソース仕様書と、ソースプログラム取得部101が取得したソースプログラムとを取得し、排他制御不具合候補を検出する。
The exclusive control
図6は、排他制御判定実行部104での処理の具体例を示すフローチャートである。図6のフローチャートは、具体的に、排他制御関数リストF_exclusiveとして{f1, f2}、図2の排他制御関数・共有リソース名対応表、図3の共有リソース仕様書、および図30,図31を含むソースプログラムが排他制御判定実行部104に与えられた場合の、排他制御判定実行部104の処理を表わしている。
FIG. 6 is a flowchart illustrating a specific example of processing in the exclusive control
図6を参照して、始めに、排他制御判定実行部104は、ステップS901において、ソースプログラム入力部101よりソースプログラムを、設計情報入力部102より排他制御関数・共有リソース名対応表と共有リソース仕様書とを、および排他制御関数抽出部103より排他制御関数リストF_exclusiveを取得する。
Referring to FIG. 6, first, in step S <b> 901, exclusive control
ステップS901で取得した排他制御関数リストF_exclusiveが空でない場合(ステップS902でNO)、排他制御判定実行部104は、ステップS903において排他制御関数リストF_exclusiveから要素を1つ取出し、これを関数f()とする。
If the exclusive control function list F_exclusive acquired in step S901 is not empty (NO in step S902), the exclusive control
次に、排他制御判定実行部104は、ステップS904において、関数f()と関数f()から呼ばれている関数とが定義されている箇所をソースプログラムから見つけ、この箇所をSourceCodeSet(f())とする。ただし、共有リソース仕様書に記載されている共有リソースアクセス用APIは含まない。たとえば、関数f()が関数f1である場合、上記ステップS904において、図30のソースプログラムにおける関数f1と関数f1から呼ばれている関数f1_1とのソースプログラムがSourceCodeSet(f())となる。
Next, in step S904, the exclusive control
次に、排他制御判定実行部104は、ステップS905において、SourceCodeSet(f())のコントロールフローグラフを生成し、関数f()のコントロールフローグラフを、SourceCodeSet(f())の関数f()以外の関数のコントロールフローグラフで展開したフローグラフ(Graph)を作成する。「コントロールフローグラフ」とは、各関数内部における制御の流れを表わすグラフである。具体的には、SourceCodeSet(f())が、図30のソースプログラムの場合、関数f1のコントロールフローグラフは図7、関数f1_1のコントロールフローグラフは図8で表わされる。上記ステップS905では、これらのグラフを用いて、関数f1について、図7のノード1001を、図8の関数f1_1のコントロールフローグラフで展開することで、図9に示される関数f1のフローグラフGraphが作成される。図31のソースプログラムに対しても同様にして、図10に示される関数f2のフローグラフGraphが作成さ
れる。
Next, in step S905, the exclusive control
次に、排他制御判定実行部104は、ステップS906において、関数f()がどの共有リソースに対してアクセスを行なうかを、ステップS901で取得した排他制御関数・共有リソース名対応表(図2)から取得する。そして、取得した共有リソース名について、その共有リソースにアクセスを行なうAPI名とそのAPIのタイプとの組の集合API_set(f())をステップS901で取得した共有リソース仕様書(図3)から抽出し、上記ステップS905で作成されたフローグラフGraphを分析する。具体的な分析方法としては、フローグラフGraphの各ノードが、共有リソースxへのロック(lock(x))、共有リソースxへのアンロック(unlock(x))、共有リソースxへのアクセス(access(x))、またはそれ以外(その他)のどれに割当てられるかを、共有リソース仕様書から抽出された上記API_set(f())内のAPI名とタイプとの対応関係より判別する。その判別結果に従って、フローグラフGraphを、イベントlock(x)、unlock(x)、access(x)、およびその他が割当てられたノードの並びに変換する。具体的に図9のフローグラフGraphを分析して上記割当てを行なう場合、上記ステップS906では図9の関数f1のフローグラフGraphより、図11に示される、関数f1のイベント割当て後のノードの並びが得られ、また、図10の関数f2のフローグラフGraphより、図12に示される、関数f2のイベント割当て後のノードの並びが得られる。
Next, the exclusive control
次に、排他制御判定実行部104は、ステップS907において、上記ステップS906で得られたノードの並びをイベント列とみなして逐次読込み、共有リソースxの初期状態をunlockとして、図13の共有リソースのロック状態遷移図に従って状態遷移を実行する。図13の状態遷移図において、状態unlockは共有リソースxにロックがかかっていない状態、状態lockはロックがかかった状態を表わしている。図13に示される状態遷移図は、共有リソースのロック状態の遷移を規定したものであって、予め排他制御判定実行部104に記憶されているものとする。ステップS907で排他制御判定実行部104は図13に示される状態遷移図に従って、これらの状態間の遷移を静的に行なっていく。具体的に、ノードの並びが図11の共有リソースAに関するノードの並びである場合、ステップS907において、排他制御判定実行部104は、初期状態unlockでノード1401であるイベントlock(A)を読込み、図13の状態遷移図に従い初期状態unlockから状態lockに遷移する。続いて、ノード1402,1403であるaccess(A)イベントを読込み、状態lockのままとする。最後に、ノード1404であるunlock(A)イベントを読込んで状態lockから状態unlockに遷移する。図12のノードの並びの場合、共有リソースがB,Cと2つあるので、排他制御判定実行部104は、図13の状態遷移図を共有リソースごとに用意し、同様に初期状態unlockから遷移を開始する。また、図12のノード1504のように、条件判断のためにフローが分岐する場合、排他制御判定実行部104は、分岐したノード1505,1510であるイベントを通るフローそれぞれについて状態遷移を行ない、排他制御不具合候補の検出を行なう。
Next, in step S907, the exclusive control
次に、排他制御判定実行部104は、ステップS908において、状態unlockでaccessイベントが発生したかどうかを調べる。状態unlockでaccessイベントが発生した場合は(ステップS908でYES)、アンロック状態の共有リソースへのアクセスが発生することになるので、排他制御判定実行部104は、ステップS910において、排他制御不具合候補として、関数f()の関数名と“アンロック状態でのアクセス”といった不具合内容を含む情報とを排他制御不具合候補リストNG_Listに追加する。たとえば、図12のノードの並びのうちノード1510のイベントを通るフローに対して状態遷移を行なう場合、共有リソースCに関するノードの並びは、順番にノード1502(lock)、ノード1510(access)、ノード1511(unlock)、ノード1507(access)、およびノード1508(unlock)となり、図13の状態遷移図に従うと、ノード1507において、状態unlockでaccessイベントが発生することがわかる。このため、排他制御判定実行部104は、上記ステップS908において、排他制御不具合候補として“関数名:f2 内容:アンロック状態でのアクセス”を排他制御不具合候補リストNG_Listに追加する。
Next, in step S908, the exclusive control
一方、状態unlockでaccessイベントが発生していない場合は(ステップS908でNO)、排他制御判定実行部104は、ステップS909において、ノードの並びの終端に到達したかを判定する。ノードの終端に到達した場合(ステップS909でYES)、さらにステップS911において、終端到達時点での共有リソースの状態を確認し、状態lockであった場合(ステップS911でYES)、ステップS910において、アンロックせずに処理を終了したとして、関数f()の関数名と“ロック状態での処理終了”といった不具合内容を含む情報とを排他制御不具合候補として排他制御不具合候補NG_Listに追加する。
On the other hand, if an access event has not occurred in the state unlock (NO in step S908), the exclusive control
図11に示されたノードの並びのように、ノード1402,1403の共有リソースへのアクセスがすべてロック状態で行なわれ、かつ、処理が終了する終端ノード1404においてアンロック状態である場合、上記ステップS908でNO、ステップS909でYES、かつステップS911でNOと判断され、排他制御不具合ではないと判断されるので、このノードの並びの排他制御不具合候補の抽出を終了し、再びステップS902からの処理を繰返す。
When the access to the shared resources of the
排他制御判定実行部104は、以上の手順を排他制御関数リストF_exclusiveが空になるまで繰返し(ステップS902でYES)、ステップS912において、図14に示されるような排他制御不具合候補リストNG_Listを排他制御不具合候補出力部105に出力する。
The exclusive control
排他制御不具合候補出力部105は、たとえば図14に示されるようなリスト形式などで、排他制御判定実行部104から取得した排他制御不具合候補を出力する。
The exclusive control defect
第1の実施の形態にかかる排他制御不具合候補抽出システムが上述のように構成されて、上述のような処理が行なわれることで、排他制御不具合の検出の際の、条件分岐網羅のためのテストデータ作成や動的解析の実行に必要な環境構築を不要として、精度よく排他制御不具合を検出することができる。従って、当該システムの利用者の手間を減らすことができる。また、排他制御不具合を検出するためのシステム構成を容易にすることができる。また、排他制御不具合を検出するため処理量を減らし、処理速度を早めることができる。 The exclusive control failure candidate extraction system according to the first embodiment is configured as described above, and the above-described processing is performed, so that a test for covering conditional branches when detecting an exclusive control failure is performed. It is possible to detect an exclusive control failure with high accuracy by eliminating the need for environment creation necessary for data creation and dynamic analysis. Therefore, it is possible to reduce the labor of the user of the system. Further, the system configuration for detecting the exclusive control failure can be facilitated. Moreover, since the exclusive control failure is detected, the processing amount can be reduced and the processing speed can be increased.
[第2の実施の形態]
図15は、本発明の第2の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。図15に示される各構成もまた、排他制御不具合候補抽出システムのCPUが記憶装置に記憶される排他制御不具合候補抽出プログラムを実行することで実現される機能である。図15に示される構成の少なくとも一部が、排他制御不具合候補抽出システムのハードウェア構成で実現されてもよい。
[Second Embodiment]
FIG. 15 is a diagram illustrating a specific example of the configuration of the exclusive control defect candidate extraction system according to the second embodiment of this invention. Each configuration shown in FIG. 15 is also a function realized by the CPU of the exclusive control defect candidate extraction system executing the exclusive control defect candidate extraction program stored in the storage device. At least a part of the configuration shown in FIG. 15 may be realized by the hardware configuration of the exclusive control defect candidate extraction system.
図15を参照して、第2の実施の形態の排他制御不具合候補抽出システムは、図1に示された第1の実施の形態の排他制御不具合候補抽出システムの構成のうち、設計情報入力部102に替えて、排他制御関数・共有リソース名対応表生成部2201、共有リソース仕様書生成部2202、およびタスクメイン関数リスト生成部2203を含んで構成される。
Referring to FIG. 15, the exclusive control defect candidate extraction system according to the second embodiment includes a design information input unit in the configuration of the exclusive control defect candidate extraction system according to the first embodiment shown in FIG. Instead of 102, an exclusive control function / shared resource name correspondence
設計情報2204は、図16に示されるような、共有リソース名と、共有リソースに対してロック・アンロックを行なう関数の関数名と、ロック・アンロックのいずれかである関数のタイプとを含む共有リソース・ロックアンロック関数対応表、およびタスクを生成する関数名を含む。設計情報2204は、排他制御関数・共有リソース名対応表生成部2201、共有リソース仕様書生成部2202、およびタスクメイン関数リスト生成部2203で入力され、取得される。
The
共有リソース仕様書生成部2202は、取得した設計情報2204に含まれる共有リソース・ロックアンロック関数対応表に記載された共有リソースにアクセスしている関数を、ソースプログラム入力部101で取得したソースプログラム106から抽出し、取得した共有リソース・ロックアンロック関数対応表に追加することにより共有リソース仕様書を生成する。
The shared resource
排他制御関数・共有リソース名対応表生成部2201は、共有リソース仕様書生成部2202で生成された共有リソース仕様書に記載された共有リソースアクセス関数を呼出している関数を、ソースプログラム入力部101で取得したソースプログラム106から抽出し、排他制御関数・共有リソース名対応表を生成する。
The exclusive control function / shared resource name correspondence
タスクメイン関数リスト生成部2203は、取得した設計情報2204に含まれるタスクを生成する関数を呼出している箇所を、ソースプログラム入力部101で取得したソースプログラム106から検索し、上記関数の引数として記載されているタスクメイン関数を抽出してタスクメイン関数リストを生成する。
The task main function
排他制御関数・共有リソース名対応表生成部2201で生成された排他制御関数・共有リソース名対応表は、排他制御関数抽出部103、排他制御判定実行部104での処理に用いられる。共有リソース仕様書生成部2202で生成された共有リソース仕様書は、排他制御判定実行部104での処理に用いられる。タスクメイン関数リスト生成部2203で生成されたタスクメイン関数リストは、排他制御関数抽出部103での処理に用いられる。
The exclusive control function / shared resource name correspondence table generated by the exclusive control function / shared resource name correspondence
図17は、共有リソース仕様書生成部2202および排他制御関数・共有リソース名対応表生成部2201での処理の具体例を示すフローチャートである。図17のフローチャートは、具体的に、図16に示された共有リソース・ロックアンロック関数対応表、および図30,図18の、共有リソースAにアクセスする関数のソースプログラムを含むソースプログラムを使用して、共有リソース仕様書生成部2202が共有リソース仕様書を生成し、排他制御関数・共有リソース名対応表生成部2201が排他制御関数・共有リソース名対応表を生成する処理を表わしている。
FIG. 17 is a flowchart illustrating a specific example of processing in the shared resource
図17を参照して、始めに、共有リソース仕様書生成部2202は、ステップS1801において、図16に示される共有リソース・ロックアンロック関数対応表Var_Comと、図30,図18のソースプログラムを含むソースプログラムとを取得する。対応表Var_Com内の共有リソースすべてについて調べていない場合(ステップS1802でNO)、共有リソース仕様書生成部2202は、ステップS1803において、対応表Var_Comから共有リソースをv_cとして取得する。たとえば、図16に示される共有リソース・ロックアンロック関数対応表Var_Comからは、共有リソースA,B,Cをそれぞれv_cとして取得する。
Referring to FIG. 17, first, shared resource
次に、共有リソース仕様書生成部2202は、ステップS1804において、上記ステップS1801で入力されたソースプログラムを検索し、共有リソースv_cに対して代入または参照が行なわれている箇所を見つけ、この箇所を含む関数群を関数群F_list(v_c)とする。上記ステップS1801で図18のソースプログラムが与えられた場合、ステップS1803で取得した共有リソースv_cが共有リソースAであれば行2101,2102の箇所が該当するため、ステップS1804において、図19に示されるように、共有リソースAにアクセスする関数のリストである関数群F_list(v_c)として関数ACCESS_READ_A,ACCESS_WRITE_Aが抽出される。共有リソース仕様書生成部2202は、これらを共有リソースv_cのアクセス関数として対応表Var_Comに追加し、共有リソース仕様書を生成する。
Next, in step S1804, the shared resource
次に、排他制御関数・共有リソース名対応表生成部2201は、ステップS1805において、上記ステップS1801で入力されたソースプログラムを検索し、共有リソース仕様書Var_Com内の共有リソースv_cにアクセスを行なう関数群F_list(v_c)に含まれる関数を呼出している関数を見つけ、この関数群を関数群F_call(F_list(v_c))とする。上記ステップS1804において関数群F_list(v_c)として図19の関数が抽出された場合、ステップS1805では、図30のソースプログラムを含むソースプログラムの検索により、図30のソースプログラムの行202の、関数群F_list(v_c)内の関数を呼出している関数f1が関数群F_call(F_list(v_c))の1つとして抽出される。
Next, in step S1805, the exclusive control function / shared resource name correspondence
次に、排他制御関数・共有リソース名対応表生成部2201は、ステップS1806において、関数群F_call(F_list(v_c))内の関数ごとに、共有リソース名として共有リソースv_cを対応付け、排他制御関数・共有リソース名対応表m_listに追加する。共有リソースv_cが共有リソースAで、関数群F_call(F_list(v_c))内の関数が図30の関数f1であった場合、ステップS1806では、関数f1と共有リソースAとが対応付けられて排他制御関数・共有リソース名対応表m_listに追加され、図20に示される共有リソースAの共有リソース仕様書が生成される。以上の処理が全共有リソース対して繰返されると(ステップS1802でYES)、排他制御関数・共有リソース名対応表生成部2201は、ステップS1807において、生成した共有リソース仕様書Var_Comを図3と同様の形式で排他制御判定実行部104に対して出力し、また、生成した排他制御関数・共有リソース名対応表m_listを図2と同様の形式で排他制御関数抽出部103と排他制御判定実行部104とに対して出力する。
Next, in step S1806, the exclusive control function / shared resource name correspondence
第2の実施の形態にかかる排他制御不具合候補抽出システムが上述のように構成されて、上述のような処理が行なわれることで、第1の実施の形態にかかる排他制御不具合候補抽出システムに比べ、必要な設計情報を、排他制御関数・共有リソース名対応表、共有リソース仕様書、およびタスクメイン関数リストから、共有リソース・ロックアンロック関数対応表とタスク生成関数とに削減できる。そのため、当該システムの利用者の、入力として与える設計情報を作成するための手間を減らすことが可能となる。 The exclusive control defect candidate extraction system according to the second embodiment is configured as described above, and the processing as described above is performed, so that the exclusive control defect candidate extraction system according to the first embodiment is compared. Necessary design information can be reduced from the exclusive control function / shared resource name correspondence table, the shared resource specification, and the task main function list to the shared resource / lock unlock function correspondence table and the task generation function. For this reason, it is possible to reduce the effort for the user of the system to create design information given as input.
[第3の実施の形態]
第1の実施の形態にかかる排他制御不具合候補抽出システムでは、図21に示されるような共有リソースDに対して直接アクセスする記述を含む関数f3のソースプログラムと、図22に示されるような排他制御関数候補・共有リソース名対応表と、図23に示されるような共有リソースDの共有リソース仕様書とが与えられている。関数f3が複数のタスクから呼ばれる関数であった場合、排他制御判定実行部104は、図6のフローチャートに従い、ステップS905において図24に示される関数f3のフローグラフGraphを生成する。さらに、ステップS906において、図22の排他制御関数候補・共有リソース名対応表と図23の共有リソース仕様書とを用いて、図25に示される関数f3のイベント割当て後のノードの並びを生成する。ここで、共有リソースに対して直接アクセスを行なう記述とは、ソースプログラム上で共有リソースに代入を行なう文または、共有リソースを参照する文を指す。図21のソースプログラムの行2601では共有リソースDへのアクセスが行なわれているにもかかわらず、そのアクセス方法(直接アクセス)が図23の共有リソース仕様書に記載されている以外の方法であるため、ステップS906では、図25のノード2903に”その他”が割当てられてしまう。このため、第1の実施の形態にかかる排他制御不具合候補抽出システムでは、図25のノードの並びより、ノード2903においてアンロック状態での共有リソースDへのアクセスが行なわれると判定できず、図21のソースプログラムの行2601の箇所を排他制御不具合として検出することができない。
[Third Embodiment]
In the exclusive control defect candidate extraction system according to the first embodiment, the source program of the function f3 including a description for directly accessing the shared resource D as shown in FIG. 21, and the exclusive control as shown in FIG. A function candidate / shared resource name correspondence table and a shared resource specification of the shared resource D as shown in FIG. 23 are given. When the function f3 is a function called from a plurality of tasks, the exclusive control
第3の実施の形態にかかる排他制御不具合候補抽出システムは、共有リソースに対して直接的なアクセスが行なわれている場合でも、排他制御不具合が検出できるようにしたものである。 The exclusive control defect candidate extraction system according to the third embodiment is configured such that an exclusive control defect can be detected even when a shared resource is directly accessed.
図26は、本発明の第3の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。図26に示される各構成もまた、排他制御不具合候補抽出システムのCPUが記憶装置に記憶される排他制御不具合候補抽出プログラムを実行することで実現される機能である。図26に示される構成の少なくとも一部が、排他制御不具合候補抽出システムのハードウェア構成で実現されてもよい。 FIG. 26 is a diagram illustrating a specific example of the configuration of the exclusive control defect candidate extraction system according to the third embodiment of this invention. Each configuration shown in FIG. 26 is also a function realized by the CPU of the exclusive control defect candidate extraction system executing the exclusive control defect candidate extraction program stored in the storage device. 26 may be realized by the hardware configuration of the exclusive control defect candidate extraction system.
図26を参照して、第3の実施の形態の排他制御不具合候補抽出システムは、図1に示された第1の実施の形態の排他制御不具合候補抽出システムの構成に加えて、共有リソース仕様書・ソースプログラム変更部2501を含んで構成される。
Referring to FIG. 26, the exclusive control defect candidate extraction system according to the third embodiment has a shared resource specification in addition to the configuration of the exclusive control defect candidate extraction system according to the first embodiment shown in FIG. A document / source
共有リソース仕様書・ソースプログラム変更部2501は、ソースプログラム入力部101からソースプログラムを取得し、設計情報入力部102から設計情報として共有リソース仕様書を取得する。共有リソース仕様書・ソースプログラム変更部2501は、共有リソース仕様書に記載された共有リソースにアクセスしている箇所をソースプログラムから検索し、ソースプログラムの共有リソースアクセス箇所を擬似関数に変更すると共に、共有リソース仕様書に擬似関数名をアクセス関数として追加する。
The shared resource specification / source
具体的には、ソースプログラム入力部101から図21のソースプログラムを、設計情報入力部102から図23の共有リソース仕様書を取得した場合、共有リソース仕様書・ソースプログラム変更部2501は、図21のソースプログラムから行2601のように共有リソースDに直接アクセスしている箇所を検索し、その箇所を共有リソース名Dを含む特定の文字列(たとえばTRANS_ACCESS_D)に置換する。図21のソースプログラムの行2601は、共有リソース仕様書・ソースプログラム変更部2501によって図27の行3001のように変更される。さらに、共有リソース仕様書・ソースプログラム変更部2501は、置換した文字列(たとえばTRANS_ACCESS_D)を共有リソースDのアクセス関数として共有リソース仕様書に追加する。図23の共有リソースDの共有リソース仕様書に、図28の行3101に示されるように、置換した文字列およびタイプが追加される。
Specifically, when the source program of FIG. 21 is acquired from the source
他の構成における処理は、第1の実施の形態にかかる排他制御不具合候補抽出システムの構成での同一である。第3の実施の形態にかかる排他制御不具合候補抽出システムでは、共有リソース仕様書・ソースプログラム変更部2501での処理によって、ソースプログラム入力部101から入力されたソースプログラム106である図21のソースプログラムは図27に示されるように変更され、設計情報入力部102から入力された設計情報107としての図23の共有リソース仕様書は図28のように変更される。そのため、第3の実施の形態にかかる排他制御不具合候補抽出システムでは、排他制御判定実行部104は、図29に示されるように関数f3のイベント割当て後のノードの並びを生成することができ、ノード3203の箇所でアンロック状態での共有リソースアクセスが行なわれていることを検出できる。
The processing in the other configuration is the same in the configuration of the exclusive control defect candidate extraction system according to the first embodiment. In the exclusive control defect candidate extraction system according to the third embodiment, the source program of FIG. 21 which is the
第3の実施の形態にかかる排他制御不具合候補抽出システムが上述のように構成されて、上述のような処理が行なわれることで、ソースプログラムに共有リソースに対して直接アクセスしている記述が含まれている場合でも、排他制御不具合候補の抽出を行なうことができる。そのため、第1の実施の形態にかかる排他制御不具合候補抽出システムでの不具合検出精度を向上させることができる。 The exclusive control defect candidate extraction system according to the third embodiment is configured as described above, and the processing as described above is performed, so that the source program includes a description that directly accesses the shared resource. Even in such a case, it is possible to extract exclusive control defect candidates. Therefore, the defect detection accuracy in the exclusive control defect candidate extraction system according to the first embodiment can be improved.
[第4の実施の形態]
図34は、本発明の第4の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。図34に示される各構成もまた排他制御不具合候補抽出システムのCPUが記憶装置に記憶される排他制御不具合候補抽出プログラムを実行することで実現される機能である。図34に示される構成の少なくとも一部が、排他制御不具合候補抽出システムのハードウェア構成で実現されてもよい。
[Fourth Embodiment]
FIG. 34 is a diagram illustrating a specific example of the configuration of the exclusive control defect candidate extraction system according to the fourth embodiment of this invention. Each configuration shown in FIG. 34 is also a function realized by the CPU of the exclusive control defect candidate extraction system executing the exclusive control defect candidate extraction program stored in the storage device. 34 may be realized by the hardware configuration of the exclusive control defect candidate extraction system.
図34を参照して、第4の実施の形態の排他制御不具合候補抽出システムは、図15に示された第2の実施の形態の排他制御不具合候補抽出システムの構成に加えて、共有リソース名リスト生成部4001、および共有リソース・ロックアンロック関数対応表生成部4002を含んで構成される。
Referring to FIG. 34, the exclusive control defect candidate extraction system according to the fourth embodiment has a shared resource name in addition to the configuration of the exclusive control defect candidate extraction system according to the second embodiment shown in FIG. A
第4の実施の形態における設計情報4003は、図35に示されるような記憶領域指定修飾子名リストと、図36に示されるようなロック・アンロック関数名リストと、図41に示されるようなタスク生成関数名リストを含む。
The
図35を参照して、記憶領域指定修飾子名リストは、共有リソースと成り得る変数の宣言に使用する記憶領域を指定する修飾子名と、修飾子が指定を行なう宣言のタイプとを含むリストである。図36を参照して、ロック・アンロック関数名リストは、共有リソースに対してロック・アンロックを行なう関数の関数名とロック・アンロックのいずれかである関数のタイプとを含むリストである。図41を参照して、タスク生成関数名リストは、タスクを生成する関数の関数名を含むリストである。 Referring to FIG. 35, the storage area specification qualifier name list is a list including a qualifier name that specifies a storage area used for declaration of a variable that can be a shared resource, and a type of declaration that the qualifier specifies. It is. Referring to FIG. 36, the lock / unlock function name list is a list including a function name of a function that performs lock / unlock on a shared resource and a function type that is either lock / unlock. . Referring to FIG. 41, the task generation function name list is a list including function names of functions that generate tasks.
第4の実施の形態において、設計情報4003は、共有ソース名リスト生成部4001、共有リソース・ロックアンロック関数対応表生成部4002、およびタスクメイン関数リスト生成部2203に入力される。
In the fourth embodiment, the
共有リソース名リスト生成部4001は、ソースプログラム入力部101で取得したソースプログラム106と、取得した設計情報4003に含まれる記憶領域指定修飾子名リストとから、ソースプログラム106に含まれる共有リソースを抽出し、共有リソース名リストを生成する。生成された共有リソース名リストは、共有リソース・ロックアンロック関数対応表生成部4002に入力され、共有リソース・ロックアンロック関数対応表生成部4002での処理に用いられる。
The shared resource name
共有リソース・ロックアンロック関数対応表生成部4002は、共有リソース名リスト生成部4001で生成された共有リソース名リストと、取得した設計情報4003に含まれるロック・アンロック関数名リストとから、各共有リソースのためのロック関数とアンロック関数とを抽出し、共有リソース名・ロックアンロック関数対応表を生成する。生成された共有リソース・ロックアンロック関数対応表は、共有リソース仕様書生成部2202に入力され、共有リソース仕様書生成部2202での処理に用いられる。
The shared resource / lock / unlock function correspondence
図38は、共有リソース名リスト生成部4001での処理の具体例を示すフローチャートである。図38のフローチャートは、具体的に、図35で示された記憶領域指定修飾子名リストと、図40に示される、変数宣言を行なっているソースプログラム(図40のL1〜L3)を含むソースプログラムとを使用して、図37の、共有リソース名リストを生成する処理を表わしている。
FIG. 38 is a flowchart illustrating a specific example of processing in the shared resource name
図38を参照して、始めに、共有リソース名リスト生成部4001は、ステップS4101において、図35に示される記憶領域指定修飾子名リストと、図40のソースプログラムを含むソースプログラムとを取得する。ステップS4102において、共有リソース名リスト生成部4001は、図40のソースプログラムを検索し、変数宣言している箇所(図40のL1〜L3)を見つけ、この変数群のリストをvar_listとして取得する。たとえば、図40のソースプログラムの場合、変数群のリストはvar_list=[A,B,C]となる。リストvar_list内の変数すべてについて調べていない場合(ステップS4103でNO)、共有リソース名リスト生成部4001は、ステップS4104において、変数群のリストvar_listから変数vを取得する。たとえば、図40に示されるソースプログラムからは、共有リソース候補A、B、Cをそれぞれ変数vとして取得する。
Referring to FIG. 38, first, shared resource name
次に、共有リソース名リスト生成部4001は、変数vが大域変数(関数定義の外で宣言された変数)であるか否かを判断し、そうである場合(ステップS4105でYES)、ステップS4106において、変数vを共有リソース名として共有リソース名リストc_listに追加する。たとえば、図40に示されるソースプログラムからは、変数A、B、Cが共有リソース名として共有リソース名リストc_listに追加される。
Next, the shared resource name
以上の処理が全変数に対して繰返される。全変数に対して以上の処理が終了すると(ステップS4013でYES)、図34の共有リソース名リスト生成部4001は、ステップS4107において、生成した共有リソース名リストを図37と同様の形式で共有リソース・ロックアンロック関数対応表生成部4002に対して出力する。
The above process is repeated for all variables. When the above processing is completed for all variables (YES in step S4013), the shared resource name
なお、ステップ4105において、変数vが大域変数ではないと判断された場合(ステップS4105でNO)、処理がステップS4108に進む。たとえば、入力が、図42に示される、関数f内に変数D,E,Gが宣言されているソースプログラムである場合、ステップS4102において、共有リソース名リスト生成部4001は、変数群のリストvar_list=[D,E]を取得し、ステップ4104において、変数D、Eを共有リソースの候補である変数vとして取得する。このとき、共有リソース名リスト生成部4001において変数vは大域変数ではないと判断されるため(ステップS4105でNO)、処理がステップS4108に進む。
If it is determined in
次に、ステップS4108において、共有リソース名リスト生成部4001は、変数vに対して宣言を行なっている関数f_callを取得する。たとえば、入力が図42に示されるソースプログラムである場合、ステップS4108において関数f_call=fが取得される。
Next, in step S4108, the shared resource name
次に、共有リソース名リスト生成部4001は変数vが静的変数宣言されているか否かを判断し、そうである場合(ステップS4109でYES)、ステップS4106で変数vを共有リソース名リストc_listに追加する。たとえば、変数v=Dの場合、共有リソース名リスト生成部4001は変数Dである変数vが静的変数宣言されていると判断し、ステップ4106で変数を共有リソース名リストc_listに追加する。これにより、共有リソース名リストc_list=[D]となる。
Next, the shared resource name
一方、変数vが静的変数宣言されていないと判断した場合、つまり外部変数宣言されていると判断された場合(ステップS4109でNO)、処理がステップS4110に進む。次に、共有リソース名リスト生成部4001は、関数f_call内で初めて変数vが宣言されているか否かを判断し、そうである場合(ステップS4110でYES)、ステップS4106において、変数vを共有リソース名リストc_listに追加する。たとえば、変数v=Eの場合、共有リソース名リスト生成部4001は、変数Eである変数vが外部変数宣言されていると判断し(ステップS4109でNO)、さらに変数vが関数f_call内で初めて宣言されていると判断し(ステップS4110でYES)、変数Eを共有リソース名リストc_listに追加する。これにより、共有リソース名リストc_list=[E]となる。
On the other hand, when it is determined that the variable v is not declared as a static variable, that is, when it is determined that an external variable is declared (NO in step S4109), the process proceeds to step S4110. Next, the shared resource name
図39は、共有リソース・ロックアンロック関数対応表生成部4002の処理の具体例を示すフローチャートである。図39のフローチャートは、具体的に、図37に示される共有リソース名リストと、図36に示されるロック・アンロック関数名リストとを使用して、図16に示される共有リソース・ロックアンロック関数対応表を生成する処理を表わしている。
FIG. 39 is a flowchart showing a specific example of processing of the shared resource / unlock function correspondence
図39を参照して、始めに、共有リソース・ロックアンロック関数対応表生成部4002は、ステップS4201において、図37に示される共有リソース名リストc_listと、図36に示されるロック・アンロック関数名リストl_listを取得する。次に、ステップS4202で、共有リソース・ロックアンロック関数対応表生成部4002は、ロック・アンロック関数名リストl_list中の、タイプがlockである関数をロック関数f_lとし、タイプがunlockである関数をアンロック関数f_uとする。たとえば、図36に示されるロック・アンロック関数名リストl_listを入力として取得した場合、共有リソース・ロックアンロック関数対応表生成部4002は、ロック関数f_l=LOCK、アンロック関数f_u=UNLOCKとする。
Referring to FIG. 39, first, in step S4201, the shared resource / lock / unlock function correspondence
次に、共有リソース名リストc_list内の変数全てについて以降の処理を行なって調べていない場合(ステップS4203でNO)、共有リソース名リスト生成部4002は、ステップ4204において、共有リソース名リストc_listから共有リソース名v_cを取得する。たとえば、図37に示される共有リソース名リストc_listからは、共有リソース名A、B、Cを共有リソース名v_cとして取得する。
Next, when all the variables in the shared resource name list c_list have not been checked by performing the following processing (NO in step S4203), the shared resource name
次に、共有リソース・ロックアンロック関数対応表生成部4002は、ステップS4205において、共有リソースv_cとロック関数f_lとから抽出した共有リソースv_cのためのロック関数を関数f_l(v_c)とし、共有リソースv_cとアンロック関数f_uとから抽出した共有リソースv_cのためのアンロック関数を関数f_u(v_c)とする。たとえば、図37に示される共有リソース名リストと、図36に示されるロック・アンロック関数名リストとを入力として取得した場合、共有リソース・ロックアンロック関数対応表生成部4002は、変数v_c=Aのときロック関数f_l(v_c)=LOCK(A)、アンロック関数f_u(v_c)=UNLOCK(A)とする。
Next, in step S4205, the shared resource / lock / unlock function correspondence
次に、共有リソース・ロックアンロック関数対応表生成部4002は、ステップS4206において、共有リソースv_cとロック関数f_l(v_c)とタイプlockとを対応付け3つ組みとし、対応表cl_tableに追加し、共有リソースv_cとアンロック関数f_u(v_c)とタイプunlockとを対応付け3つ組みとし、対応表cl_tableに追加する。たとえば、図37に示される共有リソース名リストと、図36に示されるロック・アンロック関数名リストとを入力として取得した場合、共有リソース・ロックアンロック関数対応表生成部4002は、変数v_c=Aのとき、対応表cl_table=[(A,LOCK(A),lock), (A,UNLOCK(A),unlock)]となる。
Next, in step S4206, the shared resource / lock / unlock function correspondence
以上の処理が共有リソース名リストc_list内の変数全てについて繰返されると(ステップS4203でYES)、共有リソース・ロックアンロック関数対応表生成部4002は、ステップS4202において、生成した共有リソース・ロックアンロック対応表cl_tableを図16と同様の形式で、共有リソース仕様書生成部2202に対して出力する。
When the above processing is repeated for all variables in the shared resource name list c_list (YES in step S4203), the shared resource / lock unlock function correspondence
第4の実施の形態にかかる排他制御不具合候補抽出システムが上述のように構成されて、上述のような処理が行なわれることで、第2の実施の形態にかかる排他制御不具合候補抽出システムに比べ、少ない手数で排他制御不具候補の抽出システムの入力の作成が可能となる。 The exclusive control defect candidate extraction system according to the fourth embodiment is configured as described above, and the processing as described above is performed, so that the exclusive control defect candidate extraction system according to the second embodiment is compared. Therefore, it is possible to create an input of an extraction system for exclusive control disabled candidates with a small number of steps.
すなわち、第2の実施の形態の入力では、共有リソース・ロック・アンロック関数対応表には、共有リソース名が含まれているが、大規模な開発の場合、百万行を超えるソースコードの中から数千に及ぶ共有リソース名を抽出するということも考えられ、手間となる場合もあり得る。それに対して、第4の実施の形態の入力では、記憶領域指定修飾子名リストは、変数宣言において記憶領域を指定するための修飾子名を含む。共有リソースの可能性がある変数は、その記憶領域から判断することが可能である。通常共有リソース名を判断するために入力すべき記憶領域を指定する修飾子は数種類(たとえばC言語の場合は2種類)であり、共有リソース名を入力する場合に比べて手数が少ない。ロック・アンロック関数名リストは、共有リソース・ロックアンロック関数対応表を設定するためのもので、通常数種類ある。これは共有リソースごとにロック・アンロック関数を入力する必要のある第2の実施の形態に比べ、少ない手数で設定できる。これらのことより第4の実施の形態では第2の実施の形態より、入力の作成にかかる手数を減らすことが可能となる。 That is, in the input of the second embodiment, the shared resource / lock / unlock function correspondence table includes the shared resource name, but in the case of large-scale development, the source code of more than 1 million lines It may be possible to extract thousands of shared resource names from the inside, which may be troublesome. On the other hand, in the input of the fourth embodiment, the storage area designation qualifier name list includes a qualifier name for designating a storage area in the variable declaration. A variable that may be a shared resource can be determined from the storage area. Usually, there are several types of modifiers (for example, two types in the case of C language) for designating the storage area to be input in order to determine the shared resource name, and the number of qualifiers is less than that in the case of inputting the shared resource name. The lock / unlock function name list is for setting a shared resource / lock / unlock function correspondence table, and usually has several types. This can be set with fewer steps than in the second embodiment in which a lock / unlock function needs to be input for each shared resource. From the above, in the fourth embodiment, it is possible to reduce the number of steps required to create an input compared to the second embodiment.
さらに、上述の排他制御不具合候補抽出システムにおける処理をコンピュータに実行させる排他制御不具合候補抽出プログラムを提供することもできる。このようなプログラムは、コンピュータに付属するフレキシブルディスク、CD−ROM(Compact Disk-Read Only Memory)、ROM(Read Only Memory)、RAM(Random Access Memory)およびメモリカードなどのコンピュータ読取り可能な記録媒体にて記録させて、プログラム製品として提供することもできる。あるいは、コンピュータに内蔵するハードディスクなどの記録媒体にて記録させて、プログラムを提供することもできる。また、ネットワークを介したダウンロードによって、プログラムを提供することもできる。 Furthermore, it is possible to provide an exclusive control defect candidate extraction program that causes a computer to execute processing in the above-described exclusive control defect candidate extraction system. Such a program is stored in a computer-readable recording medium such as a flexible disk attached to the computer, a CD-ROM (Compact Disk-Read Only Memory), a ROM (Read Only Memory), a RAM (Random Access Memory), and a memory card. And can be provided as a program product. Alternatively, the program can be provided by being recorded on a recording medium such as a hard disk built in the computer. A program can also be provided by downloading via a network.
なお、本発明にかかるプログラムは、コンピュータのオペレーションシステム(OS)の一部として提供されるプログラムモジュールのうち、必要なモジュールを所定の配列で所定のタイミングで呼出して処理を実行させるものであってもよい。その場合、プログラム自体には上記モジュールが含まれずOSと協働して処理が実行される。このようなモジュールを含まないプログラムも、本発明にかかるプログラムに含まれ得る。 The program according to the present invention is a program module that is provided as a part of a computer operating system (OS) and calls necessary modules in a predetermined arrangement at a predetermined timing to execute processing. Also good. In that case, the program itself does not include the module, and the process is executed in cooperation with the OS. A program that does not include such a module can also be included in the program according to the present invention.
また、本発明にかかるプログラムは他のプログラムの一部に組込まれて提供されるものであってもよい。その場合にも、プログラム自体には上記他のプログラムに含まれるモジュールが含まれず、他のプログラムと協働して処理が実行される。このような他のプログラムに組込まれたプログラムも、本発明にかかるプログラムに含まれ得る。 The program according to the present invention may be provided by being incorporated in a part of another program. Even in this case, the program itself does not include the module included in the other program, and the process is executed in cooperation with the other program. Such a program incorporated in another program can also be included in the program according to the present invention.
提供されるプログラム製品は、ハードディスクなどのプログラム格納部にインストールされて実行される。なお、プログラム製品は、プログラム自体と、プログラムが記録された記録媒体とを含む。 The provided program product is installed in a program storage unit such as a hard disk and executed. The program product includes the program itself and a recording medium on which the program is recorded.
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
101 ソースプログラム入力部、102 設計情報入力部、103 排他制御関数抽出部、104 排他制御判定実行部、105 排他制御不具合候補出力部、106 ソースプログラム、107,4003 設計情報、2201 排他制御関数・共有リソース名対応表生成部、2202 共有リソース仕様書生成部、2203 タスクメイン関数リスト生成部、2501 共有リソース仕様書・ソースプログラム変更部、4001 共有リソース名リスト生成部、4002 共有リソース・ロックアンロック関数対応表生成部。
101 source program input unit, 102 design information input unit, 103 exclusive control function extraction unit, 104 exclusive control determination execution unit, 105 exclusive control defect candidate output unit, 106 source program, 107,4003 design information, 2201 exclusive control function / shared Resource name correspondence
Claims (14)
抽出された前記排他制御関数に対し、排他制御できているか否かを判定する処理を実行する排他制御判定実行手段とを備える、排他制御不具合候補抽出装置。 An exclusive control function extracting means for extracting an exclusive control function that is a function for accessing a shared resource from a software configuration;
An exclusive control defect candidate extraction device comprising: exclusive control determination execution means for executing processing for determining whether or not exclusive control can be performed on the extracted exclusive control function.
前記ソフトウェア構成の複数のタスク上で利用される共有リソースにアクセスを行なう排他制御関数を特定する際、前記ソフトウェア構成のうち、タスクを生成する関数名を呼出している箇所の記載に基づいて前記タスクの起動時に最初に呼出される関数名のリストであるタスクメイン関数リストを作成する処理と、
前記タスクメイン関数リストから呼出されている関数を辿っていく処理とを行なって、前記排他制御関数が前記ソフトウェア構成の複数タスク上で利用される共有リソースにアクセスを行なうか否かを判定し、前記判断結果に基づいて前記排他制御関数を特定する、請求項4に記載の排他制御不具合候補抽出装置。 The exclusive control function extracting means includes
When specifying an exclusive control function for accessing a shared resource used on a plurality of tasks of the software configuration, the task is based on a description of a location where a function name that generates a task is called in the software configuration. Creating a task main function list, which is a list of function names that will be called first when
Performing a process of tracing a function called from the task main function list, and determining whether or not the exclusive control function accesses a shared resource used on a plurality of tasks of the software configuration, The exclusive control defect candidate extraction device according to claim 4, wherein the exclusive control function is specified based on the determination result.
前記排他制御関数抽出手段は、前記対応関係に基づいて前記排他制御関数を抽出する、請求項1〜6のいずれかに記載の排他制御不具合候補抽出装置。 The software design information further includes an acquisition unit for acquiring a correspondence relationship between the shared resource and a function for accessing the shared resource included in the software configuration,
The exclusive control defect candidate extracting device according to claim 1, wherein the exclusive control function extracting unit extracts the exclusive control function based on the correspondence relationship.
前記ソフトウェア構成から前記対応関係に規定されている前記共有リソースへのアクセス関数を抽出するアクセス関数抽出手段とをさらに含み、
前記排他制御関数抽出部は、前記ソフトウェア構成から前記アクセス関数を呼出している関数を前記排他制御関数として抽出する、請求項1〜6のいずれかに記載の排他制御不具合候補抽出装置。 For each shared resource, an acquisition means for acquiring a correspondence relationship between the shared resource and a function that locks / unlocks the shared resource;
An access function extracting unit that extracts an access function to the shared resource defined in the correspondence relationship from the software configuration;
The exclusive control defect candidate extracting device according to claim 1, wherein the exclusive control function extracting unit extracts a function calling the access function from the software configuration as the exclusive control function.
前記ソフトウェアと前記記憶領域とを指定する修飾子のリストから前記共有リソースのリストを抽出する共有リソース抽出手段と、
前記共有リソースのリストから前記ソフトウェアに含まれる前記共有リソースにアクセスする関数と前記共有リソースとの対応関係を抽出する対応関係抽出手段とをさらに含み、
前記排他制御関数抽出手段は、前記対応関係に基づいて前記排他制御関数を抽出する、
請求項1〜6のいずれかに記載の排他制御不具合候補抽出装置。 Qualifier acquisition means for acquiring a qualifier that specifies a storage area used for the declaration of a variable that can be a shared resource;
Shared resource extraction means for extracting the list of shared resources from a list of qualifiers that specify the software and the storage area;
A correspondence relationship extracting unit that extracts a correspondence relationship between the shared resource and a function that accesses the shared resource included in the software from the list of the shared resource;
The exclusive control function extracting means extracts the exclusive control function based on the correspondence;
The exclusive control defect candidate extraction device according to claim 1.
前記共有リソースに対してロック・アンロックを行なう関数のリストを取得するロック・アンロック関数取得手段と、
前記ソフトウェアと前記記憶領域を指定する修飾子のリストとから前記共有リソースのリストを抽出する共有リソース抽出手段と、
前記ロック・アンロックを行なう関数のリストと前記共有リソースのリストとから、前記共有リソースごとに前記共有リソースと前記共有リソースに対してロック・アンロックを行なう関数との対応関係を抽出する対応関係抽出手段と、
前記ソフトウェアから前記対応関係に規定されている前記共有リソースへのアクセス関数を抽出するアクセス関数抽出手段とをさらに含み、
前記排他制御関数抽出手段は、前記ソフトウェアから前記アクセス関数を呼出している関数を前記排他制御関数として抽出する、請求項1〜6のいずれかに記載の排他制御不具合候補抽出装置。 Qualifier acquisition means for acquiring a qualifier that specifies a storage area used for the declaration of a variable that can be a shared resource;
Lock / unlock function acquisition means for acquiring a list of functions for performing lock / unlock on the shared resource;
Shared resource extraction means for extracting the list of shared resources from the software and a list of modifiers specifying the storage area;
Correspondence that extracts a correspondence between the shared resource and a function that locks / unlocks the shared resource for each shared resource from the list of functions that perform the lock / unlock and the list of shared resources Extraction means;
An access function extracting means for extracting an access function to the shared resource defined in the correspondence relationship from the software;
The exclusive control defect candidate extracting device according to claim 1, wherein the exclusive control function extracting unit extracts a function calling the access function from the software as the exclusive control function.
前記共有リソースに直接アクセスしている箇所を前記ソフトウェアより抽出し、当該個所を特定の文字列に置き換える処理と、前記特定の文字列を前記共有リソースへのアクセス関数として前記対応関係に加える処理とを行なう変更手段とをさらに含み、
前記排他制御関数抽出部は、前記ソフトウェアから前記アクセス関数を呼出している関数を前記排他制御関数として抽出する、請求項1〜7のいずれかに記載の排他制御不具合候補抽出装置。 Acquisition means for acquiring, for each shared resource, the shared resource, a function that performs locking / unlocking on the shared resource, and a correspondence relationship between the access function to the shared resource;
A process of extracting a part directly accessing the shared resource from the software, replacing the part with a specific character string, and a process of adding the specific character string to the correspondence as an access function to the shared resource. And further changing means to perform,
The exclusive control defect candidate extracting device according to claim 1, wherein the exclusive control function extracting unit extracts a function calling the access function from the software as the exclusive control function.
前記入力手段において、ソフトウェア構成を入力するステップと、
前記演算手段において、前記ソフトウェア構成より共有リソースにアクセスする関数である排他制御関数を抽出するステップと、
前記演算手段において、抽出された前記排他制御関数に対し、排他制御できているか否かを判定するステップと、
前記出力手段において、前記判断の結果を出力するステップとを備える、排他制御不具合候補抽出方法。 An exclusive control defect candidate extraction method in an exclusive control defect candidate extraction apparatus comprising an input means, a calculation means, and an output means,
In the input means, inputting a software configuration;
In the computing means, extracting an exclusive control function that is a function for accessing a shared resource from the software configuration;
In the computing means, determining whether or not exclusive control is possible for the extracted exclusive control function; and
And a step of outputting the result of the determination in the output means.
前記コンピュータは、入力手段と、演算手段と、出力手段とを備え、
前記入力手段において、ソフトウェア構成を入力するステップと、
前記演算手段において、前記ソフトウェア構成より共有リソースにアクセスする関数である排他制御関数を抽出するステップと、
前記演算手段において、抽出された前記排他制御関数に対し、排他制御できているか否かを判定するステップと、
前記出力手段において、前記判断の結果を出力するステップとを実行させる、排他制御不具合候補抽出プログラム。 A program for causing a computer to execute exclusive control defect candidate extraction processing,
The computer includes input means, calculation means, and output means,
In the input means, inputting a software configuration;
In the computing means, extracting an exclusive control function that is a function for accessing a shared resource from the software configuration;
In the computing means, determining whether or not exclusive control is possible for the extracted exclusive control function; and
An exclusive control defect candidate extraction program for causing the output means to execute a step of outputting the result of the determination.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008022983A JP2009032233A (en) | 2007-06-28 | 2008-02-01 | Exclusive control fault candidate extraction device, exclusive control fault candidate extraction method, and exclusive control fault candidate extraction program |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007170848 | 2007-06-28 | ||
JP2008022983A JP2009032233A (en) | 2007-06-28 | 2008-02-01 | Exclusive control fault candidate extraction device, exclusive control fault candidate extraction method, and exclusive control fault candidate extraction program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009032233A true JP2009032233A (en) | 2009-02-12 |
Family
ID=40402631
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008022983A Withdrawn JP2009032233A (en) | 2007-06-28 | 2008-02-01 | Exclusive control fault candidate extraction device, exclusive control fault candidate extraction method, and exclusive control fault candidate extraction program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009032233A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010125960A1 (en) * | 2009-04-28 | 2010-11-04 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Method for converting program code of program running in multithreaded environment to program code having fewer lock conflicts, and computer program and computer system therefor |
-
2008
- 2008-02-01 JP JP2008022983A patent/JP2009032233A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010125960A1 (en) * | 2009-04-28 | 2010-11-04 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Method for converting program code of program running in multithreaded environment to program code having fewer lock conflicts, and computer program and computer system therefor |
CN102292709A (en) * | 2009-04-28 | 2011-12-21 | 国际商业机器公司 | Method of converting program code of program running in multi-thread to program code causing less lock collisions, computer program and computer system for the same |
JP5204300B2 (en) * | 2009-04-28 | 2013-06-05 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Method for converting program code of program operating on multithread to program code with less lock collision, and computer program and computer system thereof |
US8972959B2 (en) | 2009-04-28 | 2015-03-03 | International Business Machines Corporation | Method of converting program code of program running in multi-thread to program code causing less lock collisions, computer program and computer system for the same |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4888272B2 (en) | Software simulation method, software simulation program, and software simulation apparatus | |
JP4414373B2 (en) | Program verification program, program verification apparatus, and program verification method | |
US10241894B2 (en) | Data-scoped dynamic data race detection | |
Yuki et al. | Array dataflow analysis for polyhedral X10 programs | |
JP2009237762A (en) | Program analyzer, program analytical method, and analytical program | |
JP2011253363A (en) | Method, system and program for application analysis | |
US8286141B2 (en) | Instruction-trace generation program, instruction-trace generating device, and instruction-trace generating method | |
US20130152049A1 (en) | Warning of register and storage area assignment errors | |
JP2009032233A (en) | Exclusive control fault candidate extraction device, exclusive control fault candidate extraction method, and exclusive control fault candidate extraction program | |
US20070094540A1 (en) | Program analysis program, program analysis device, and program analysis method | |
Tamitani et al. | An encoder/decoder chip set for the MPEG video standard | |
JP3675623B2 (en) | Program development support apparatus and method, and recording medium recording program development support software | |
Harel et al. | Some methodological observations resulting from experience using LSCs and the play-in/play-out approach | |
JP2010066889A (en) | Exclusive control trouble candidate extraction device, exclusive control trouble candidate extraction method and exclusive control trouble candidate extraction program | |
Chabbi et al. | Barrier elision for production parallel programs | |
Lei et al. | Reachability testing of semaphore-based programs | |
JP5374965B2 (en) | Simulation control program, simulation control apparatus, and simulation control method | |
KR102185294B1 (en) | Apparatus and method for analyzing source code of concurrent program and computer readible storage medium therefor | |
JP2017041196A (en) | Stub object determination device, method, and program | |
CN113805861A (en) | Code generation method based on machine learning, code editing system and storage medium | |
Fekete et al. | Creating a GPGPU-accelerated framework for pattern matching using a case study | |
JP2010157147A (en) | Software inspection device, software inspection method, and software inspection program | |
RU2364930C2 (en) | Generation method of knowledgebases for systems of verification of distributed computer complexes software and device for its implementation | |
JP2018151803A (en) | Inspection device of computer program, and on-vehicle device for inspecting computer program for vehicle control | |
JP2017224288A (en) | Parallelizing method, parallelizing tool and on-vehicle device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110405 |