Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0211930B2 - - Google Patents
[go: Go Back, main page]

JPH0211930B2 - - Google Patents

Info

Publication number
JPH0211930B2
JPH0211930B2 JP58226321A JP22632183A JPH0211930B2 JP H0211930 B2 JPH0211930 B2 JP H0211930B2 JP 58226321 A JP58226321 A JP 58226321A JP 22632183 A JP22632183 A JP 22632183A JP H0211930 B2 JPH0211930 B2 JP H0211930B2
Authority
JP
Japan
Prior art keywords
processing
pass
processing time
compiler
time required
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.)
Expired - Lifetime
Application number
JP58226321A
Other languages
Japanese (ja)
Other versions
JPS60118935A (en
Inventor
Takaaki Ikeda
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP58226321A priority Critical patent/JPS60118935A/en
Publication of JPS60118935A publication Critical patent/JPS60118935A/en
Publication of JPH0211930B2 publication Critical patent/JPH0211930B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】 〔発明の技術分野〕 本発明は、データ処理装置におけるソースプロ
グラムのコンパイル処理において、コンパイラの
欠陥により無限ループにおちいつた状態を早期に
検出するためのコンパイラ障害自動検出方式に関
する。
Detailed Description of the Invention [Technical Field of the Invention] The present invention provides automatic compiler failure detection for early detection of an infinite loop due to a compiler defect in a source program compilation process in a data processing device. Regarding the method.

〔技術の背景〕[Technology background]

一般に、コンパイル処理において、コンパイラ
自身のパグで異常終了となる場合には、無限ルー
プの場合と、それ以外の特定処理での障害の場合
とがある。通常、コンパイラの異常終了ではメモ
リ内容ダンプの指定が行なわれていないので、後
者の場合、メモリ内容ダンプの指定をとり直して
もう1度処理を繰り返せばバグ位置をつきとめる
ことが可能である。しかし、前者の無限ループに
入つた場合には、たとえば30秒乃至60秒に設定さ
れているCPUの時間監視(CPU TIME OVER)
にかかるまで、そのまま走行を続けた後、異常終
了することになる。しかもこのとき、メモリ内容
のダンプ指定が行なわれていないと、異常終了の
メツセージが出力されるのみであり、また、たと
え異常終了時のダンプ指定が行なわれたとして
も、ループのどの位置でCPU TIME OVERに
かかるかは定まつていないため、異常終了の原因
を知る確実な手掛りが得られず、障害回復にかな
りの手間と時間がかかつていた。
Generally, in the compilation process, when the compiler ends abnormally due to a bug in the compiler itself, there are two cases: an infinite loop, and a failure in other specific processing. Normally, when the compiler terminates abnormally, the memory content dump is not specified, so in the latter case, it is possible to locate the bug by resetting the memory content dump specification and repeating the process once again. However, if the former infinite loop occurs, CPU time monitoring (CPU TIME OVER) that is set to 30 seconds to 60 seconds, for example.
It will continue to run until it starts running, then it will end abnormally. Moreover, at this time, if a dump of the memory contents is not specified, only an abnormal termination message will be output, and even if a dump is specified at the time of abnormal termination, at what point in the loop will the CPU Since it is not determined whether TIME OVER will occur, it is not possible to obtain a reliable clue as to the cause of the abnormal termination, and it takes a considerable amount of time and effort to recover from the failure.

〔発明の目的および構成〕[Object and structure of the invention]

本発明の目的は、コンパイラの欠陥により無限
ループに入つた場合に、CPU時間監視によらず
に異常を検出して、必要な情報を出力することを
可能にする手段を提供することにあり、そのため
本発明は、コンパイラの処理が複数の処理段階
(フエーズ)で構成されていて、ソースプログラ
ムはこれらの処理段階を順次パスして行くことに
よりオブジエクトに変換される点と、各処理段階
でのパス処理時間に極端な差がないことに着目し
て、各処理段階のパス処理時間の間の相対的な比
較によつて無限ループの検出を行なうものであ
る。
An object of the present invention is to provide a means for detecting an abnormality and outputting necessary information without relying on CPU time monitoring when an infinite loop is entered due to a compiler defect. Therefore, in the present invention, compiler processing consists of a plurality of processing stages (phases), and a source program is converted into an object by passing through these processing stages sequentially. Focusing on the fact that there is no extreme difference in pass processing time, infinite loops are detected by relative comparison of pass processing times of each processing stage.

そしてそれによる本発明の構成は、ソースプロ
グラムを複数回のパスによりコンパイル処理する
コンパイラをそなえたデータ処理装置において、
上記コンパイラを用いたコンパイル処理の第1回
のパスに要する処理時間と、第2回以降の各回ご
とのパスに要する処理時間との間の比率について
予測できる最大値を超えた所定の値が予め設定さ
れているテーブル手段と、実際のソースプログラ
ムについてコンパイル処理時に各回ごとのパスに
要する処理時間を計測する手段と、第2回以降の
パスごとに要した処理時間と第1回のパスに要し
た処理時間に上記テーブル手段に設定されている
当該回の比率とを乗じた時間とを比較し、前者が
後者よりも大きくなつたとき無限ループ状態と判
定する手段とを有し、該判定手段が無限ループ状
態と判定したパスにおいて異常終了処理を行なう
ことを特徴とするものである。
According to the configuration of the present invention, in a data processing device equipped with a compiler that compiles a source program in multiple passes,
A predetermined value exceeding the maximum value that can be predicted for the ratio between the processing time required for the first pass of compilation processing using the above compiler and the processing time required for each pass after the second pass is determined in advance. The set table means, the means for measuring the processing time required for each pass during compilation processing for the actual source program, the processing time required for each pass after the second pass, and the processing time required for the first pass. means for comparing the time obtained by multiplying the processing time by the ratio of the times set in the table means, and determining an infinite loop state when the former is larger than the latter, the determining means This method is characterized in that abnormal termination processing is performed on a path determined to be in an infinite loop state.

〔発明の実施例〕[Embodiments of the invention]

以下に、本発明の詳細を実施例にしたがつて説
明する。
The details of the present invention will be explained below with reference to Examples.

第1図は、コンパイラの主要な処理段階を示し
たもので、単語解析、構文解析、最適化、記憶域
割当て、コード生成、アセンブルの各処理からな
り、それぞれの段階で各種の記号表、リテラル
表、中間テキストなどが生成される。
Figure 1 shows the main processing stages of the compiler, which consist of word analysis, syntax analysis, optimization, storage allocation, code generation, and assembly. Tables, intermediate text, etc. are generated.

上記の各処理段階は、実際には10乃至30のパス
処理に分けられている。そしてそれぞれのパスに
要する処理時間は、ソース行数に大体比例するこ
とが言える。したがつて、最初のパスでの処理時
間と他のパスでの処理時間とは、任意のソースに
対して同じ比例関係を保つものと考えることがで
きる。
Each of the above processing stages is actually divided into 10 to 30 pass processes. It can be said that the processing time required for each pass is roughly proportional to the number of source lines. Therefore, the processing time in the first pass and the processing time in the other passes can be considered to maintain the same proportional relationship for any source.

そこで、最初のパスで処理時間を測定し、2番
目以降のパスの処理時間が最初のパスの処理時間
に予め定められた一定の係数を掛けて得られた時
間を超えたならば、コンパイラループが生じてい
るものと判定して異常終了する機構を設け、その
時点での処理情報を出力させる。
Therefore, we measure the processing time in the first pass, and if the processing time in the second and subsequent passes exceeds the time obtained by multiplying the processing time in the first pass by a predetermined constant coefficient, the compiler loop A mechanism is provided to determine that a problem has occurred and terminate abnormally, and output processing information at that point.

第2図は、本発明の1実施例装置の機能構成図
である。図中、1はデータ処理装置、2はコンパ
イル処理部、3は処理情報記憶部、4はループ検
出処理部、5は処理時間タイマ、6はループ判定
係数テーブル、7は異常終了処理部、8は外部記
憶装置、9はプリンタを示す。
FIG. 2 is a functional configuration diagram of an apparatus according to one embodiment of the present invention. In the figure, 1 is a data processing device, 2 is a compilation processing unit, 3 is a processing information storage unit, 4 is a loop detection processing unit, 5 is a processing time timer, 6 is a loop determination coefficient table, 7 is an abnormal termination processing unit, 8 9 indicates an external storage device, and 9 indicates a printer.

コンパイル処理部2は、コンパイラの各処理段
階のパス処理を順次実行する。処理情報記憶部3
はコンパイル処理に必要な全ての情報を記憶す
る。コンパイル処理部2は、パス処理において、
必要に応じて処理時間タイマ5のセツトを要求す
るSTIMERマクロ、テストを要求するT
TIMERマクロ、クリヤを要求するCTIMERマク
ロを、それぞれ発行する。
The compile processing unit 2 sequentially executes pass processing of each processing stage of the compiler. Processing information storage unit 3
stores all the information necessary for the compilation process. In the pass processing, the compile processing unit 2
STIMER macro that requests setting of processing time timer 5 as necessary, T that requests testing.
Issue the TIMER macro and the CTIMER macro that requests clearing, respectively.

ループ検出処理部4は、OSの1機能部として
設けられ、STIMER、TTIMER、CTIMERの
各マクロに応答して処理時間タイマ5を制御する
とともに、処理時間タイマ5のタイムオーバーを
監視し、タイムオーバーの場合に異常終了処理部
7を起動する。
The loop detection processing unit 4 is provided as a functional unit of the OS, and controls the processing time timer 5 in response to the STIMER, TTIMER, and CTIMER macros, monitors the timeout of the processing time timer 5, and detects a timeout in the event of a timeout. The abnormal termination processing unit 7 is activated.

ループ判定係数テーブル6は、2回目以降の各
パスP2,P3,…,Pi,PNについて、それぞれの
処理時間に掛けるべき係数k2,k3,…,ki,…kN
を保持するテーブルである。
The loop determination coefficient table 6 shows the coefficients k 2 , k 3 , ..., ki, ... k N to be multiplied by the respective processing times for the second and subsequent passes P 2 , P 3 , ..., Pi, P N
This is a table that holds .

異常終了処理部7は、コンパイラループが検出
されたとき、コンパイル処理部2の処理を終了さ
せるとともに、処理情報記憶部3にある中間テキ
ストをプリンタ9へ出力させる処理を行なう。
When a compiler loop is detected, the abnormal termination processing section 7 terminates the processing of the compiling processing section 2 and outputs the intermediate text stored in the processing information storage section 3 to the printer 9.

第3図は、上記した実施例装置の処理手順の説
明図である。
FIG. 3 is an explanatory diagram of the processing procedure of the above-described embodiment apparatus.

コンパイル処理部2は第1回のパスP1の始め
にSTIMER(TA)のマクロを発行し、そしてパ
スP1の終りにTTIMER(TB)のマクロを発行す
る。ループ検出処理部4は、STIMER(TA)に
応じて処理時間タイマ5にTAをプリセツトして、
クロツクのカウントダウン動作を行なわせ、そし
てTTIRER(TB)マクロに応じて、処理時間タイ
マ5の残り時間TBを調べ、パスP1の処理時間T1
=TA−TBを求めて記憶する。
The compile processing unit 2 issues the macro STIMER (T A ) at the beginning of the first pass P 1 and issues the macro TTIMER (T B ) at the end of the pass P 1 . The loop detection processing unit 4 presets TA in the processing time timer 5 according to STIMER ( TA ), and
The clock performs a countdown operation, and the remaining time T B of processing time timer 5 is checked according to the TTIRER (T B ) macro, and the processing time T 1 of path P 1 is determined.
Find and memorize =T A −T B.

次に、コンパイル処理部2は、パスP2の始め
にSTIMER(k2・T1)マクロを発行し、終りに
CTIMERマクロを発行する。ループ検出処理部
4は、STIMER(k2・T1)マクロに応じて、ルー
プ判定係数テーブル6から、係数k2を求め、これ
と先に記憶してあるパスP1の処理時間T1とを掛
け合わせて、その結果値を、処理時間タイマ5に
プリセツトする。そしてその後CTIMERマクロ
を受けとるまで処理時間タイマ5のタイムオーバ
ーを監視する。
Next, the compile processing unit 2 issues the STIMER (k 2 · T 1 ) macro at the beginning of pass P 2 , and at the end
Issue the CTIMER macro. The loop detection processing unit 4 obtains a coefficient k 2 from the loop determination coefficient table 6 in response to the STIMER (k 2 · T 1 ) macro, and combines this with the previously stored processing time T 1 of the path P 1 . The resulting value is preset in the processing time timer 5. Thereafter, the timeout of the processing time timer 5 is monitored until the CTIMER macro is received.

タイマの残り時間が零となつてタイムオーバ
ー、すなわちT2>k2・T1になつた場合には、ル
ープと判定して異常終了処理部7に通知し、他
方、タイマがタイムオーバーにならない間に
CTIMERマクロを受けとつた場合、すなわち正
常終了の場合には、タイマをクリヤする。この正
常終了の場合には以上のようなPiの処理を繰り返
す。
If the remaining time of the timer reaches zero and the timeout occurs, that is, T 2 > k 2 · T 1 , it is determined that a loop has occurred and the abnormal termination processing unit 7 is notified.
When the CTIMER macro is received, that is, when the process ends normally, the timer is cleared. In the case of normal termination, the above-mentioned Pi processing is repeated.

異常終了処理部7は、任意のパスPiにおいてル
ープ検出処理部4からループ検出を通知される
と、出口ルーチンを呼び出して実行し、ループに
よるコンパイラ障害の発生をメツセージ出力する
とともに、処理情報記憶部3の中の中間テキスト
をプリンタ出力し、異常終了処理(ABEND)を
行なう。
When the abnormal termination processing section 7 is notified of loop detection from the loop detection processing section 4 in any path Pi, it calls and executes an exit routine, outputs a message indicating that a compiler failure has occurred due to the loop, and also outputs a message to the processing information storage section. Output the intermediate text in 3 to the printer and perform abnormal termination processing (ABEND).

〔発明の効果〕〔Effect of the invention〕

以上のように、本発明によれば、最初のパス
P1で無限ループに入つた場合を除いてコンパイ
ラのループは確実に検出でき、しかもそのパス位
置情報と中間テキストが得られるので、コンパイ
ラのバグの検出が容易となり障害の回復処理に要
する手間と時間の大幅な短縮が可能となる。
As described above, according to the present invention, the first pass
Compiler loops can be reliably detected, except when an infinite loop is entered in P 1 , and the path position information and intermediate text can be obtained, making it easier to detect compiler bugs and reducing the effort required to recover from failures. This allows a significant reduction in time.

【図面の簡単な説明】[Brief explanation of drawings]

第1図はコンパイラの処理段階の説明図、第2
図は本発明の1実施例装置の構成図、第3図は本
発明実施例の処理手順のフロー図である。 図中、1はデータ処理装置、2はコンパイル処
理部、3は処理情報記憶部、4はループ検出処理
部、5は処理時間タイマ、6はループ判定係数テ
ーブル、7は異常終了処理部、8は外部記憶装
置、9はプリンタを示す。
Figure 1 is an explanatory diagram of the processing stages of the compiler, Figure 2
The figure is a configuration diagram of an apparatus according to an embodiment of the present invention, and FIG. 3 is a flowchart of a processing procedure according to an embodiment of the present invention. In the figure, 1 is a data processing device, 2 is a compilation processing unit, 3 is a processing information storage unit, 4 is a loop detection processing unit, 5 is a processing time timer, 6 is a loop determination coefficient table, 7 is an abnormal termination processing unit, 8 9 indicates an external storage device, and 9 indicates a printer.

Claims (1)

【特許請求の範囲】[Claims] 1 ソースプログラムを複数回のパスによりコン
パイル処理するコンパイラをそなえたデータ処理
装置において、上記コンパイラを用いたコンパイ
ル処理の第1回のパスに要する処理時間と、第2
回以降の各回ごとのパスに要する処理時間との間
の比率について予測できる最大値を超えた所定の
値が予め設定されているテーブル手段と、実際の
ソースプログラムについてコンパイル処理時に各
回ごとのパスに要する処理時間を計測する手段
と、第2回以降のパスごとに要した処理時間と第
1回のパスに要した処理時間に上記テーブル手段
に設定されている当該回の比率とを乗じた時間と
を比較し、前者が後者よりも大きくなつたとき無
限ループ状態と判定する手段とを有し、該判定手
段が無限ループ状態と判定したパスにおいて異常
終了処理を行なうことを特徴とするコンパイラ障
害自動検出方式。
1. In a data processing device equipped with a compiler that compiles a source program in multiple passes, the processing time required for the first pass of compilation processing using the compiler and the second
A table means in which a predetermined value that exceeds the maximum value that can be predicted regarding the ratio between the processing time required for each subsequent pass and the processing time required for each pass during compilation processing for the actual source program is set in advance. A means for measuring the required processing time, and a time obtained by multiplying the processing time required for each pass after the second pass and the processing time required for the first pass by the ratio of the relevant time set in the table means. and a means for determining an infinite loop state when the former becomes larger than the latter, and performing abnormal termination processing on a path determined by the determining means to be in an infinite loop state. Automatic detection method.
JP58226321A 1983-11-30 1983-11-30 System for detecting automatically fault of compiler Granted JPS60118935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58226321A JPS60118935A (en) 1983-11-30 1983-11-30 System for detecting automatically fault of compiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58226321A JPS60118935A (en) 1983-11-30 1983-11-30 System for detecting automatically fault of compiler

Publications (2)

Publication Number Publication Date
JPS60118935A JPS60118935A (en) 1985-06-26
JPH0211930B2 true JPH0211930B2 (en) 1990-03-16

Family

ID=16843356

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58226321A Granted JPS60118935A (en) 1983-11-30 1983-11-30 System for detecting automatically fault of compiler

Country Status (1)

Country Link
JP (1) JPS60118935A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0573136U (en) * 1992-03-10 1993-10-05 アイカ工業株式会社 Spiral stairway structure

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5054294A (en) * 1990-09-21 1991-10-08 Carrier Corporation Compressor discharge temperature control for a variable speed compressor
GB2373072A (en) * 2001-03-08 2002-09-11 Escher Technologies Ltd Process for validating a computer program segment that has recursive cycles or loops

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0573136U (en) * 1992-03-10 1993-10-05 アイカ工業株式会社 Spiral stairway structure

Also Published As

Publication number Publication date
JPS60118935A (en) 1985-06-26

Similar Documents

Publication Publication Date Title
JPH0211930B2 (en)
JPS6115239A (en) Processor diagnosis system
KR910006314B1 (en) Fault Detection and Recovery Method for Real-Time Clocks
JPH09231105A (en) Program failure detection method
JPH10171546A (en) Startup monitoring device
JP2990008B2 (en) Processor self-diagnosis method
US4587654A (en) System for processing machine check interruption
JPH0581080A (en) Microprocessor runaway monitoring device
JPH06149762A (en) Competitive behavior test method for computer system
KR200293236Y1 (en) Watchdog Timer Apparatus
JPS632922Y2 (en)
JPH0546426A (en) Self-diagnosis circuit
JP2836084B2 (en) Computer inspection equipment
JPS6272038A (en) Testing method for program runaway detecting device
JPH04160649A (en) Timing setting system for test program
JPH0149975B2 (en)
JPS6162945A (en) Method for inspecting information processor
JPH0314148A (en) Program destruction detection device
JPS60243750A (en) Supervisory circuit of abnormality in computer
JPS61240334A (en) Checking system for information processor
JPH02130646A (en) Abnormality detecting system for cpu
JPH01106231A (en) Abnormal processing detecting system
JPH08305673A (en) Multi CPU monitoring method
JPS5858662A (en) Device testing system
JPS6015749A (en) Inline TMP method