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 PDF

Info

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
Application number
JP2008022983A
Other languages
Japanese (ja)
Inventor
Shintaro Tabata
慎太郎 田畑
Toshikazu Hashimoto
俊和 橋本
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP2008022983A priority Critical patent/JP2009032233A/en
Publication of JP2009032233A publication Critical patent/JP2009032233A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an exclusive control fault candidate extraction device capable of precisely detecting a fault relating to exclusive control of software by using static analysis. <P>SOLUTION: The exclusive control fault candidate extraction device inputs a source program 106 of software being a fault detection target by a source program input part 101 and inputs design information 107 of the source program 106 by a design information input part 102. An exclusive control function extraction part 103 uses an exclusive control function/shared resource name correspondence table and a task main function list of the design information to extract exclusive control functions for accessing shared resources to be used on a plurality of tasks. An exclusive control determination execution part 104 detects an exclusive control fault candidate from the exclusive control functions and outputs the exclusive control fault candidate from an exclusive control fault candidate output part 105 as a detection result. <P>COPYRIGHT: (C)2009,JPO&INPIT

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の技術では、上記手順により、未ロックの共有リソースへのアクセスを不具合として検出している。
特開平3−288239号公報
Specifically, in the technique disclosed in Patent Document 1, when a source program is given as an input, a flag indicating whether data is handled as a shared resource is set in the data allocation recognition area A1 when the source program is compiled. An instruction sequence that sets a lock indicating a lock (hereinafter referred to as a lock flag) in the lock recognition area is generated in the object program when generating an instruction sequence to be locked at the time of execution, and the lock is released at the time of execution. An instruction sequence for releasing the lock flag when generating the instruction sequence is generated in the object program, and finally a load module is generated. Further, when the load module is executed by a debugger and a resource is accessed by a certain task, the data allocation recognition area A1 is referred to and it is known whether or not the resource is a shared resource. When the resource is a shared resource, it can be determined whether or not the shared resource is locked by referring to the lock flag. When the lock is not applied, it can be seen that an access to an unlocked shared resource is performed. In the technique of Patent Document 1, access to an unlocked shared resource is detected as a failure by the above procedure.
JP-A-3-288239

しかしながら、特許文献1に開示されている技術では、未ロック時における共有領域へのデータ定義参照という排他制御不具合の検出を、動的解析により行なっている。このため、処理内の条件分岐を網羅するために、条件を変更しながら膨大な回数の動的解析を行なう必要があるという問題があった。これを第1の問題として提起する。   However, in the technique disclosed in Patent Document 1, detection of an exclusive control failure such as data definition reference to a shared area when unlocked is performed by dynamic analysis. For this reason, in order to cover the conditional branches in the process, there has been a problem that it is necessary to perform dynamic analysis numerous times while changing the conditions. This is raised as the first problem.

また、特許文献1に開示されている技術を用いて排他制御不具合を検出するためには、動的解析の実行に必要な環境を別途用意する必要があるという問題があった。これを第2の問題として提起する。   In addition, in order to detect an exclusive control failure using the technique disclosed in Patent Document 1, there is a problem that it is necessary to separately prepare an environment necessary for executing the dynamic analysis. This is raised as a second problem.

上記第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, line 201 is a function for locking a shared resource, line 202 is a function for reading the value of the shared resource, line 203 is a function f1_1 called, and line 205 is a value for the shared resource. A function to be written, line 204, represents a function for unlocking the shared resource.

図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 row 301 represents a function condition. The function f2 is a function (hereinafter referred to as an exclusive control function) that accesses the shared resource including the determination of the condition of the row 301. The row group 305 in FIG. 31 branches into two flows as shown in FIGS. 32 and 33 according to the function conditions of the row 301.

図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 row group 402, locking and unlocking to the shared resources B and C are performed on the rows 401 and 403, respectively. Therefore, there is no problem of exclusive control failure. On the other hand, in the case of the flow in FIG. 33, the shared resource C is unlocked in line 501 before the shared resource C is accessed (written) in line 502. Therefore, the line 502 causes an exclusive control failure.

特許文献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 Patent Document 1, the presence / absence of the exclusive control failure of the flow of FIGS. For this purpose, it is necessary to set the conditions so as to satisfy the conditions in the two cases of the line 301, v2> 0 and v2 ≦ 0, and to perform dynamic verification using a debug tool in each case. It was. For this reason, if the judgment of the condition of v2 ≦ 0 among the conditions of the line 301 in FIG. 31 is leaked due to incomplete setting at the time of debugging, the exclusive control malfunction of the line 502 in FIG. 33 could not be detected. There is a problem.

本発明はこのような問題に鑑みてなされたものであって、処理量および処理時間を抑えて、静的解析を利用してソフトウェアの排他制御に関する不具合を精度よく検出することができる排他制御不具合候補抽出装置、排他制御不具合候補抽出方法、および排他制御不具合候補抽出プログラムを提供することを目的とする。   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 program input unit 101, a design information input unit 102, an exclusive control function extraction unit 103, an exclusive control determination execution unit 104, and an exclusive control. A defect candidate output unit 105 is included.

ソースプログラム入力部101は、排他制御不具合を抽出する対象となるソフトウェア構成であるソースプログラム106を取得し、格納する。   The source program input unit 101 acquires and stores a source program 106 that is a software configuration for which an exclusive control defect is to be extracted.

設計情報入力部102は、ソースプログラム106の設計情報107を取得し、格納する。ここで、設計情報は、排他制御関数候補・共有リソース名対応表、共有リソース仕様書、およびタスクメイン関数リストを含む。   The design information input unit 102 acquires the design information 107 of the source program 106 and stores it. Here, the design information includes an exclusive control function candidate / shared resource name correspondence table, a shared resource specification, and a task main function list.

「排他制御関数候補・共有リソース名対応表」とは、図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 function extraction unit 103 includes a source program 106 acquired by the source program input unit 101, an exclusive control function / shared resource name correspondence table and a task main function list in the design information 107 acquired by the design information input unit 102, From the above, an exclusive control function called from a plurality of tasks is extracted.

図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 function extraction unit 103. Specifically, in the flowchart of FIG. 5, the source program input unit 101 is a source program 106 including the source program of FIGS. 30 and 31, and the design information input unit 102 is the design information 107 of FIG. 4 shows processing of the exclusive control function extraction unit 103 when the shared resource name correspondence table and the task main function list of FIG. 4 are acquired.

図5を参照して、始めに、排他制御関数抽出部103は、ステップS801において、ソースプログラム入力部101から図30,図31のソースプログラムを含むソースプログラムと、設計情報入力部102から図2の排他制御関数・共有リソース名対応表Tableと、図4のタスクメイン関数リストTaskmainTableとをそれぞれ取得する。   Referring to FIG. 5, first, in step S801, the exclusive control function extraction unit 103 receives from the source program input unit 101 the source program including the source programs of FIGS. 30 and 31 and the design information input unit 102 from FIG. The exclusive control function / shared resource name correspondence table Table and the task main function list TaskmainTable of FIG. 4 are respectively acquired.

次に、排他制御関数抽出部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 function extraction unit 103 has not performed processing on all the shared resources in the correspondence table Table (NO in step S802), in step S803, one exclusive resource is taken out from the correspondence table Table, and the correspondence is also handled. A list F_serv of a function for accessing this shared resource is generated from the table Table. In the case of the exclusive control function / shared resource name correspondence table Table in FIG. 2, when the shared resource A is extracted from the correspondence table Table, the list F_serv becomes {f1}, and the shared resource B and the shared resource C are extracted, respectively. In this case, the list F_serv becomes {f2}.

続いて、排他制御関数抽出部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 function extraction unit 103 extracts, from the source program, a function that calls the function f () for each function f () in the list F_serv, and calls this function in the list F_serv. Add to function list F_use (F_serv). For example, if the analysis of the source program reveals that there are two functions g1 and g2 that call the function f1 which is one function in the list F_serv, the function g1 and the function g2 are listed in the list F_use ( F_serv).

続いて、排他制御関数抽出部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 function extraction unit 103 extracts, from the source program, a function that calls the function g () for each function g () in the list F_use (F_serv), and recursively lists F_use (F_serv ) Here, “recursively” means that a function h () is added to the list F_use (F_serv) as a function that calls the function g (). Is extracted from the source program and added to the list F_use (F_serv). If there is no function calling the function g (), the same processing is performed with the next function in the list F_use (F_serv) as the function g (). For example, when the list F_use (F_serv) is {g1, g2}, the exclusive control function extracting unit 103 extracts a function calling the function g1 (for example, the function h1 and the function h2) from the source program, and the list F_use (F_serv ) (F_use (F_serv) = {g1, g2, h1, h2}). Subsequently, the exclusive control function extraction unit 103 similarly extracts a function calling the function g2 of the next element of the list F_use (F_serv) from the source program and adds it to the list F_use (F_serv). Subsequently, for the function h1 of the next element of the list F_use (F_serv), if there is no function calling this, nothing is added to the list F_use (F_serv), and the function h2 of the next element is Extract the function that calls. The above processing is performed for all the lists F_use (F_serv).

続いて、排他制御関数抽出部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 function extraction unit 103 counts the number of task main functions in the task main function list TaskmainTable in the list F_use (F_serv), and when this is 2 or more (in step S806). YES), it can be seen that the shared resource extracted in step S803 is used by two or more tasks. Therefore, in step S807, the exclusive control function extraction unit 103 adds the exclusive control function list F_serv that accesses the shared resource extracted in step S803 to the exclusive control function list F_exclusive as an exclusive control defect candidate detection target. On the other hand, if there is only one task main function in the task main function list TaskmainTable in the list F_use (F_serv) (NO in step S806), the shared resource extracted in step S803 is only from a single task. You can see that it is used. Therefore, the exclusive control function extraction unit 103 does not set the exclusive control function F_serv that accesses this shared resource as a target of exclusive control defect detection.

排他制御関数抽出部103は、以上の処理を排他制御関数・共有リソース名対応表Table内のすべての共有リソースに対して行ない、ステップS808において、排他制御関数リストF_exclusiveを排他制御判定実行部104に出力する。   The exclusive control function extraction unit 103 performs the above processing on all the shared resources in the exclusive control function / shared resource name correspondence table Table, and sends the exclusive control function list F_exclusive to the exclusive control determination execution unit 104 in step S808. Output.

排他制御判定実行部104は、排他制御関数抽出部103が出力した排他制御関数リストF_exclusiveと、設計情報入力部102が取得した排他制御関数・共有リソース名対応表および共有リソース仕様書と、ソースプログラム取得部101が取得したソースプログラムとを取得し、排他制御不具合候補を検出する。   The exclusive control determination execution unit 104 includes an exclusive control function list F_exclusive output by the exclusive control function extraction unit 103, an exclusive control function / shared resource name correspondence table and a shared resource specification acquired by the design information input unit 102, and a source program The acquisition unit 101 acquires the acquired source program and detects an exclusive control defect candidate.

図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 determination execution unit 104. Specifically, the flowchart of FIG. 6 includes {f1, f2} as the exclusive control function list F_exclusive, the exclusive control function / shared resource name correspondence table of FIG. 2, the shared resource specification of FIG. 3, and FIGS. The process of the exclusive control determination execution part 104 when the source program containing is given to the exclusive control determination execution part 104 is represented.

図6を参照して、始めに、排他制御判定実行部104は、ステップS901において、ソースプログラム入力部101よりソースプログラムを、設計情報入力部102より排他制御関数・共有リソース名対応表と共有リソース仕様書とを、および排他制御関数抽出部103より排他制御関数リストF_exclusiveを取得する。   Referring to FIG. 6, first, in step S <b> 901, exclusive control determination execution unit 104 receives a source program from source program input unit 101, exclusive control function / shared resource name correspondence table and shared resource from design information input unit 102. The exclusive control function list F_exclusive is acquired from the specification and the exclusive control function extraction unit 103.

ステップ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 determination execution unit 104 extracts one element from the exclusive control function list F_exclusive in step S903, and extracts this element as a function f (). And

次に、排他制御判定実行部104は、ステップS904において、関数f()と関数f()から呼ばれている関数とが定義されている箇所をソースプログラムから見つけ、この箇所をSourceCodeSet(f())とする。ただし、共有リソース仕様書に記載されている共有リソースアクセス用APIは含まない。たとえば、関数f()が関数f1である場合、上記ステップS904において、図30のソースプログラムにおける関数f1と関数f1から呼ばれている関数f1_1とのソースプログラムがSourceCodeSet(f())となる。   Next, in step S904, the exclusive control determination execution unit 104 finds a location where the function f () and the function called from the function f () are defined from the source program, and finds this location as SourceCodeSet (f ( )). However, the shared resource access API described in the shared resource specification is not included. For example, when the function f () is the function f1, in step S904, the source program of the function f1 in the source program of FIG. 30 and the function f1_1 called from the function f1 is SourceCodeSet (f ()).

次に、排他制御判定実行部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 determination execution unit 104 generates a control flow graph of SourceCodeSet (f ()), converts the control flow graph of function f () into the function f () of SourceCodeSet (f ()). Create a flow graph (Graph) expanded with the control flow graph of functions other than. The “control flow graph” is a graph representing the flow of control within each function. Specifically, when SourceCodeSet (f ()) is the source program of FIG. 30, the control flow graph of the function f1 is represented in FIG. 7, and the control flow graph of the function f1_1 is represented in FIG. In step S905, the flow graph Graph of the function f1 shown in FIG. 9 is obtained by expanding the node 1001 in FIG. 7 with the control flow graph of the function f1_1 in FIG. Created. Similarly, the flow graph Graph of the function f2 shown in FIG. 10 is created for the source program of FIG.

次に、排他制御判定実行部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 determination execution unit 104 determines which shared resource the function f () accesses in step S906, the exclusive control function / shared resource name correspondence table acquired in step S901 (FIG. 2). Get from. Then, for the acquired shared resource name, a set API_set (f ()) of a set of the API name that accesses the shared resource and the type of the API is extracted from the shared resource specification (FIG. 3) acquired in step S901. Then, the flow graph Graph created in step S905 is analyzed. As a specific analysis method, each node of the flow graph Graph is locked to the shared resource x (lock (x)), unlocked to the shared resource x (unlock (x)), and accessed to the shared resource x ( access (x)) or other (others) is determined from the correspondence between the API name and type in API_set (f ()) extracted from the shared resource specification. According to the determination result, the flow graph Graph is converted into a sequence of nodes to which the events lock (x), unlock (x), access (x), and others are assigned. When the flow graph Graph of FIG. 9 is specifically analyzed and the above allocation is performed, in step S906, the arrangement of the nodes after the event allocation of the function f1 shown in FIG. 11 is shown from the flow graph Graph of the function f1 of FIG. Further, from the flow graph Graph of the function f2 in FIG. 10, the sequence of nodes after the event assignment of the function f2 shown in FIG. 12 is obtained.

次に、排他制御判定実行部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 determination execution unit 104 sequentially reads the sequence of nodes obtained in step S906 as an event sequence, sets the initial state of the shared resource x as unlock, and sets the shared resource of FIG. State transition is executed according to the lock state transition diagram. In the state transition diagram of FIG. 13, the state “unlock” indicates that the shared resource x is not locked, and the state “lock” indicates the locked state. The state transition diagram shown in FIG. 13 defines the transition of the lock state of the shared resource, and is stored in the exclusive control determination execution unit 104 in advance. In step S907, the exclusive control determination execution unit 104 performs transition between these states statically according to the state transition diagram shown in FIG. Specifically, if the node sequence is the node sequence related to the shared resource A in FIG. 11, in step S907, the exclusive control determination execution unit 104 reads the event lock (A) that is the node 1401 in the initial state unlock, Transition from the initial state unlock to the state lock is made according to the state transition diagram of FIG. Subsequently, the access (A) event of the nodes 1402 and 1403 is read and remains in the state lock. Finally, an unlock (A) event that is the node 1404 is read, and the state shifts to the state unlock. In the case of the node arrangement in FIG. 12, since there are two shared resources B and C, the exclusive control determination execution unit 104 prepares the state transition diagram of FIG. 13 for each shared resource, and similarly transitions from the initial state unlock. To start. In addition, when the flow branches for condition determination as in the node 1504 in FIG. 12, the exclusive control determination execution unit 104 performs state transition for each of the flows that pass through the events that are the branched nodes 1505 and 1510, and excludes them. Control defect candidates are detected.

次に、排他制御判定実行部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 determination execution unit 104 checks whether an access event has occurred in the state unlock. If an access event occurs in the state unlock (YES in step S908), access to the unlocked shared resource occurs, so that the exclusive control determination execution unit 104 determines in step S910 an exclusive control defect candidate. As a result, the function name of the function f () and information including defect contents such as “access in unlocked state” are added to the exclusive control defect candidate list NG_List. For example, when state transition is performed for the flow passing through the event of the node 1510 in the node arrangement of FIG. 12, the arrangement of the nodes related to the shared resource C is, in order, node 1502 (lock), node 1510 (access), 1511 (unlock), node 1507 (access), and node 1508 (unlock). According to the state transition diagram of FIG. 13, it can be seen that an access event occurs in the node 1507 in the state unlock. Therefore, in step S908, the exclusive control determination execution unit 104 adds “function name: f2 content: access in unlocked state” to the exclusive control defect candidate list NG_List as an exclusive control defect candidate.

一方、状態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 determination execution unit 104 determines whether the end of the node sequence has been reached in step S909. When the end of the node has been reached (YES in step S909), the state of the shared resource at the end of the end is confirmed in step S911. If the shared resource is in the locked state (YES in step S911), an uncheck is made in step S910. Assuming that the processing is terminated without locking, the function name of the function f () and information including the malfunction content such as “end processing in locked state” are added to the exclusive control defect candidate NG_List as an exclusive control defect candidate.

図11に示されたノードの並びのように、ノード1402,1403の共有リソースへのアクセスがすべてロック状態で行なわれ、かつ、処理が終了する終端ノード1404においてアンロック状態である場合、上記ステップS908でNO、ステップS909でYES、かつステップS911でNOと判断され、排他制御不具合ではないと判断されるので、このノードの並びの排他制御不具合候補の抽出を終了し、再びステップS902からの処理を繰返す。   When the access to the shared resources of the nodes 1402 and 1403 is all performed in the locked state and the terminal node 1404 where the processing ends is in the unlocked state as in the arrangement of nodes illustrated in FIG. Since NO is determined in S908, YES is determined in Step S909, and NO is determined in Step S911, it is determined that there is no exclusive control failure. Therefore, the extraction of the exclusive control failure candidate of this node arrangement is finished, and the processing from Step S902 is performed again. Repeat.

排他制御判定実行部104は、以上の手順を排他制御関数リストF_exclusiveが空になるまで繰返し(ステップS902でYES)、ステップS912において、図14に示されるような排他制御不具合候補リストNG_Listを排他制御不具合候補出力部105に出力する。   The exclusive control determination execution unit 104 repeats the above procedure until the exclusive control function list F_exclusive becomes empty (YES in step S902), and in step S912, performs exclusive control on the exclusive control defect candidate list NG_List as shown in FIG. Output to the defect candidate output unit 105.

排他制御不具合候補出力部105は、たとえば図14に示されるようなリスト形式などで、排他制御判定実行部104から取得した排他制御不具合候補を出力する。   The exclusive control defect candidate output unit 105 outputs the exclusive control defect candidate acquired from the exclusive control determination execution unit 104, for example, in a list format as shown in FIG.

第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 table generation unit 2201, a shared resource specification generation unit 2202, and a task main function list generation unit 2203 are configured.

設計情報2204は、図16に示されるような、共有リソース名と、共有リソースに対してロック・アンロックを行なう関数の関数名と、ロック・アンロックのいずれかである関数のタイプとを含む共有リソース・ロックアンロック関数対応表、およびタスクを生成する関数名を含む。設計情報2204は、排他制御関数・共有リソース名対応表生成部2201、共有リソース仕様書生成部2202、およびタスクメイン関数リスト生成部2203で入力され、取得される。   The design information 2204 includes a shared resource name, a function name of a function that locks / unlocks the shared resource, and a function type that is either locked / unlocked as shown in FIG. Includes shared resource / lock / unlock function correspondence table and function name to create task. The design information 2204 is input and acquired by the exclusive control function / shared resource name correspondence table generation unit 2201, the shared resource specification generation unit 2202, and the task main function list generation unit 2203.

共有リソース仕様書生成部2202は、取得した設計情報2204に含まれる共有リソース・ロックアンロック関数対応表に記載された共有リソースにアクセスしている関数を、ソースプログラム入力部101で取得したソースプログラム106から抽出し、取得した共有リソース・ロックアンロック関数対応表に追加することにより共有リソース仕様書を生成する。   The shared resource specification generation unit 2202 acquires the function that accesses the shared resource described in the shared resource / unlock function correspondence table included in the acquired design information 2204 by the source program input unit 101. A shared resource specification is generated by extracting from 106 and adding it to the acquired shared resource / lock unlock function correspondence table.

排他制御関数・共有リソース名対応表生成部2201は、共有リソース仕様書生成部2202で生成された共有リソース仕様書に記載された共有リソースアクセス関数を呼出している関数を、ソースプログラム入力部101で取得したソースプログラム106から抽出し、排他制御関数・共有リソース名対応表を生成する。   The exclusive control function / shared resource name correspondence table generation unit 2201 uses the source program input unit 101 to call a function that calls the shared resource access function described in the shared resource specification generated by the shared resource specification generation unit 2202. Extracted from the acquired source program 106, an exclusive control function / shared resource name correspondence table is generated.

タスクメイン関数リスト生成部2203は、取得した設計情報2204に含まれるタスクを生成する関数を呼出している箇所を、ソースプログラム入力部101で取得したソースプログラム106から検索し、上記関数の引数として記載されているタスクメイン関数を抽出してタスクメイン関数リストを生成する。   The task main function list generation unit 2203 searches the source program 106 acquired by the source program input unit 101 for a location where a function for generating a task included in the acquired design information 2204 is called, and describes it as an argument of the function. The task main function is extracted to generate a task main function list.

排他制御関数・共有リソース名対応表生成部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 table generation unit 2201 is used for processing by the exclusive control function extraction unit 103 and the exclusive control determination execution unit 104. The shared resource specification generated by the shared resource specification generation unit 2202 is used for processing by the exclusive control determination execution unit 104. The task main function list generated by the task main function list generation unit 2203 is used for processing by the exclusive control function extraction unit 103.

図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 specification generation unit 2202 and the exclusive control function / shared resource name correspondence table generation unit 2201. The flowchart in FIG. 17 specifically uses a source program including the shared resource / lock / unlock function correspondence table shown in FIG. 16 and the source program of the function for accessing the shared resource A in FIGS. The shared resource specification generation unit 2202 generates a shared resource specification, and the exclusive control function / shared resource name correspondence table generation unit 2201 represents a process of generating an exclusive control function / shared resource name correspondence table.

図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 specification generation unit 2202 includes shared resource / lock unlock function correspondence table Var_Com shown in FIG. 16 and the source programs of FIGS. 30 and 18 in step S1801. Get the source program. If all the shared resources in the correspondence table Var_Com have not been checked (NO in step S1802), the shared resource specification generation unit 2202 acquires the shared resource as v_c from the correspondence table Var_Com in step S1803. For example, the shared resources A, B, and C are acquired as v_c from the shared resource / lock unlock function correspondence table Var_Com shown in FIG.

次に、共有リソース仕様書生成部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 specification generation unit 2202 searches the source program input in step S1801, finds a place where the shared resource v_c is assigned or referred to, and finds this place. A function group including the function group is defined as a function group F_list (v_c). When the source program shown in FIG. 18 is given in step S1801 above, if the shared resource v_c acquired in step S1803 is the shared resource A, the locations in the rows 2101 and 2102 are applicable, so in step S1804, as shown in FIG. As described above, the functions ACCESS_READ_A and ACCESS_WRITE_A are extracted as the function group F_list (v_c) that is a list of functions that access the shared resource A. The shared resource specification generation unit 2202 adds these to the correspondence table Var_Com as an access function of the shared resource v_c, and generates a shared resource specification.

次に、排他制御関数・共有リソース名対応表生成部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 table generation unit 2201 searches for the source program input in step S1801 and accesses the shared resource v_c in the shared resource specification Var_Com. A function calling a function included in F_list (v_c) is found, and this function group is defined as a function group F_call (F_list (v_c)). When the function in FIG. 19 is extracted as the function group F_list (v_c) in step S1804, in step S1805, the function group in the line 202 of the source program in FIG. 30 is searched by searching the source program including the source program in FIG. A function f1 that calls a function in F_list (v_c) is extracted as one of the function group F_call (F_list (v_c)).

次に、排他制御関数・共有リソース名対応表生成部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 table generation unit 2201 associates the shared resource v_c as a shared resource name for each function in the function group F_call (F_list (v_c)), and performs the exclusive control function. -Add to the shared resource name correspondence table m_list. When the shared resource v_c is the shared resource A and the function in the function group F_call (F_list (v_c)) is the function f1 in FIG. 30, in step S1806, the function f1 and the shared resource A are associated with each other and exclusive control is performed. It is added to the function / shared resource name correspondence table m_list, and the shared resource specification of the shared resource A shown in FIG. 20 is generated. When the above processing is repeated for all shared resources (YES in step S1802), the exclusive control function / shared resource name correspondence table generation unit 2201 uses the generated shared resource specification Var_Com in step S1807 as in FIG. The exclusive control function / shared resource name correspondence table m_list is output to the exclusive control determination execution unit 104 in a format, and the exclusive control function extraction unit 103 and the exclusive control determination execution unit 104 Output for.

第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 determination execution unit 104 generates a flow graph Graph of the function f3 shown in FIG. 24 in step S905 according to the flowchart of FIG. Further, in step S906, using the exclusive control function candidate / shared resource name correspondence table of FIG. 22 and the shared resource specification of FIG. 23, a sequence of nodes after the event assignment of the function f3 shown in FIG. 25 is generated. . Here, the description that directly accesses the shared resource refers to a sentence that assigns to the shared resource on the source program or a sentence that refers to the shared resource. In line 2601 of the source program in FIG. 21, although the shared resource D is accessed, the access method (direct access) is a method other than that described in the shared resource specification in FIG. In step S906, "other" is assigned to the node 2903 in FIG. For this reason, in the exclusive control defect candidate extraction system according to the first embodiment, it cannot be determined that the shared resource D is accessed in the unlocked state in the node 2903 from the arrangement of the nodes in FIG. The location of line 2601 of 21 source programs cannot be detected as an exclusive control failure.

第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 program changing unit 2501 is included.

共有リソース仕様書・ソースプログラム変更部2501は、ソースプログラム入力部101からソースプログラムを取得し、設計情報入力部102から設計情報として共有リソース仕様書を取得する。共有リソース仕様書・ソースプログラム変更部2501は、共有リソース仕様書に記載された共有リソースにアクセスしている箇所をソースプログラムから検索し、ソースプログラムの共有リソースアクセス箇所を擬似関数に変更すると共に、共有リソース仕様書に擬似関数名をアクセス関数として追加する。   The shared resource specification / source program change unit 2501 acquires a source program from the source program input unit 101 and acquires a shared resource specification as design information from the design information input unit 102. The shared resource specification / source program changing unit 2501 searches the source program for a location where the shared resource described in the shared resource specification is accessed, changes the shared resource access location of the source program to a pseudo function, Add the pseudo function name as an access function to the shared resource specification.

具体的には、ソースプログラム入力部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 program input unit 101 and the shared resource specification of FIG. 23 is acquired from the design information input unit 102, the shared resource specification / source program change unit 2501 The location where the shared resource D is directly accessed is retrieved from the source program of the above-mentioned source program, and the location is replaced with a specific character string (for example, TRANS_ACCESS_D) including the shared resource name D. The source program line 2601 in FIG. 21 is changed by the shared resource specification / source program change unit 2501 to a line 3001 in FIG. Further, the shared resource specification / source program changing unit 2501 adds the replaced character string (for example, TRANS_ACCESS_D) to the shared resource specification as an access function of the shared resource D. As shown in the row 3101 of FIG. 28, the replaced character string and type are added to the shared resource specification of the shared resource D of FIG.

他の構成における処理は、第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 source program 106 input from the source program input unit 101 by the processing in the shared resource specification / source program change unit 2501 Is changed as shown in FIG. 27, and the shared resource specification of FIG. 23 as the design information 107 input from the design information input unit 102 is changed as shown in FIG. Therefore, in the exclusive control defect candidate extraction system according to the third exemplary embodiment, the exclusive control determination execution unit 104 can generate a sequence of nodes after the event assignment of the function f3 as shown in FIG. It can be detected that shared resource access is being performed in the unlocked state at the node 3203.

第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 list generation unit 4001 and a shared resource / lock / unlock function correspondence table generation unit 4002 are included.

第4の実施の形態における設計情報4003は、図35に示されるような記憶領域指定修飾子名リストと、図36に示されるようなロック・アンロック関数名リストと、図41に示されるようなタスク生成関数名リストを含む。   The design information 4003 according to the fourth embodiment includes a storage area designation qualifier name list as shown in FIG. 35, a lock / unlock function name list as shown in FIG. 36, and as shown in FIG. Contains a list of task generation function names.

図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 design information 4003 is input to the shared source name list generation unit 4001, the shared resource / lock unlock function correspondence table generation unit 4002, and the task main function list generation unit 2203.

共有リソース名リスト生成部4001は、ソースプログラム入力部101で取得したソースプログラム106と、取得した設計情報4003に含まれる記憶領域指定修飾子名リストとから、ソースプログラム106に含まれる共有リソースを抽出し、共有リソース名リストを生成する。生成された共有リソース名リストは、共有リソース・ロックアンロック関数対応表生成部4002に入力され、共有リソース・ロックアンロック関数対応表生成部4002での処理に用いられる。   The shared resource name list generation unit 4001 extracts shared resources included in the source program 106 from the source program 106 acquired by the source program input unit 101 and the storage area designation qualifier name list included in the acquired design information 4003. And generate a shared resource name list. The generated shared resource name list is input to the shared resource / lock unlock function correspondence table generation unit 4002 and used for processing in the shared resource / lock unlock function correspondence table generation unit 4002.

共有リソース・ロックアンロック関数対応表生成部4002は、共有リソース名リスト生成部4001で生成された共有リソース名リストと、取得した設計情報4003に含まれるロック・アンロック関数名リストとから、各共有リソースのためのロック関数とアンロック関数とを抽出し、共有リソース名・ロックアンロック関数対応表を生成する。生成された共有リソース・ロックアンロック関数対応表は、共有リソース仕様書生成部2202に入力され、共有リソース仕様書生成部2202での処理に用いられる。   The shared resource / lock / unlock function correspondence table generation unit 4002 includes a shared resource name list generated by the shared resource name list generation unit 4001 and a lock / unlock function name list included in the acquired design information 4003. A lock function and an unlock function for the shared resource are extracted, and a shared resource name / lock unlock function correspondence table is generated. The generated shared resource / lock unlock function correspondence table is input to the shared resource specification generation unit 2202 and used for processing in the shared resource specification generation unit 2202.

図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 list generation unit 4001. The flowchart of FIG. 38 specifically shows a source including the storage area designating qualifier name list shown in FIG. 35 and the source program (L1 to L3 in FIG. 40) performing the variable declaration shown in FIG. 37 shows a process of generating a shared resource name list in FIG. 37 using a program.

図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 list generation unit 4001 obtains the storage area designating qualifier name list shown in FIG. 35 and the source program including the source program of FIG. 40 in step S4101. . In step S4102, the shared resource name list generation unit 4001 searches the source program in FIG. 40, finds a portion where variables are declared (L1 to L3 in FIG. 40), and acquires a list of this variable group as var_list. For example, in the case of the source program of FIG. 40, the list of variable groups is var_list = [A, B, C]. If all the variables in the list var_list have not been checked (NO in step S4103), the shared resource name list generation unit 4001 acquires the variable v from the variable group list var_list in step S4104. For example, the shared resource candidates A, B, and C are acquired as variables v from the source program shown in FIG.

次に、共有リソース名リスト生成部4001は、変数vが大域変数(関数定義の外で宣言された変数)であるか否かを判断し、そうである場合(ステップS4105でYES)、ステップS4106において、変数vを共有リソース名として共有リソース名リストc_listに追加する。たとえば、図40に示されるソースプログラムからは、変数A、B、Cが共有リソース名として共有リソース名リストc_listに追加される。   Next, the shared resource name list generation unit 4001 determines whether or not the variable v is a global variable (a variable declared outside the function definition). If so (YES in step S4105), step S4106 The variable v is added to the shared resource name list c_list as the shared resource name. For example, from the source program shown in FIG. 40, variables A, B, and C are added to the shared resource name list c_list as shared resource names.

以上の処理が全変数に対して繰返される。全変数に対して以上の処理が終了すると(ステップ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 list generation unit 4001 in FIG. 34 displays the generated shared resource name list in the same format as in FIG. 37 in step S4107. Output to the lock / unlock function correspondence table generation unit 4002.

なお、ステップ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 step 4105 that the variable v is not a global variable (NO in step S4105), the process proceeds to step S4108. For example, when the input is a source program in which variables D, E, and G are declared in the function f shown in FIG. 42, in step S4102, the shared resource name list generation unit 4001 displays a variable group list var_list. = [D, E] is obtained, and in step 4104, the variables D and E are obtained as the variable v that is a candidate for the shared resource. At this time, the shared resource name list generation unit 4001 determines that the variable v is not a global variable (NO in step S4105), and the process advances to step S4108.

次に、ステップS4108において、共有リソース名リスト生成部4001は、変数vに対して宣言を行なっている関数f_callを取得する。たとえば、入力が図42に示されるソースプログラムである場合、ステップS4108において関数f_call=fが取得される。   Next, in step S4108, the shared resource name list generation unit 4001 acquires a function f_call that declares the variable v. For example, when the input is the source program shown in FIG. 42, the function f_call = f is acquired in step S4108.

次に、共有リソース名リスト生成部4001は変数vが静的変数宣言されているか否かを判断し、そうである場合(ステップS4109でYES)、ステップS4106で変数vを共有リソース名リストc_listに追加する。たとえば、変数v=Dの場合、共有リソース名リスト生成部4001は変数Dである変数vが静的変数宣言されていると判断し、ステップ4106で変数を共有リソース名リストc_listに追加する。これにより、共有リソース名リストc_list=[D]となる。   Next, the shared resource name list generation unit 4001 determines whether or not the variable v is declared as a static variable. If so (YES in step S4109), the variable v is changed to the shared resource name list c_list in step S4106. to add. For example, when variable v = D, shared resource name list generation section 4001 determines that variable v, which is variable D, is declared as a static variable, and adds the variable to shared resource name list c_list in step 4106. As a result, the shared resource name list c_list = [D].

一方、変数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 list generation unit 4001 determines whether or not the variable v is declared for the first time in the function f_call (YES in step S4110), and in step S4106, the variable v is set to the shared resource. Add to name list c_list. For example, when the variable v = E, the shared resource name list generation unit 4001 determines that the variable v, which is the variable E, is declared as an external variable (NO in step S4109), and the variable v is the first in the function f_call. It is determined that it is declared (YES in step S4110), and the variable E is added to the shared resource name list c_list. As a result, the shared resource name list c_list = [E] is obtained.

図39は、共有リソース・ロックアンロック関数対応表生成部4002の処理の具体例を示すフローチャートである。図39のフローチャートは、具体的に、図37に示される共有リソース名リストと、図36に示されるロック・アンロック関数名リストとを使用して、図16に示される共有リソース・ロックアンロック関数対応表を生成する処理を表わしている。   FIG. 39 is a flowchart showing a specific example of processing of the shared resource / unlock function correspondence table generation unit 4002. The flowchart of FIG. 39 specifically uses the shared resource name list shown in FIG. 37 and the lock / unlock function name list shown in FIG. 36 to share the resource lock / unlock shown in FIG. This shows a process for generating a function correspondence table.

図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 table generating unit 4002 and the shared resource name list c_list shown in FIG. 37 and the lock / unlock function shown in FIG. Get name list l_list. In step S4202, the shared resource / lock / unlock function correspondence table generation unit 4002 sets a function whose type is lock in the lock / unlock function name list l_list as a lock function f_l, and a function whose type is unlock. Is an unlock function f_u. For example, when the lock / unlock function name list l_list shown in FIG. 36 is acquired as an input, the shared resource / lock / unlock function correspondence table generation unit 4002 sets the lock function f_l = LOCK and the unlock function f_u = UNLOCK. .

次に、共有リソース名リスト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 list generation unit 4002 shares the shared resource name list c_list from the shared resource name list c_list in step 4204. Get resource name v_c. For example, the shared resource names A, B, and C are acquired as the shared resource name v_c from the shared resource name list c_list shown in FIG.

次に、共有リソース・ロックアンロック関数対応表生成部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 table generating unit 4002 sets the lock function for the shared resource v_c extracted from the shared resource v_c and the lock function f_l as a function f_l (v_c), and An unlock function for the shared resource v_c extracted from v_c and the unlock function f_u is assumed to be a function f_u (v_c). For example, when the shared resource name list shown in FIG. 37 and the lock / unlock function name list shown in FIG. 36 are acquired as inputs, the shared resource / lock unlock function correspondence table generation unit 4002 sets the variable v_c = When A, the lock function f_l (v_c) = LOCK (A) and the unlock function f_u (v_c) = UNLOCK (A).

次に、共有リソース・ロックアンロック関数対応表生成部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 table generating unit 4002 associates the shared resource v_c, the lock function f_l (v_c), and the type lock with each other and adds them to the correspondence table cl_table. The shared resource v_c, the unlock function f_u (v_c), and the type unlock are associated with each other and added to the correspondence table cl_table. For example, when the shared resource name list shown in FIG. 37 and the lock / unlock function name list shown in FIG. 36 are acquired as inputs, the shared resource / lock unlock function correspondence table generation unit 4002 sets the variable v_c = When A, the correspondence table cl_table = [(A, LOCK (A), lock), (A, UNLOCK (A), unlock)].

以上の処理が共有リソース名リスト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 table generation unit 4002 generates the shared resource / lock unlock generated in step S4202. The correspondence table cl_table is output to the shared resource specification generation unit 2202 in the same format as in FIG.

第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.

第1の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。It is a figure which shows the specific example of a structure of the exclusive control malfunction candidate extraction system of 1st Embodiment. 排他制御関数候補・共有リソース名対応表の具体例を示す図である。It is a figure which shows the specific example of an exclusive control function candidate and a shared resource name correspondence table. 共有リソース仕様書の具体例を示す図である。It is a figure which shows the specific example of a shared resource specification. タスクメイン関数リストの具体例を示す図である。It is a figure which shows the specific example of a task main function list | wrist. 排他制御関数抽出部103での処理の具体例を示すフローチャートである。10 is a flowchart illustrating a specific example of processing in the exclusive control function extraction unit 103. 排他制御判定実行部104での処理の具体例を示すフローチャートである。5 is a flowchart showing a specific example of processing in exclusive control determination execution unit 104. 関数f1のコントロールフローグラフを示す図である。It is a figure which shows the control flow graph of the function f1. 関数f1_1のコントロールフローグラフを示す図である。It is a figure which shows the control flow graph of the function f1_1. 関数f1のフローグラフGraphを示す図である。FIG. 6 is a diagram illustrating a flow graph Graph of a function f1. 関数f2のフローグラフGraphを示す図である。It is a figure which shows the flow graph Graph of the function f2. 関数f1のイベント割当て後のノードの並びを示す図である。FIG. 10 is a diagram showing a sequence of nodes after event assignment of function f1. 関数f2のイベント割当て後のノードの並びを示す図である。FIG. 10 is a diagram illustrating a sequence of nodes after event assignment of function f2. 共有リソースのロック状態遷移の具体例を示す図である。It is a figure which shows the specific example of the lock state transition of a shared resource. 排他制御不具合候補の出力の具体例を示す図である。It is a figure which shows the specific example of the output of an exclusive control malfunction candidate. 第2の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。It is a figure which shows the specific example of a structure of the exclusive control malfunction candidate extraction system of 2nd Embodiment. 共有リソース・ロックアンロック関数対応表の具体例を示す図である。It is a figure which shows the specific example of a shared resource and a lock / unlock function correspondence table. 共有リソース仕様書生成部2202および排他制御関数・共有リソース名対応表生成部2201での処理の具体例を示すフローチャートである。10 is a flowchart illustrating a specific example of processing in a shared resource specification generation unit 2202 and an exclusive control function / shared resource name correspondence table generation unit 2201. 共有リソースAにアクセスする関数のソースプログラムを示す図である。It is a figure which shows the source program of the function which accesses the shared resource A. 共有リソースAにアクセスする関数のリストの具体例を示す図である。It is a figure which shows the specific example of the list | wrist of the function which accesses the shared resource A. 排他制御関数・共有リソース名対応表生成部2201が生成する排他制御関数候補・共有リソース名対応表の具体例を示す図である。FIG. 11 is a diagram illustrating a specific example of an exclusive control function candidate / shared resource name correspondence table generated by an exclusive control function / shared resource name correspondence table generation unit 2201. 関数f3のソースプログラムを示す図である。It is a figure which shows the source program of the function f3. 排他制御関数候補・共有リソース名対応表の具体例を示す図である。It is a figure which shows the specific example of an exclusive control function candidate and a shared resource name correspondence table. 共有リソース仕様書の具体例を示す図である。It is a figure which shows the specific example of a shared resource specification. 関数f3のフローグラフGraphを示す図である。It is a figure which shows the flow graph Graph of the function f3. 関数f3のイベント割当て後のノードの並びを示す図である。FIG. 11 is a diagram showing a sequence of nodes after event assignment of function f3. 第3の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。It is a figure which shows the specific example of a structure of the exclusive control malfunction candidate extraction system of 3rd Embodiment. 変更後の関数f3のソースプログラムを示す図である。It is a figure which shows the source program of the function f3 after a change. 共有リソースDの変更後の共有リソース仕様書の具体例を示す図である。It is a figure which shows the specific example of the shared resource specification after the shared resource D is changed. 変更後の関数f3のイベント割当て後のノードの並びを示す図である。It is a figure which shows the arrangement | sequence of the node after the event allocation of the function f3 after a change. 関数f1のソースプログラムを表わす図である。It is a figure showing the source program of function f1. 関数f2のソースプログラムを表わす図である。It is a figure showing the source program of the function f2. 関数f2の第1の分岐のソースプログラムである。This is a source program of the first branch of the function f2. 関数f2の第2の分岐のソースプログラムである。This is a source program of the second branch of the function f2. 第4の実施の形態の排他制御不具合候補抽出システムの構成の具体例を示す図である。It is a figure which shows the specific example of a structure of the exclusive control malfunction candidate extraction system of 4th Embodiment. 記憶領域指定修飾子名リストの具体例を示す図である。It is a figure which shows the specific example of a storage area designation | designated qualifier name list. ロック・アンロック関数名リストの具体例を示す図である。It is a figure which shows the specific example of a lock / unlock function name list. 共有リソース名リストの具体例を示す図である。It is a figure which shows the specific example of a shared resource name list. 共有リソース名リスト生成部4001での処理の具体例を示すフローチャートである。10 is a flowchart illustrating a specific example of processing in a shared resource name list generation unit 4001. 共有リソース・ロックアンロック関数対応表生成部4002の処理の具体例を示すフローチャートである。10 is a flowchart illustrating a specific example of processing of a shared resource / unlock function correspondence table generation unit 4002. 大域に変数A,B,Cが宣言されているソースプログラムを表わす図である。It is a diagram showing a source program in which variables A, B, and C are declared globally. タスクを生成する関数の関数名リストの具体例を示す図である。It is a figure which shows the specific example of the function name list | wrist of the function which produces | generates a task. 関数f内に変数D,E,Gが宣言されているソースプログラムを表わす図である。It is a figure showing the source program by which variables D, E, and G are declared in function f.

符号の説明Explanation of symbols

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 table generation unit 2202 Shared resource specification generation unit 2203 Task main function list generation unit 2501 Shared resource specification / source program change unit 4001 Shared resource name list generation unit 4002 Shared resource lock unlock function Correspondence table generator.

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.
前記排他制御判定実行手段の実行する前記処理は、前記排他制御関数が、アンロック状態の共有リソースにアクセスしているか否かを判定する処理を含む、請求項1に記載の排他制御不具合候補抽出装置。   The exclusive control defect candidate extraction according to claim 1, wherein the process executed by the exclusive control determination execution unit includes a process of determining whether or not the exclusive control function is accessing a shared resource in an unlocked state. apparatus. 前記排他制御判定実行手段の実行する前記処理は、前記排他制御関数が、ロック状態の共有リソースにアクセスした後に、前記共有リソースをアンロック状態とせずに処理を終了しているか否かを判定する処理を含む、請求項1または2に記載の排他制御不具合候補抽出装置。   The process executed by the exclusive control determination execution unit determines whether the exclusive control function has finished the process without bringing the shared resource into an unlocked state after accessing the shared resource in the locked state. The exclusion control defect candidate extraction device according to claim 1, comprising a process. 前記排他制御関数抽出手段は、前記ソフトウェア構成の複数のタスク上で利用される共有リソースにアクセスを行なう排他制御関数を抽出する、請求項1〜3のいずれかに記載の排他制御不具合候補抽出装置。   The exclusive control defect candidate extracting device according to claim 1, wherein 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. . 前記排他制御関数抽出手段は、前記ソフトウェア構成の複数のタスク上で利用される共有リソースにアクセスを行なう排他制御関数を特定する際、前記ソフトウェア構成の各タスクの起動時に最初に呼出される関数名のリストであるタスクメイン関数リストを用いて、前記各タスクの起動時に呼出されている関数を辿っていく処理を行なって、前記排他制御関数が前記ソフトウェア構成の複数タスク上で利用される共有リソースにアクセスを行なうか否かを判定し、前記判断結果に基づいて前記排他制御関数を特定する、請求項4に記載の排他制御不具合候補抽出装置。   The exclusive control function extracting means, when specifying an exclusive control function that accesses a shared resource used on a plurality of tasks of the software configuration, a function name that is called first when each task of the software configuration is started A shared resource in which the exclusive control function is used on a plurality of tasks of the software configuration by performing a process of tracing a function called when each task is activated using a task main function list which is a list of The exclusion control defect candidate extraction device according to claim 4, wherein it is determined whether or not access is to be performed, and the exclusive control function is specified based on the determination result. 前記排他制御関数抽出手段は、
前記ソフトウェア構成の複数のタスク上で利用される共有リソースにアクセスを行なう排他制御関数を特定する際、前記ソフトウェア構成のうち、タスクを生成する関数名を呼出している箇所の記載に基づいて前記タスクの起動時に最初に呼出される関数名のリストであるタスクメイン関数リストを作成する処理と、
前記タスクメイン関数リストから呼出されている関数を辿っていく処理とを行なって、前記排他制御関数が前記ソフトウェア構成の複数タスク上で利用される共有リソースにアクセスを行なうか否かを判定し、前記判断結果に基づいて前記排他制御関数を特定する、請求項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.
請求項13に記載の排他制御不具合候補抽出プログラムを記録した、コンピュータ読取可能な記録媒体。   A computer-readable recording medium on which the exclusive control defect candidate extraction program according to claim 13 is recorded.
JP2008022983A 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 Withdrawn JP2009032233A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (4)

* Cited by examiner, † Cited by third party
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