JPH0580692B2 - - Google Patents

Info

Publication number
JPH0580692B2
JPH0580692B2 JP61082127A JP8212786A JPH0580692B2 JP H0580692 B2 JPH0580692 B2 JP H0580692B2 JP 61082127 A JP61082127 A JP 61082127A JP 8212786 A JP8212786 A JP 8212786A JP H0580692 B2 JPH0580692 B2 JP H0580692B2
Authority
JP
Japan
Prior art keywords
program
error
error processing
runaway
processing
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 - Fee Related
Application number
JP61082127A
Other languages
Japanese (ja)
Other versions
JPS62241036A (en
Inventor
Hideyoshi Shoji
Atsuhiko Nishikawa
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.)
Hitachi Ltd
Hitachi Information and Control Systems Inc
Original Assignee
Hitachi Ltd
Hitachi Process Computer Engineering Inc
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 Hitachi Ltd, Hitachi Process Computer Engineering Inc filed Critical Hitachi Ltd
Priority to JP61082127A priority Critical patent/JPS62241036A/en
Publication of JPS62241036A publication Critical patent/JPS62241036A/en
Publication of JPH0580692B2 publication Critical patent/JPH0580692B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、計算機の誤動作防止手段に係り、特
にプログラムが暴走した場合の保護方式に関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to means for preventing malfunction of a computer, and particularly to a protection system when a program runs out of control.

〔従来の技術〕[Conventional technology]

ストアドプログラム方式を用いた計算機システ
ムにおいては、ハードウエアの故障や、プログラ
ムミス、または誤書き込みによるプログラム内容
の破壊等により、所望の順序制御が乱れ予期せぬ
動作を起すことが考えられる。このような誤動作
をプログラムの暴走と呼んでいる。制御用計算機
においては、プログラム暴走により該計算機の制
御下にあるプラントが誤動作し、大きな災害をひ
きおこす危険性がある。
In a computer system using a stored program method, it is conceivable that a hardware failure, a program error, or destruction of program contents due to erroneous writing may disturb desired order control and cause unexpected operations. This kind of malfunction is called program runaway. In a control computer, there is a risk that a program runaway may cause a plant under the control of the computer to malfunction, causing a major disaster.

上記の理由により、プログラムの暴走が発生し
た場合は、速やかに暴走を検出し、計算機動作を
停止させなくてはならない。
If a runaway program occurs due to the above reasons, it is necessary to promptly detect the runaway and stop the computer operation.

プログラムの暴走を検出する方式として従来は
ウオツチドツグタイマー方式と、イリーガル命令
埋込み方式があつた。
Conventional methods for detecting runaway programs include the watchdog timer method and the illegal instruction embedding method.

ウオツチドツグタイマー方式は、特開昭60−
205757号に記載の様に、周期的にトリガされるタ
イマーと、単位時間毎に該タイマーをリセツトす
るプログラムとを設け、一定時間内に該タイマー
のリセツトが行われないと外部に対して暴走を報
告する方式である。この方式においては計算機シ
ステム自体は、暴走発生時に自分自身を停止する
手段を持たず、暴走停止は外部手段によつておこ
なわれる。このため、外部に計算機システムの暴
走検出時に、該システムを停止する手段を必要と
し、また暴走を検出する手段として時間を用いて
いるため、暴走から検出するまでの時間が比較的
長くなつてしまう。
The watchdog timer method was developed in Japanese Patent Application Laid-Open No. 1983-1989.
As described in No. 205757, a timer that is triggered periodically and a program that resets the timer every unit time are provided, and if the timer is not reset within a certain period of time, it will cause a runaway to the outside. This is a reporting method. In this method, the computer system itself does not have a means to stop itself when a runaway occurs, and the runaway is stopped by external means. For this reason, when a runaway of a computer system is detected, an external means for stopping the system is required, and since time is used as a means of detecting runaway, the time from runaway to detection is relatively long. .

イリーガル命令埋込み方式は、特開昭60−
14345に記載の様に、プログラムが格納されてい
ないメモリの空きエリアに、特定の命令コードを
埋込み、プログラムが暴走し空きエリア内の命令
を実行したときに暴走を検出する方式である。イ
リーガル命令埋込み方式においては、プログラム
が暴走するときに、必ず空きエリア内の命令を実
行するという前提に基づいているため、該エリア
を実行しない故障モードにおいては、配慮されて
いなかつた。
The illegal instruction embedding method is
14345, this method embeds a specific instruction code in an empty area of memory where no program is stored, and detects runaway when the program runs out of control and executes instructions in the empty area. The illegal instruction embedding method is based on the premise that when a program runs out of control, an instruction in an empty area is always executed, so failure modes in which the area is not executed are not taken into account.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来、比較的小形の計算機システム、例えばマ
イコンシステムでは、プログラム容量が小さく、
限定された目的で使用されていたため、プログラ
ムは、読み出し専用メモリ(Read Only
Memory、以下ROMと略す)のみに格納されて
いた。しかし、マイクロプロセツサの処理能力の
向上とともにプログラム容量の増加や、汎用性、
拡張性が要求される様になつた。そのため、中大
形システムの様に、外部補助記憶装置からプログ
ラムを読み書き可能メモリ(Randum Access
Memory、以下RAMと略す)にローデイングす
る方法がとられる様になつた。
Traditionally, relatively small computer systems, such as microcomputer systems, have small program capacities.
Because it was used for a limited purpose, the program was stored in read-only memory (Read Only memory).
Memory (hereinafter abbreviated as ROM) only. However, as the processing power of microprocessors improves, program capacity increases, versatility increases,
Expandability is now required. Therefore, like in medium- and large-sized systems, programs can be read and written from an external auxiliary storage device (Randum Access Memory).
The method of loading data into memory (hereinafter abbreviated as RAM) has become popular.

この場合の問題点として、RAM内のプログラ
ムがハードウエアの故障やプログラムミスによつ
て誤つて書込まれ、破壊されてしまつた場合にプ
ログラムが暴走してしまう。特に破壊されたプロ
グラムがエラー処理に関わるものである時には、
計算機を停止させることもできなくなる。
The problem in this case is that if the program in the RAM is accidentally written and destroyed due to a hardware failure or a programming error, the program will run out of control. Especially when the corrupted program is related to error handling,
It will also no longer be possible to stop the computer.

ウオツチドツグタイマー方式においては、外部
の停止手段が必要であることを前に述べたが、小
さなシステムにおいてその様な手段を別途設ける
ことが困難であり、暴走から検出までの時間が長
い問題がある。
As mentioned earlier, the watchdog timer method requires an external stopping means, but it is difficult to separately provide such a means in a small system, and the problem is that it takes a long time to detect a runaway. There is.

また、イリーガル命令埋込み方式においては、
誤書込みに起因する場合、暴走検出が困難とな
る。
In addition, in the illegal instruction embedding method,
If it is caused by erroneous writing, it becomes difficult to detect runaway.

本発明の目的は、エラー処理などのプログラム
がRAMに格納されるシステムにおけるプログラ
ムを暴走を検出し、システムを確実に停止させる
方式を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a method for detecting program runaway in a system in which programs such as error processing programs are stored in RAM, and reliably stopping the system.

〔問題点を解決するための手段〕[Means for solving problems]

プログラムが暴走した場合、何らかの例外が発
生するだろうことは容易に考えられる。通常の場
合は、例外処理プログラムが実行され、その暴走
を検出することが可能である。しかしながら、該
例外処理プログラムもまた、破壊されていると、
その実行途中で再び例外が発生するため、永久ル
ープに落入り、暴走の検出は不可能となる。
If the program runs out of control, it is easy to imagine that some kind of exception will occur. Normally, an exception handling program is executed and runaway can be detected. However, if the exception handling program is also destroyed,
During execution, an exception occurs again, resulting in an endless loop, making it impossible to detect a runaway.

第3図は上記プロセスの説明図である。暴走し
たプログラム4が、イリーガル発生時のエラー処
理プログラム5を破壊した後でイリーガル命令に
よるエラー発生した場合、イリーガル発生時のエ
ラー処理が実行される。しかし、この処理プログ
ラムが破壊されているため、再び同じイリーガル
エラーが発生しループしてしまう。または、他の
エラーが発生し、他のエラー処理6が実行され
る。
FIG. 3 is an explanatory diagram of the above process. If an error occurs due to an illegal instruction after the runaway program 4 destroys the error handling program 5 when an illegal occurs, error handling when an illegal occurs is executed. However, because this processing program has been destroyed, the same illegal error occurs again and the process loops. Alternatively, another error occurs and other error processing 6 is executed.

そこで、本発明は、上記永久ループに落ち入る
ことなしに暴走を検出するため、エラー処理を実
行するプログラムにエラー処理中を示す手段を設
け、プログラムの暴走が発生した際には、この手
段を、絶対に書き込まれることのないROM上の
プログラムにより判定することによつて、エラー
処理を実行するプログラムにおけるエラー発生を
検出し、このエラー発生を検出した場合には計算
機システムを停止する処理を行なうようにしたも
のである。
Therefore, in order to detect runaway without falling into the endless loop, the present invention provides a means for indicating that error processing is in progress in a program that executes error processing, and when a runaway of the program occurs, this means is provided. , detects the occurrence of an error in a program that executes error processing by making a determination using a program on the ROM that is never written, and when this error occurrence is detected, performs processing to stop the computer system. This is how it was done.

〔作用〕[Effect]

ソフトウエアで書込みができるメモリ上のエラ
ー処理中を示す手段をエラー処理開始時にセツト
し、終了時にクリアされるようにプログラムで制
御する。このエラー処理中を示す手段の判定をエ
ラー処理開始時に、かつ、ソフトウエアで書込み
ができないメモリ上のプログラムで判定すること
で、エラー処理中に再度、エラーが発生した2重
エラーを検出することができ、プログラムの暴走
を防止できる。
A means for indicating that error processing is in progress on a memory that can be written by software is set at the start of error processing, and controlled by the program so that it is cleared at the end. By determining this means of indicating that error processing is in progress at the start of error processing and by a program in memory that cannot be written to by software, it is possible to detect a double error in which an error occurs again during error processing. This prevents the program from running out of control.

〔実施例〕〔Example〕

次に本発明の実施例について図面をもちいて説
明する。まず、プログラムの暴走のプロセスを第
3図を用いて説明する。暴走したプログラム4
が、実行中にエラー処理プログラム(イリーガル
も含む)を破壊した後で、何らかのエラー、この
場合はイリーガル命令によるエラーが発生した場
合、イリーガル発生時のエラー処理が実行され
る。しかし、この処理プログラムが破壊されてい
るため、エラー、即ち同じイリーガルエラーが発
生し無限ループを形成したり、イリーガル以外の
他のエラーが発生し、他のエラー処理6が実行さ
れる。
Next, embodiments of the present invention will be described with reference to the drawings. First, the process of program runaway will be explained with reference to FIG. Runaway program 4
However, if an error occurs after the error processing program (including illegal ones) is destroyed during execution, in this case an error caused by an illegal instruction, the error handling at the time of illegal occurrence is executed. However, since this processing program is destroyed, an error, that is, the same illegal error occurs, forming an infinite loop, or another error other than the illegal error occurs, and another error processing 6 is executed.

第1図は本発明の全体構成図でプログラム1が
暴走しイリーガル命令によるエラーが発生した場
合のエラー処理フローは次の様になる。まず、
ROM上のエラー処理プログラム2でエラー処理
中フラグが“1”であるかどうか、判定する。プ
ログラム1でエラー発生時には、フラグがクリア
(=0)されているので、次にこのフラグをセツ
トし、RAM上のエラー処理プログラム3に分岐
する。プログラム3ではエラー処理終了後、フラ
グをクリアする。プログラム3が破壊されている
場合は、フラグがセツトされた状態で再度プログ
ラム2に分岐する。フラグが“1”であるから、
フラグの判定後CPUをストツプする処理を行う。
FIG. 1 is an overall configuration diagram of the present invention, and the error processing flow when the program 1 goes out of control and an error occurs due to an illegal instruction is as follows. first,
The error processing program 2 on the ROM determines whether the error processing flag is "1". When an error occurs in program 1, the flag is cleared (=0), so this flag is set next and the program branches to error processing program 3 on RAM. In program 3, the flag is cleared after the error processing is completed. If program 3 is destroyed, the program branches to program 2 again with the flag set. Since the flag is “1”,
After determining the flag, perform processing to stop the CPU.

第2図は本発明に必要なハードウエアのシステ
ム構成を示している。CPU10と、RAM11、
ROM12、I/O13間には、アドレスバス1
4とデータバス15がインターフエイスされ、こ
のパスを介してデータ転送を行う。さらにこのデ
ータ転送を制御するためのリード信号16が、同
じくCPU10、RAM11、ROM12、I/O
13間にインターフエイスされている。もう一つ
の制御信号であるライト信号17は、ROM12
を除いて、インターフエイスされている。以上の
構成において、CPU10からRAM11の内容を
リードまたはライトすることができ、CPU10
からROM12の内容はリードのみ行える。
FIG. 2 shows the hardware system configuration necessary for the present invention. CPU10, RAM11,
Address bus 1 is connected between ROM12 and I/O13.
4 and a data bus 15, and data transfer is performed via this path. Furthermore, the read signal 16 for controlling this data transfer is also sent to the CPU 10, RAM 11, ROM 12, I/O
It is interfaced between 13 and 13. The write signal 17, which is another control signal, is transmitted to the ROM 12.
Except for the interface. In the above configuration, the content of RAM 11 can be read or written from CPU 10, and CPU 10 can read or write the contents of RAM 11.
From this point on, the contents of the ROM 12 can only be read.

次に、ROM12内のエラー処理フローは第1
図に示されるごとく、処理21でエラー処理フラ
グ=1?であるのか判定を行う。このフラグが
“1”であつた場合は、エラー処理中に再度エラ
ーが発生した2重障害であるから、プログラムの
暴走、無限ループを防止するため、エラー処理を
行なわず処理22でCPUをストツプさせる。フ
ラグが“0”であつた場合は、前記した2重障害
ではない。処理23でエラー処理中フラグをセツ
トし、処理24でRAM上のエラー処理に分岐す
る。
Next, the error processing flow in the ROM12 is
As shown in the figure, in process 21, is the error processing flag = 1? Determine if it is. If this flag is "1", it is a double failure in which an error occurred again during error processing, so in order to prevent the program from running out of control and ending up in an infinite loop, the CPU is stopped in process 22 without error processing. let If the flag is "0", there is no double failure as described above. In process 23, an error processing flag is set, and in process 24, the process branches to error processing on the RAM.

エラー処理中フラグはCPU10からリードま
たはライタ可能なRAM11内にあり、セツト即
ち“1”の時は、エラー処理中であり、クリア即
ち“0”の時はエラー処理中でないことを示す。
The error processing flag is located in the RAM 11 which can be read or written by the CPU 10, and when set, ie, "1", it indicates that error processing is in progress, and when cleared, ie, "0", it indicates that error processing is not in progress.

RAM内のエラー処理フローは第1図に示され
るごとく処理31ではエラー要因の判定さらにエ
ラーメツセージの出力などのエラー処理を行つた
後、処理32でエラー処理中フラグをクリアす
る。
The error processing flow in the RAM is shown in FIG. 1. In process 31, the cause of the error is determined and error processing such as outputting an error message is performed, and then in process 32, the error processing flag is cleared.

計算機における障害、エラー要因は、ソフトウ
エアまたはハードウエア両面とも当然一つの要因
だけでなく多数存在する。エラー発生時にCPU
10は、その要因を判定し、各、エラー処理の先
頭アドレスがセーブされているエラー処理用ベク
タテーブルから対応するエラー処理先頭アドレス
をリードし、このリードしたアドレスからエラー
処理を行う。第4図は本発明に用いられるベクタ
テーブルの構成図を示す。全てのエラー処理用ベ
クタテーブルにエラー処理中フラグを判定する
ROMのエラー処理プログラム2の先頭アドレス
を格納する。
Naturally, there are many causes of failures and errors in computers, both in terms of software and hardware, rather than just one. CPU when error occurs
10 determines the cause, reads the corresponding error processing start address from the error processing vector table in which the error processing start addresses are saved, and performs error processing from this read address. FIG. 4 shows a configuration diagram of a vector table used in the present invention. Determine the error processing flag in all error processing vector tables
Stores the start address of the error processing program 2 in the ROM.

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

以上のように本発明によれば、プログラムで破
壊されない様にハードウエアによりライトプロテ
クトされているメモリ上をプログラムが、エラー
フラグの判定を行うことで、2重エラーを検出で
きるので、実際にはプログラムが暴走していても
それを検出できないという事態、または、直接の
エラー要因に対するエラー処理が行なわれず、エ
ラー解析が複雑になるという事態を避けることが
でき、プログラム暴走検出時間の減少と、信頼性
を向上させることができる。
As described above, according to the present invention, a double error can be detected by a program determining the error flag on memory that is write-protected by hardware so that it is not destroyed by the program. It is possible to avoid situations where a runaway program cannot be detected, or where error processing is not performed for the direct cause of the error, making error analysis complicated. can improve sex.

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

第1図は本発明の全体構成図、第2図は本発明
のシステム構成図、第3図は従来のプログラム暴
走保護方式の問題点を示す図、第4図はエラー処
理用のベクタテーブルと処理フローの関係を示す
図である。 1,4……暴走プログラム、2……ROM上の
エラー処理プログラム、3……RAM上のエラー
処理プログラム、5……イリーガル発生時のエラ
ー処理プログラム、6……他のエラー処理プログ
ラム、10……CPU、11……RAM、12……
ROM、13……I/O、14……アドレスバ
ス、15……データバス、16……リード信号、
17……ライト信号。
Figure 1 is an overall configuration diagram of the present invention, Figure 2 is a system configuration diagram of the present invention, Figure 3 is a diagram showing problems with the conventional program runaway protection system, and Figure 4 is a diagram showing a vector table for error handling. FIG. 3 is a diagram showing the relationship of processing flows. 1, 4...Runaway program, 2...Error processing program on ROM, 3...Error processing program on RAM, 5...Error processing program when illegal occurs, 6...Other error processing programs, 10... ...CPU, 11...RAM, 12...
ROM, 13...I/O, 14...Address bus, 15...Data bus, 16...Read signal,
17... Light signal.

Claims (1)

【特許請求の範囲】 1 プログラムが暴走した場合にエラー処理プロ
グラムによりエラー処理を行なう計算機システム
のプログラム暴走保護方式において、 エラー処理プログラムにエラー処理中を示す手
段を設け、プログラムの暴走が発生した際には、
前記エラー処理中を示す手段を、読み出し専用メ
モリに格納されているプログラムにより判定する
ことによつて、前記エラー処理プログラムにおけ
るエラー発生を検出し、該エラー発生を検出した
場合には計算機システムを停止する処理を行なう
ことを特徴とするプログラム暴走保護方式。
[Claims] 1. In a program runaway protection method for a computer system in which an error handling program performs error processing when a program runs out of control, the error handling program is provided with means for indicating that error processing is in progress, and when a program runaway occurs, for,
Detecting the occurrence of an error in the error processing program by determining the means indicating that the error processing is in progress using a program stored in a read-only memory, and stopping the computer system when the error occurrence is detected. A program runaway protection method that performs processing that
JP61082127A 1986-04-11 1986-04-11 Protecting system for program runway Granted JPS62241036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61082127A JPS62241036A (en) 1986-04-11 1986-04-11 Protecting system for program runway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61082127A JPS62241036A (en) 1986-04-11 1986-04-11 Protecting system for program runway

Publications (2)

Publication Number Publication Date
JPS62241036A JPS62241036A (en) 1987-10-21
JPH0580692B2 true JPH0580692B2 (en) 1993-11-10

Family

ID=13765746

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61082127A Granted JPS62241036A (en) 1986-04-11 1986-04-11 Protecting system for program runway

Country Status (1)

Country Link
JP (1) JPS62241036A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56164444A (en) * 1980-05-23 1981-12-17 Toshiba Corp Error check method for controller of microprogram
JPS57199056A (en) * 1981-06-03 1982-12-06 Nec Corp Execution and monitoring device for control program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56164444A (en) * 1980-05-23 1981-12-17 Toshiba Corp Error check method for controller of microprogram
JPS57199056A (en) * 1981-06-03 1982-12-06 Nec Corp Execution and monitoring device for control program

Also Published As

Publication number Publication date
JPS62241036A (en) 1987-10-21

Similar Documents

Publication Publication Date Title
JPH02156357A (en) Program destruction preventing method
JPH0580692B2 (en)
JP2000099372A (en) Computer system
JP2562838B2 (en) Processor and store buffer control method
JPH0430245A (en) Multiprocessor control system
EP0655686B1 (en) Retry control method and device for control processor
JPH0644145A (en) Memory error saving system
JPS62175834A (en) Detecting circuit for runaway of central processing unit
JPH0319574B2 (en)
JPS6336431Y2 (en)
JPH0230060B2 (en)
JPH0212443A (en) Duplex processor
JPS6020769B2 (en) Microprogram control method
JPH0665941U (en) Program operating device
JPH0480860A (en) Program loading system
JPH03230216A (en) Processing system for writing processing part to storage device
JPH0395634A (en) Restart control system for computer system
JPH01166145A (en) Cpu monitor
JPS6112585B2 (en)
JPS63168733A (en) Microprogram controller
JPS5975348A (en) Method and device for detecting abnormality of computer
JPH02148340A (en) System for controlling writing in control storage
JPH02263243A (en) Runaway processor for computer
JPS63150732A (en) Program running supervisory equipment
JPH06168161A (en) Executing error detecting method for unstored program area in data processor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees