JP2006018705A - Memory access trace system and memory access trace method - Google Patents

Memory access trace system and memory access trace method Download PDF

Info

Publication number
JP2006018705A
JP2006018705A JP2004197531A JP2004197531A JP2006018705A JP 2006018705 A JP2006018705 A JP 2006018705A JP 2004197531 A JP2004197531 A JP 2004197531A JP 2004197531 A JP2004197531 A JP 2004197531A JP 2006018705 A JP2006018705 A JP 2006018705A
Authority
JP
Japan
Prior art keywords
memory
trace
access
area
memory area
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
JP2004197531A
Other languages
Japanese (ja)
Inventor
Kozo Matsushita
耕三 松下
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 JP2004197531A priority Critical patent/JP2006018705A/en
Publication of JP2006018705A publication Critical patent/JP2006018705A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technique capable of tracing a memory access in memory areas of a wide range or in a memory area assigned to an application. <P>SOLUTION: Upon receiving an assignment request of memory from a program 2, an OS 1 acquires a memory area to be assigned to the program 2 from a memory area 4, and lays the acquired memory area into an access prohibiting state by an MMU 3 as an inspection object memory area. The OS 1 ensures a trace data area 12 corresponding to the inspection object memory area. If access to the inspection object memory area occurs, the MMU 3 generates an access exception, and a trace processing part 10 records collected trace information to the trace data area 12 corresponding to the inspection object memory area where the access exception is generated. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は,検査対象となるメモリ領域へのメモリアクセスをトレースする技術に関するものであり,特に,メモリ管理ユニットのメモリ保護機能を利用して検査対象メモリ領域へのメモリアクセスをトレースするメモリアクセストレースシステムおよびメモリアクセストレース方法に関するものである。   The present invention relates to a technique for tracing memory access to a memory area to be inspected, and in particular, a memory access trace for tracing memory access to a memory area to be inspected using a memory protection function of a memory management unit. The present invention relates to a system and a memory access trace method.

メモリ管理ユニット(以下,MMU(Memory Management Unit)という)は,メモリのマッピングや保護を目的としたメモリ管理のためのハードウェアである。このMMUが備える重要な機能の1つに,メモリ保護機能がある。   A memory management unit (hereinafter referred to as MMU (Memory Management Unit)) is hardware for memory management for the purpose of memory mapping and protection. One important function of the MMU is a memory protection function.

MMUにおけるメモリ保護機能とは,プログラムによってアクセスできるメモリ領域を制限する機能である。例えば,オペレーティング・システム(OS)本体などが格納されているシステム領域にアプリケーションがアクセスできると,システムの破壊を招いてしまう可能性がある。MMUのメモリ保護機能により,システム領域にアプリケーションがアクセスできないように制限すると,アプリケーションが暴走したとしても,システムへの影響を最小限に抑えることができる。   The memory protection function in the MMU is a function that limits a memory area that can be accessed by a program. For example, if an application can access a system area in which an operating system (OS) main body or the like is stored, the system may be destroyed. If the MMU memory protection function restricts the application from accessing the system area, the impact on the system can be minimized even if the application runs away.

MMUのメモリ保護機能を利用してメモリへの書込みをトレースすることにより,不当なメモリアクセスを検知する技術がある(例えば,特許文献1参照)。特許文献1に記載された技術では,指定された検査対象アドレスを含むページに対してMMUによって書込み禁止属性を設定し,書込み保護例外が発生した場合にはそのトレース情報を記録し,書込み保護例外の発生が検査対象アドレスへのアクセスであった場合にその変更値があらかじめ設定されている例外停止条件を満たすかを判断し,条件を満たす場合にはデバッグ対象プログラムを停止させている。   There is a technique for detecting illegal memory access by tracing memory writing using the memory protection function of the MMU (see, for example, Patent Document 1). In the technique described in Patent Document 1, a write protection attribute is set by the MMU for a page including a specified inspection target address, and when a write protection exception occurs, the trace information is recorded and the write protection exception is recorded. When the occurrence of the error is an access to the inspection target address, it is determined whether the changed value satisfies a preset exception stop condition, and if the condition is satisfied, the debug target program is stopped.

また,メモリ領域に対してアクセス禁止を設定することにより不当なメモリアクセスを検知する他の技術として,例えば,特許文献2に記載された技術がある。特許文献2に記載された技術では,アプリケーションからの要求により割り当てられたメモリ領域の終端に接する隣接メモリ領域をアクセス不可属性に設定し,アプリケーションが割り当てられたメモリ領域を超えて隣接メモリ領域に対してアクセスしたときに発生する例外割り込みを契機に,コンテキスト情報をログファイルに記録したり,アプリケーションを強制終了させたりしている。
特開2002−14843号公報 特開2002−55851号公報
As another technique for detecting an illegal memory access by setting access prohibition to the memory area, for example, there is a technique described in Patent Document 2. In the technique described in Patent Document 2, an adjacent memory area that is in contact with the end of a memory area allocated by a request from an application is set as an inaccessible attribute, and the memory area to which the application is allocated exceeds the allocated memory area. Context information is recorded in the log file or the application is forcibly terminated when an exception interrupt occurs when accessed.
JP 2002-14843 A JP 2002-55851 A

特許文献1に記載された技術では,検査対象アドレスに対してアクセスがあるか,検査対象アドレスを含むページに対してアクセスがある場合にのみ,トレースを行っている。しかし,不当なメモリアクセスは常に同じアドレスで発生するわけではないので,広い範囲のメモリ領域でメモリアクセスをトレースしたい場合などには多数の検査対象アドレスの指定を行わなければならず,あまり現実的ではない。   In the technique described in Patent Document 1, tracing is performed only when there is access to an inspection target address or access to a page including the inspection target address. However, since illegal memory access does not always occur at the same address, a large number of addresses to be inspected must be specified when tracing memory access in a wide range of memory areas. is not.

また,特許文献2に記載された技術では,アプリケーションに対して割り当てられたメモリ領域にはアクセス禁止が設定されないため,アプリケーションに割り当てられたメモリ領域へのメモリアクセスをトレースすることはできない。   In the technique described in Patent Document 2, access prohibition is not set for the memory area allocated to the application, and therefore, memory access to the memory area allocated to the application cannot be traced.

本発明は,上記の問題点の解決を図り,広い範囲のメモリ領域でのメモリアクセスをトレースすることが可能となり,また,アプリケーションに割り当てられたメモリ領域でのメモリアクセスをトレースすることが可能となるメモリアクセストレースシステムおよびメモリアクセストレース方法を提供することを目的とする。   The present invention can solve the above problems, trace memory accesses in a wide range of memory areas, and trace memory accesses in memory areas allocated to applications. An object of the present invention is to provide a memory access trace system and a memory access trace method.

本発明は,上記の課題を解決するため,ある範囲で指定された検査対象メモリ領域をMMUのメモリ保護機能でアクセス禁止状態にし,その検査対象メモリ領域へのアクセスがあったときに発生するアクセス例外を契機に,アクセスされたデータ,アクセスされたメモリのアドレス,アクセスを行った命令のアドレス,アクセスがリードアクセスであるかライトアクセスであるか等のトレース情報を採取し,記録することを特徴とする。   In order to solve the above-described problem, the present invention makes an access prohibited state when an inspection target memory area specified in a certain range is prohibited by the memory protection function of the MMU, and access occurs when the inspection target memory area is accessed. Collecting and recording trace information such as accessed data, accessed memory address, accessed instruction address, and whether the access is a read access or a write access when an exception occurs And

これにより,広い範囲の検査対象となるメモリ領域に対してのメモリアクセスをトレースすることが可能となり,広い範囲のメモリ領域での不当メモリアクセスを検知することが可能となる。   As a result, it is possible to trace memory access to a memory area to be inspected over a wide range, and it is possible to detect illegal memory access in a wide range of memory areas.

また,プログラムに対してOSが動的にメモリを割り当てるときに,動的に割り当てられるメモリ領域を検査対象メモリ領域としてMMUのメモリ保護機能でアクセス禁止状態にし,その検査対象メモリ領域へのアクセスがあったときに発生するアクセス例外を契機にトレース情報を採取し,記録することを特徴とする。   In addition, when the OS dynamically allocates memory to a program, the memory area that is dynamically allocated is set as a memory area to be inspected and access is prohibited by the memory protection function of the MMU, and the memory area to be inspected is accessed. Trace information is collected and recorded when an access exception occurs.

これにより,プログラムに対して動的に割り当てられたメモリ領域に対してのメモリアクセスをトレースすることが可能となり,プログラムに対して動的に割り当てられたメモリ領域での不当メモリアクセスを検知することが可能となる。   This makes it possible to trace memory access to the memory area dynamically allocated to the program, and to detect illegal memory access in the memory area dynamically allocated to the program. Is possible.

また,あらかじめトレース情報の採取条件を設定し,条件が満たされる場合にのみトレース情報を採取し,記録することを特徴とする。このとき,例えばライトアクセス時にのみトレース情報を採取したい場合には,MMUによって検査対象メモリ領域をライトアクセス禁止状態に設定し,ライトアクセス時にのみアクセス例外が発生するようにしてもよいし,または,検査対象メモリ領域をアクセス禁止状態に設定し,アクセス例外が発生してからそのアクセスがライトアクセスであるかを判断するようにしてもよい。   In addition, trace information collection conditions are set in advance, and trace information is collected and recorded only when the conditions are satisfied. At this time, for example, when it is desired to collect trace information only at the time of write access, the memory area to be inspected may be set to the write access prohibited state by the MMU, and an access exception may be generated only at the time of write access. The memory area to be inspected may be set to an access prohibited state, and it may be determined whether the access is a write access after an access exception occurs.

これにより,必要な条件に合ったトレース情報のみを採取することが可能となり,必要最小限の資源で不当メモリアクセスを検知することが可能となる。   As a result, it is possible to collect only trace information that meets the necessary conditions, and it is possible to detect illegal memory accesses with the minimum necessary resources.

本発明によって,固定アドレスではない,広い範囲のメモリ領域を検査対象として不当メモリアクセスを検知することができるようになり,障害調査の効率を上げることができるようになる。   According to the present invention, it becomes possible to detect an illegal memory access in a wide range of memory areas that are not fixed addresses, and to improve the efficiency of fault investigation.

また,割り当てによって動的に変化するメモリ領域を検査対象として不当メモリアクセスを検知することができるようになり,障害調査の効率を上げることができるようになる。   In addition, it becomes possible to detect an illegal memory access by using a memory area that dynamically changes depending on the allocation as an inspection target, thereby improving the efficiency of failure investigation.

また,トレース情報の採取をあらかじめ指定した条件に合うものだけに限定することができるようになるので,トレース情報量の増大化を抑え,少ない資源で不当メモリアクセスを検知できるようになる。   In addition, since the collection of trace information can be limited to only those that meet a pre-specified condition, an increase in the amount of trace information can be suppressed, and illegal memory accesses can be detected with fewer resources.

以下,本発明の実施の形態について,図を用いて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

〔実施の形態1〕
図1は,本発明の実施の形態におけるメモリアクセストレースシステムの構成例(1)を示す図である。メモリアクセストレースシステムは,OS実行手段(以下,単に「OS」という)1,検索対象のプログラムを実行するプログラム実行手段(以下,単に「プログラム」という)2,MMU(メモリ管理ユニット)3,メモリ領域4から構成される。また,OS1は,アクセス禁止例外ハンドラ11と,複数のトレースデータ域12から構成されるトレース処理部10を備える。
[Embodiment 1]
FIG. 1 is a diagram showing a configuration example (1) of a memory access trace system according to an embodiment of the present invention. The memory access trace system includes an OS execution means (hereinafter simply referred to as “OS”), a program execution means (hereinafter simply referred to as “program”) for executing a search target program, an MMU (memory management unit) 3, a memory The region 4 is configured. The OS 1 includes an access prohibition exception handler 11 and a trace processing unit 10 including a plurality of trace data areas 12.

プログラム2は,システムコールによって,OS1に対してメモリの割り当てを要求する。このときプログラム2は,メモリの割り当て要求と同時に,検査対象メモリ領域(この場合はプログラム2に割り当てられるメモリ領域)を一意に識別するための識別IDや,トレース情報を記録するための領域であるトレースデータ域12をメモリ領域4から獲得するときのサイズであるトレース域のサイズなども指定する。これにより,検査対象メモリ領域ごとにトレースデータ域12のサイズを指定することが可能となる。   The program 2 requests the OS 1 to allocate memory by a system call. At this time, the program 2 is an area for recording the identification ID for uniquely identifying the memory area to be inspected (in this case, the memory area allocated to the program 2) and the trace information simultaneously with the memory allocation request. The size of the trace area, which is the size when the trace data area 12 is acquired from the memory area 4, is also specified. This makes it possible to specify the size of the trace data area 12 for each inspection target memory area.

本実施の形態において,メモリの割り当て要求時にOS1がプログラム2から受け付けるシステムコールは,例えば次のようになる。   In the present embodiment, the system call that the OS 1 accepts from the program 2 when a memory allocation request is made is as follows, for example.

char *mem_trace(id,trace_size,size,option)
int id;
size_t trace_size;
size_t size;
char *option;
このシステムコールの例において,idには,検査対象メモリ領域を一意に識別するための識別IDを指定し, trace_sizeには,トレース情報を記録するための領域であるトレースデータ域12をメモリ領域4から獲得するときのサイズを指定し,sizeには,割り当てを要求するメモリのサイズを指定する。
char * mem_trace (id, trace_size, size, option)
int id;
size_t trace_size;
size_t size;
char * option;
In this example of the system call, an identification ID for uniquely identifying the inspection target memory area is specified for id, and a trace data area 12 that is an area for recording trace information is specified for the trace_size. Specifies the size of the memory to be acquired from the file, and size specifies the size of the memory that requires allocation.

また,optionによってトレース情報の採取条件を指定することにより,採取するトレース情報を必要なものだけに制限することもできる。検査対象メモリ領域ごとにトレース情報の採取条件を指定することが可能である。optionで指定するトレース情報の採取条件には,例えば,次のようなものがある。
(a)readonly :リードアクセス時にのみトレースを行う。
(b)writeonly :ライトアクセス時にのみトレースを行う。
(c)range m n :m〜nの範囲以外の値がアクセスされた場合にのみトレースを行う。
(d)boundary n :nバウンダリの値がアクセスされた場合にのみトレースを行う。
(e)inst a b :aアドレス〜bアドレスの間の命令を実行しているときに検査対象メモリ領域に対してアクセスがあった場合にのみトレースを行う。
You can also limit the trace information to be collected to the required one by specifying the trace information collection condition with option. Trace information collection conditions can be specified for each inspection target memory area. Examples of trace information collection conditions specified by option include the following.
(A) readonly: Traces only during read access.
(B) writeonly: Traces only during write access.
(C) range mn: Trace is performed only when a value outside the range of m to n is accessed.
(D) boundary n: Traces only when the value of the n boundary is accessed.
(E) inst ab: Trace is performed only when an inspected memory area is accessed while an instruction between addresses a and b is being executed.

このようなoptionは,例えば,次のように指定する。   Such an option is specified as follows, for example.

char *option[][]= {
"writeonly",
"boundary 4"
};
このoptionの指定の例では,ライトアクセス時であって4バウンダリ(アドレスが4の倍数)の値がアクセスされた場合にのみトレースを行うようにトレース情報の採取条件が指定されている。
char * option [] [] = {
"writeonly",
"boundary 4"
};
In this example of option specification, the trace information collection condition is specified so that tracing is performed only when a value of 4 boundaries (address is a multiple of 4) is accessed during write access.

OS1は,システムコールによってプログラム2からメモリの割り当ての要求を受けると,メモリ領域4から指定されたサイズのメモリ領域を獲得してプログラム2に割り当て,同時に,プログラム2に割り当てたメモリ領域を検査対象メモリ領域としてアクセス禁止状態にするように,MMU3に依頼する。MMU3は,OS1からの依頼により,検査対象メモリ領域をアクセス禁止状態にする。   When the OS 1 receives a memory allocation request from the program 2 by a system call, the OS 1 acquires a memory area of the specified size from the memory area 4 and allocates it to the program 2 and simultaneously checks the memory area allocated to the program 2 for inspection. The MMU 3 is requested to make the access prohibited state as a memory area. The MMU 3 puts the memory area to be inspected into an access prohibited state in response to a request from the OS 1.

また,OS1は,指定されたサイズのトレースデータ域12をメモリ領域4から獲得する。獲得したトレースデータ域12の先頭には,ヘッダ情報を設けて識別ID,検査対象メモリ領域のアドレス情報,トレース情報の採取条件等を記録する。また,獲得したトレースデータ域12は,トレース処理部10においてチェーン構造にしておく。   In addition, the OS 1 acquires the trace data area 12 having a specified size from the memory area 4. At the beginning of the acquired trace data area 12, header information is provided to record an identification ID, address information of the memory area to be inspected, conditions for collecting trace information, and the like. Further, the acquired trace data area 12 has a chain structure in the trace processing unit 10.

図2は,トレースデータ域のデータ構造の例を示している。トレースデータ域12は,例えば図2に示すように,管理情報を記憶するヘッダ部と,採取したトレース情報が格納されるデータ格納域のデータ部とからなり,ヘッダ部には,トレースデータ域の識別ID,データ格納域のサイズ,検査対象メモリ領域のアドレスおよびサイズ等の検査対象メモリ領域情報,トレース情報採取条件,およびトレースデータ域12が複数設けられる場合の次のトレースデータ域へのポインタ等の情報が格納される。   FIG. 2 shows an example of the data structure of the trace data area. For example, as shown in FIG. 2, the trace data area 12 includes a header part for storing management information and a data part of a data storage area for storing the collected trace information. The header part includes a trace data area. Identification ID, data storage area size, inspection target memory area information such as address and size of inspection target memory area, trace information collection conditions, pointer to next trace data area when multiple trace data areas 12 are provided, etc. Is stored.

図3は,本実施の形態1におけるOSの処理フローチャートである。まず,プログラム2からシステムコールによってメモリの割り当て要求を受けると(ステップS10),そのシステムコールで指定された識別IDが,すでに他のトレースデータ域12のヘッダ情報に記録されている識別IDと重複しているかを確認し(ステップS11),重複していればエラー復帰する(ステップS12)。   FIG. 3 is a process flowchart of the OS according to the first embodiment. First, when a memory allocation request is received from the program 2 by a system call (step S10), the identification ID specified by the system call overlaps with the identification ID already recorded in the header information of the other trace data area 12 (Step S11), and if it is duplicated, an error is restored (step S12).

ステップS11において識別IDが重複していなければ,割り当てが要求されたメモリのサイズと指定されたトレースデータ域12のサイズの分だけ,充分にメモリ領域4に空きがあるかを確認し(ステップS13),空きがなければエラー復帰する(ステップS12)。   If the identification IDs are not duplicated in step S11, it is confirmed whether there is enough space in the memory area 4 by the size of the memory requested for allocation and the size of the designated trace data area 12 (step S13). ), If there is no space, the error is restored (step S12).

ステップS13においてメモリ領域4に充分な空きがあれば,プログラム2への割り当てメモリ領域とトレースデータ域12とを,メモリ領域4から獲得する(ステップS14)。また,MMU3を制御して獲得した割り当てメモリ領域を検査対象メモリ領域としてアクセス禁止状態にする(ステップS15)。   If there is sufficient space in the memory area 4 in step S13, the memory area allocated to the program 2 and the trace data area 12 are acquired from the memory area 4 (step S14). Further, the allocated memory area acquired by controlling the MMU 3 is set to the access prohibited state as the inspection target memory area (step S15).

また,獲得したトレースデータ域12の先頭にヘッダ情報を設定し,指定された識別ID,獲得した検査対象メモリ領域のアドレス情報,指定されたトレース情報の採取条件等を記録する(ステップS16)。また,獲得したトレースデータ域12を,トレース処理部10のトレースデータ域12のチェーンに繋ぐ(ステップS17)。その後,獲得した検査対象メモリ領域の先頭アドレスを復帰情報として,プログラム2に復帰する(ステップS18)。   Further, header information is set at the head of the acquired trace data area 12, and the specified identification ID, the address information of the acquired memory area to be inspected, the collection conditions of the specified trace information, etc. are recorded (step S16). Further, the acquired trace data area 12 is connected to the chain of the trace data area 12 of the trace processing unit 10 (step S17). Thereafter, the program returns to the program 2 using the acquired start address of the memory area to be inspected as return information (step S18).

以上のようなプログラム2に対するメモリの割り当てが終了すると,検査対象メモリ領域へのアクセス時にトレース情報の採取が行われる。   When the memory allocation to the program 2 as described above is completed, the trace information is collected when accessing the inspection target memory area.

MMU3は,アクセス禁止状態にしている検査対象メモリ領域へのアクセスを検知すると,アクセス例外を発生させ,この割込みによってトレース処理部10のアクセス禁止例外ハンドラ11が起動される。   When the MMU 3 detects an access to the inspection target memory area in the access prohibited state, the MMU 3 generates an access exception, and the access prohibited exception handler 11 of the trace processing unit 10 is activated by this interrupt.

アクセス禁止例外ハンドラ11は,アクセス例外が発生した検査対象メモリ領域のアドレスをもとに,トレースデータ域12のチェーンから該当するトレースデータ域12を検出し,検出したトレースデータ域12にトレース情報を記録する。このとき,トレース情報の採取条件が指定されているときには,その採取条件を満たす場合にのみ,検出したトレースデータ域12にトレース情報を記録する。   The access prohibition exception handler 11 detects the corresponding trace data area 12 from the chain of the trace data area 12 based on the address of the inspection target memory area where the access exception has occurred, and stores the trace information in the detected trace data area 12. Record. At this time, when the collection condition of the trace information is specified, the trace information is recorded in the detected trace data area 12 only when the collection condition is satisfied.

ここで,トレースデータ域12に記録するトレース情報には,例えば,
(1)検査対象メモリ領域へのアクセスがリードアクセスであるのかライトアクセスであるのかを示す情報,
(2)検査対象メモリ領域からリードされるデータ,または,検査対象メモリ領域にライトされるデータ,
(3)リードされる検査対象メモリ領域のアドレス,または,ライトされる検査対象メモリ領域のアドレス,
(4)検査対象メモリ領域からリードを行う命令のアドレス,または,検査対象メモリ領域にライトを行う命令のアドレス,
などがある。
Here, the trace information recorded in the trace data area 12 includes, for example,
(1) Information indicating whether the access to the inspection target memory area is a read access or a write access,
(2) Data read from the inspection target memory area or data written to the inspection target memory area,
(3) Address of the inspection target memory area to be read or address of the inspection target memory area to be written,
(4) The address of an instruction that reads from the memory area to be inspected or the address of an instruction that writes to the memory area to be inspected,
and so on.

図4は,本実施の形態におけるトレース処理フローチャートである。トレース処理部10は,MMU3からアクセス例外の発生による割込みを受けると(ステップS20),そのアクセス例外発生時のレジスタをスタック等に退避する(ステップS21)。   FIG. 4 is a flowchart of trace processing in the present embodiment. When receiving an interrupt due to the occurrence of an access exception from the MMU 3 (step S20), the trace processing unit 10 saves the register at the time of the access exception occurrence to the stack or the like (step S21).

アクセス例外が発生した検査対象メモリ領域のアドレスと各トレースデータ域12のヘッダ部における検査対象メモリ領域情報とを比較することにより,該当するトレースデータ域12を検索する(ステップS22)。該当するトレースデータ域12が検出されたかを確認し(ステップS23),検出されなければ,通常のアドレス例外処理を行う(ステップS24)。   The corresponding trace data area 12 is searched by comparing the address of the inspection target memory area where the access exception has occurred with the inspection target memory area information in the header portion of each trace data area 12 (step S22). It is confirmed whether or not the corresponding trace data area 12 has been detected (step S23). If not detected, normal address exception processing is performed (step S24).

ステップS23において該当するトレースデータ域12が検出され,かつ,あらかじめ指定されたトレース情報の採取条件を満たす場合には(ステップS25),発生したアクセス例外についてトレース情報を採取し(ステップS26),検出されたトレースデータ域12に採取したトレース情報をデータ格納域に追加記録する(ステップS27)。   When the corresponding trace data area 12 is detected in step S23 and the trace information collection condition specified in advance is satisfied (step S25), trace information is collected for the generated access exception (step S26) and detected. Trace information collected in the trace data area 12 is additionally recorded in the data storage area (step S27).

スタック等に退避したレジスタを利用し,アクセス例外となっていなければ本来実行されるはずであった命令と同じ結果が得られるように命令を発行する処理を行う(ステップS28)。   Using a register saved in the stack or the like, processing is performed to issue an instruction so that the same result as that of the instruction that should have been executed if it was not an access exception is obtained (step S28).

その後,アクセス例外が発生した命令の次の命令を実行できるように復帰位置を変更し(ステップS29),スタック等に退避していたレジスタを復元し(ステップS30),アクセス例外から復帰する(ステップS31)。   Thereafter, the return position is changed so that the instruction next to the instruction in which the access exception has occurred can be executed (step S29), the register saved in the stack or the like is restored (step S30), and the process returns from the access exception (step S29). S31).

以上説明したような検査対象メモリ領域へのアクセス情報のトレース処理を行い,トレースデータ域12にトレース情報を蓄積する。   The trace processing of the access information to the inspection target memory area as described above is performed, and the trace information is accumulated in the trace data area 12.

メモリ破壊が原因でシステムが停止した場合には,トレース処理部10のトレースデータ域12のチェーンを追うことにより,各トレースデータ域12の識別IDから該当するトレースデータ域12を検出する。検出されたトレースデータ域12のトレース情報を解析することにより,メモリ破壊の原因を追求することができる。   When the system is stopped due to memory destruction, the corresponding trace data area 12 is detected from the identification ID of each trace data area 12 by following the chain of the trace data area 12 of the trace processing unit 10. By analyzing the trace information in the detected trace data area 12, the cause of memory corruption can be pursued.

特にメモリ破壊が起こらずに,プログラム2が割り当てメモリ領域(検査対象メモリ領域)の解放をOS1に要求すると,OS1は,解放が要求された割り当てメモリ領域(検査対象メモリ領域)をメモリ領域4に解放する。また,その検査対象メモリ領域に対応するトレースデータ域12をトレース処理部10のトレースデータ域12のチェーンから検出し,検出されたトレースデータ域12をチェーンから外して解放する。   In particular, when the program 2 requests the OS 1 to release the allocated memory area (inspection target memory area) without causing memory destruction, the OS 1 sets the allocation memory area (inspection target memory area) requested to be released to the memory area 4. release. Further, the trace data area 12 corresponding to the inspection target memory area is detected from the chain of the trace data area 12 of the trace processing unit 10, and the detected trace data area 12 is removed from the chain and released.

〔実施の形態2〕
次に,入力されたコマンド等により,プログラム2に対して動的に割り当てられたメモリ領域へのアクセスに関してトレースを行う形態について説明する。
[Embodiment 2]
Next, a description will be given of a form in which tracing is performed regarding access to a memory area dynamically allocated to the program 2 by an input command or the like.

図5は,本発明の実施の形態におけるメモリアクセストレースシステムの構成例(2)を示す図である。図5のメモリアクセストレースシステムは,図1のメモリアクセストレースシステムに,さらに,トレース設定部5を備える。トレース設定部5は,プログラム2におけるあるプロセスによるメモリの割り当て要求に対して割り当てるメモリ領域を検査対象メモリ領域とする指定を受け付け,その指定情報をOS1に通知する。プロセスによるメモリの割り当て要求に対して割り当てるメモリ領域を検査対象メモリ領域とする指定を,OS1が直接に受け付けてもよい。受け付けた指定情報は,保持しておく。   FIG. 5 is a diagram showing a configuration example (2) of the memory access trace system in the embodiment of the present invention. The memory access trace system of FIG. 5 further includes a trace setting unit 5 in addition to the memory access trace system of FIG. The trace setting unit 5 accepts a designation for setting a memory area to be allocated in response to a memory allocation request by a process in the program 2 and notifies the OS 1 of the designation information. The OS 1 may directly accept the designation that the memory area to be allocated in response to the memory allocation request by the process is the inspection target memory area. The received designation information is retained.

プロセスによるメモリの割り当て要求に対して割り当てるメモリ領域を検査対象メモリ領域とする指定は,例えば,次のようなコマンドで受ける。   The designation of the memory area to be allocated in response to the memory allocation request by the process is received by the following command, for example.

memtrace [option] 識別ID トレース域のサイズ プロセスID
このコマンドの例において,識別IDには,検査対象メモリ領域を一意に識別するためのIDを指定し,トレース域のサイズには,トレース情報を記録するための領域であるトレースデータ域12をメモリ領域4から獲得するときのサイズを指定し,プロセスIDには,メモリの割り当て要求を行うプロセスを一意に識別するためのIDを指定する。
memtrace [option] Identification ID Trace area size Process ID
In this command example, an ID for uniquely identifying the inspection target memory area is designated as the identification ID, and the trace data area 12 that is an area for recording trace information is stored in the memory area as the size of the trace area. A size for obtaining from the area 4 is designated, and an ID for uniquely identifying a process that makes a memory allocation request is designated as the process ID.

コマンドで指定された識別IDが,すでに他のトレースデータ域12のヘッダ情報に記録されている識別IDであるか,または,他のコマンドですでに指定された識別IDである場合には,エラーを通知する。   If the identification ID specified by the command is the identification ID already recorded in the header information of the other trace data area 12, or if it is already specified by another command, an error will occur. To be notified.

また,optionによってトレース情報の採取条件を指定することにより,採取するトレース情報を必要なものだけに制限することもできる。optionで指定するトレース情報の採取条件は,例えば,実施の形態1におけるシステムコールの例で説明したものと同じものでよい。   You can also limit the trace information to be collected to the required one by specifying the trace information collection condition with option. The trace information collection condition specified by option may be the same as that described in the example of the system call in the first embodiment, for example.

OS1は,プログラム2のあるプロセスからメモリの割り当て要求を受けると,そのメモリの割り当て要求を行ったプロセスがあらかじめ前述のコマンド等により指定されたプロセスであるかを確認し,指定されたプロセスであれば,メモリ領域4からプロセスが要求するサイズのメモリ領域を獲得してそのプロセスに割り当て,同時に,プロセスに割り当てたメモリ領域を検査対象メモリ領域としてアクセス禁止状態にするように,MMU3に依頼する。MMU3は,OS1からの依頼により,検査対象メモリ領域をアクセス禁止状態にする。   When the OS 1 receives a memory allocation request from a process of the program 2, the OS 1 checks whether the process that has requested the memory allocation is a process specified in advance by the above-mentioned command or the like. For example, the MMU 3 is requested to acquire a memory area of the size requested by the process from the memory area 4 and assign it to the process, and at the same time, set the memory area assigned to the process as an inspection target memory area to be in an access prohibited state. The MMU 3 puts the memory area to be inspected into an access prohibited state in response to a request from the OS 1.

また,OS1は,あらかじめ前述のコマンド等で指定されたサイズのトレースデータ域12をメモリ領域4から獲得する。獲得したトレースデータ域12の先頭には,ヘッダ情報を設けて識別ID,検査対象メモリ領域のアドレス情報,トレース情報の採取条件等を記録する。また,獲得したトレースデータ域12は,図2に示したように,トレース処理部10においてチェーン構造にしておく。   In addition, the OS 1 acquires from the memory area 4 the trace data area 12 having a size specified in advance by the above-described command or the like. At the beginning of the acquired trace data area 12, header information is provided to record an identification ID, address information of the memory area to be inspected, conditions for collecting trace information, and the like. The acquired trace data area 12 has a chain structure in the trace processing unit 10 as shown in FIG.

図6は,本実施の形態2におけるOSの処理フローチャートである。まず,プログラム2のあるプロセスからシステムコールによってメモリの割り当て要求を受けると(ステップS40),メモリの割り当て要求を行ったプロセスがあらかじめコマンドで指定されたプロセスIDに該当するプロセスであるかを確認し(ステップS41),該当するプロセスでなければ,通常のメモリ割り当て処理を行う(ステップS42)。   FIG. 6 is a process flowchart of the OS according to the second embodiment. First, when a memory allocation request is received by a system call from a process of the program 2 (step S40), it is confirmed whether the process which has requested the memory allocation is a process corresponding to the process ID specified in advance by the command. (Step S41) If it is not a corresponding process, normal memory allocation processing is performed (Step S42).

ステップS41において該当するプロセスであれば,割り当てが要求されたメモリのサイズとあらかじめコマンドで指定されたトレースデータ域12のサイズの分だけ,充分にメモリ領域4に空きがあるかを確認し(ステップS43),空きがなければエラー復帰する(ステップS44)。   If it is a corresponding process in step S41, it is confirmed whether there is enough free space in the memory area 4 by the size of the memory requested for allocation and the size of the trace data area 12 specified in advance by the command (step S41). S43), if there is no space, the error is restored (step S44).

ステップS43においてメモリ領域4に充分な空きがあれば,プロセスへの割り当てメモリ領域とトレースデータ域12とを,メモリ領域4から獲得する(ステップS45)。また,MMU3を制御して獲得した割り当てメモリ領域を検査対象メモリ領域としてアクセス禁止状態にする(ステップS46)。   If there is sufficient free space in the memory area 4 in step S43, the memory area allocated to the process and the trace data area 12 are acquired from the memory area 4 (step S45). Further, the allocated memory area acquired by controlling the MMU 3 is set to the access prohibited state as the inspection target memory area (step S46).

獲得したトレースデータ域12の先頭にヘッダ情報を設定し,あらかじめコマンドで指定された識別ID,獲得した検査対象メモリ領域のアドレス情報,あらかじめコマンドで指定されたトレース情報の採取条件等を記録する(ステップS47)。また,獲得したトレースデータ域12を,トレース処理部10のトレースデータ域12のチェーンに繋ぐ(ステップS48)。その後,獲得した検査対象メモリ領域の先頭アドレスを復帰情報として,メモリ割り当て要求元へ復帰する(ステップS49)。   Header information is set at the beginning of the acquired trace data area 12, and the identification ID specified in advance by the command, the address information of the acquired memory area to be inspected, the collection condition of the trace information specified in advance by the command, etc. are recorded ( Step S47). Further, the acquired trace data area 12 is connected to the chain of the trace data area 12 of the trace processing unit 10 (step S48). Thereafter, the acquired head address of the inspection target memory area is used as return information to return to the memory allocation request source (step S49).

以上のようなプログラム2のプロセスに対するメモリの割り当てが終了すると,検査対象メモリ領域へのアクセス時におけるトレース情報の採取が行われる。   When the memory allocation to the process of the program 2 as described above is completed, the trace information is collected when accessing the inspection target memory area.

MMU3は,アクセス禁止状態にしている検査対象メモリ領域へのアクセスを検知すると,アクセス例外を発生させ,この割込みによって,トレース処理部10のアクセス禁止例外ハンドラ11に制御が渡される。   When the MMU 3 detects access to the inspection target memory area in the access prohibited state, the MMU 3 generates an access exception, and control is passed to the access prohibited exception handler 11 of the trace processing unit 10 by this interrupt.

アクセス禁止例外ハンドラ11は,アクセス例外が発生した検査対象メモリ領域のアドレスをもとに,トレースデータ域12のチェーンから該当するトレースデータ域12を検出し,検出したトレースデータ域12にトレース情報を記録する。このとき,トレース情報の採取条件が指定されているときには,その採取条件を満たす場合にのみ,検出したトレースデータ域12にトレース情報を記録する。   The access prohibition exception handler 11 detects the corresponding trace data area 12 from the chain of the trace data area 12 based on the address of the inspection target memory area where the access exception has occurred, and stores the trace information in the detected trace data area 12. Record. At this time, when the collection condition of the trace information is specified, the trace information is recorded in the detected trace data area 12 only when the collection condition is satisfied.

トレース処理の具体的な処理の流れについては,実施の形態1で説明した図4のフローチャートが示す処理の流れと同様である。このような検査対象メモリ領域へのアクセス情報のトレース処理を行い,トレースデータ域12にトレース情報を蓄積する。   The specific processing flow of the trace processing is the same as the processing flow shown in the flowchart of FIG. 4 described in the first embodiment. Trace processing of access information to such an inspection target memory area is performed, and the trace information is accumulated in the trace data area 12.

メモリ破壊が原因でシステムが停止した場合には,トレース処理部10のトレースデータ域12のチェーンを追うことにより,各トレースデータ域12の識別IDから該当するトレースデータ域12を検出する。検出されたトレースデータ域12のトレース情報を解析することにより,メモリ破壊の原因を追求することができる。   When the system is stopped due to memory destruction, the corresponding trace data area 12 is detected from the identification ID of each trace data area 12 by following the chain of the trace data area 12 of the trace processing unit 10. By analyzing the trace information in the detected trace data area 12, the cause of memory corruption can be pursued.

特にメモリ破壊が起こらずに,プログラム2のプロセスが割り当てメモリ領域(検査対象メモリ領域)の解放をOS1に要求すると,OS1は,解放が要求された割り当てメモリ領域(検査対象メモリ領域)をメモリ領域4に解放する。また,その検査対象メモリ領域に対応するトレースデータ域12をトレース処理部10のトレースデータ域12のチェーンから検出し,検出されたトレースデータ域12をチェーンから外してメモリ領域4に解放する。   In particular, when the process of the program 2 requests the OS 1 to release the allocated memory area (inspection target memory area) without causing memory destruction, the OS 1 uses the allocated memory area (inspection target memory area) requested to be released as the memory area. Release to 4. In addition, the trace data area 12 corresponding to the inspection target memory area is detected from the chain of the trace data area 12 of the trace processing unit 10, and the detected trace data area 12 is removed from the chain and released to the memory area 4.

〔実施の形態3〕
次に,プログラム2へのメモリの割り当てに関係なく,コマンド等により検査対象メモリ領域(この場合は検査の対象として指定されたメモリ領域)の指定を受け,その検査対象メモリ領域に対してアクセスが発生した場合にトレースを行う形態について説明する。検査対象メモリ領域は,広い範囲で指定することが可能である。ここでは,図5のメモリアクセストレースシステムの構成をそのまま用いて説明する。
[Embodiment 3]
Next, regardless of the memory allocation to the program 2, the memory area to be inspected (in this case, the memory area designated as the inspection target) is designated by a command or the like, and the memory area to be inspected is accessed. A form of tracing when it occurs will be described. The inspection target memory area can be specified in a wide range. Here, the configuration of the memory access trace system of FIG. 5 will be used as it is.

トレース設定部5は,検査対象メモリ領域の指定を受け付け,その指定情報をOS1に通知する。検査対象メモリ領域の指定を,OS1が直接に受け付けてもよい。検査対象メモリ領域の指定は,例えば,次のようなコマンドで受ける。   The trace setting unit 5 receives the designation of the inspection target memory area and notifies the OS 1 of the designation information. The OS 1 may directly accept the designation of the inspection target memory area. The inspection target memory area is designated by, for example, the following command.

memtrace [option] 識別ID トレース域のサイズ 先頭アドレス 最終アドレス
このコマンドの例において,識別IDには,検査対象メモリ領域を一意に識別するためのIDを指定し,トレース域のサイズには,トレース情報を記録するための領域であるトレースデータ域12をメモリ領域4から獲得するときのサイズを指定し,先頭アドレスには,検査対象メモリ領域の先頭アドレスを指定し,最終アドレスには,検査対象メモリ領域の最終アドレスを指定する。
memtrace [option] Identification ID Trace area size Start address Last address In this command example, the identification ID specifies an ID that uniquely identifies the memory area to be examined, and the trace area size contains the trace information. The size when the trace data area 12 that is an area for recording the memory is acquired from the memory area 4 is specified, the start address of the inspection target memory area is specified as the start address, and the inspection target memory is specified as the final address Specifies the final address of the area.

また,optionによってトレース情報の採取条件を指定することにより,採取するトレース情報を必要なものだけに制限することもできる。optionで指定するトレース情報の採取条件は,例えば,実施の形態1におけるシステムコールの例で説明したものと同じものでよい。   You can also limit the trace information to be collected to the required one by specifying the trace information collection condition with option. The trace information collection condition specified by option may be the same as that described in the example of the system call in the first embodiment, for example.

OS1は,検査対象メモリ領域の指定を受けると,その検査対象メモリ領域をアクセス禁止状態にするように,MMU3に依頼する。MMU3は,OS1からの依頼により,検査対象メモリ領域をアクセス禁止状態にする。   When the OS 1 receives the designation of the inspection target memory area, the OS 1 requests the MMU 3 to place the inspection target memory area in an access prohibited state. The MMU 3 puts the memory area to be inspected into an access prohibited state in response to a request from the OS 1.

また,OS1は,指定されたサイズのトレースデータ域12をメモリ領域4から獲得する。獲得したトレースデータ域12の先頭には,ヘッダ情報を設けて識別ID,検査対象メモリ領域のアドレス情報,トレース情報の採取条件等を記録する。また,獲得したトレースデータ域12は,トレース処理部10においてチェーン構造にしておく。   In addition, the OS 1 acquires the trace data area 12 having a specified size from the memory area 4. At the beginning of the acquired trace data area 12, header information is provided to record an identification ID, address information of the memory area to be inspected, conditions for collecting trace information, and the like. Further, the acquired trace data area 12 has a chain structure in the trace processing unit 10.

図7は,本実施の形態3におけるOSの処理フローチャートである。まず,検査対象メモリ領域の指定コマンドを受けると(ステップS50),コマンドで指定された識別IDが,すでに他のトレースデータ域12のヘッダ情報に記録されている識別IDと重複しているかを確認し(ステップS51),重複していればエラー通知し(ステップS52),処理を終了する。   FIG. 7 is a processing flowchart of the OS according to the third embodiment. First, when a command for specifying a memory area to be inspected is received (step S50), it is confirmed whether the identification ID specified by the command overlaps with an identification ID already recorded in the header information of another trace data area 12. If it is duplicated, an error is notified (step S52), and the process is terminated.

ステップS51において識別IDが重複していなければ,コマンドで指定されたトレースデータ域12のサイズの分だけ,充分にメモリ領域4に空きがあるかを確認し(ステップS53),空きがなければエラー通知し(ステップS52),処理を終了する。   If the identification IDs are not duplicated in step S51, it is confirmed whether there is enough space in the memory area 4 by the size of the trace data area 12 specified by the command (step S53). Notification is made (step S52), and the process is terminated.

ステップS53においてメモリ領域4に充分な空きがあれば,トレースデータ域12をメモリ領域4から獲得する(ステップS54)。また,MMU3を制御して,コマンドで指定された検査対象メモリ領域をアクセス禁止状態にする(ステップS55)。   If there is sufficient free space in the memory area 4 in step S53, the trace data area 12 is acquired from the memory area 4 (step S54). Further, the MMU 3 is controlled so that the inspection target memory area specified by the command is in an access prohibited state (step S55).

獲得したトレースデータ域12の先頭にヘッダ情報を設定し,指定された識別ID,指定された検査対象メモリ領域のアドレス情報,指定されたトレース情報の採取条件等を記録する(ステップS56)。また,獲得したトレースデータ域12を,トレース処理部10のトレースデータ域12のチェーンに繋ぎ(ステップS57),処理を終了する。   Header information is set at the head of the acquired trace data area 12, and the specified identification ID, the address information of the specified memory area to be inspected, the conditions for collecting the specified trace information, etc. are recorded (step S56). Further, the acquired trace data area 12 is connected to the chain of the trace data area 12 of the trace processing unit 10 (step S57), and the process is terminated.

以上のような検査対象メモリ領域の指定後に,検査対象メモリ領域へのアクセス時におけるトレース情報の採取が行われる。   After the inspection target memory area is specified as described above, trace information is collected when accessing the inspection target memory area.

MMU3は,アクセス禁止状態にしている検査対象メモリ領域へのアクセスを検知すると,アクセス例外を発生させ,その割込みによりトレース処理部10のアクセス禁止例外ハンドラ11に制御が渡される。   When the MMU 3 detects an access to the inspection target memory area in the access prohibited state, the MMU 3 generates an access exception, and control is passed to the access prohibited exception handler 11 of the trace processing unit 10 by the interrupt.

アクセス禁止例外ハンドラ11は,アクセス例外が発生した検査対象メモリ領域のアドレスをもとに,トレースデータ域12のチェーンから該当するトレースデータ域12を検出し,検出したトレースデータ域12にトレース情報を記録する。このとき,トレース情報の採取条件が指定されているときには,その採取条件を満たす場合にのみ,検出したトレースデータ域12にトレース情報を記録する。   The access prohibition exception handler 11 detects the corresponding trace data area 12 from the chain of the trace data area 12 based on the address of the inspection target memory area where the access exception has occurred, and stores the trace information in the detected trace data area 12. Record. At this time, when the collection condition of the trace information is specified, the trace information is recorded in the detected trace data area 12 only when the collection condition is satisfied.

トレース処理の具体的な処理の流れについては,実施の形態1で説明した図4のフローチャートが示す処理の流れと同様である。このような検査対象メモリ領域へのアクセス情報のトレース処理を行い,トレースデータ域12にトレース情報を蓄積する。   The specific processing flow of the trace processing is the same as the processing flow shown in the flowchart of FIG. 4 described in the first embodiment. Trace processing of access information to such an inspection target memory area is performed, and the trace information is accumulated in the trace data area 12.

メモリ破壊が原因でシステムが停止した場合には,トレース処理部10のトレースデータ域12のチェーンを追うことにより,各トレースデータ域12の識別IDから該当するトレースデータ域12を検出する。検出されたトレースデータ域12のトレース情報を解析することにより,メモリ破壊の原因を追求することができる。   When the system is stopped due to memory destruction, the corresponding trace data area 12 is detected from the identification ID of each trace data area 12 by following the chain of the trace data area 12 of the trace processing unit 10. By analyzing the trace information in the detected trace data area 12, the cause of memory corruption can be pursued.

本発明の実施の形態におけるメモリアクセストレースシステムの構成例(1)を示す図である。It is a figure which shows the structural example (1) of the memory access trace system in embodiment of this invention. トレースデータ域のデータ構造の例を示す図である。It is a figure which shows the example of the data structure of a trace data area. 本実施の形態1におけるOSの処理フローチャートである。3 is a process flowchart of the OS according to the first embodiment. 本実施の形態におけるトレース処理フローチャートである。It is a trace process flowchart in this Embodiment. 本発明の実施の形態におけるメモリアクセストレースシステムの構成例(2)を示す図である。It is a figure which shows the structural example (2) of the memory access trace system in embodiment of this invention. 本実施の形態2におけるOSの処理フローチャートである。10 is a process flowchart of the OS according to the second embodiment. 本実施の形態3におけるOSの処理フローチャートである。10 is a process flowchart of an OS according to the third embodiment.

符号の説明Explanation of symbols

1 OS実行手段(OS)
2 プログラム実行手段(プログラム)
3 MMU
4 メモリ領域
5 トレース設定部
10 トレース処理部
11 アクセス禁止例外ハンドラ
12 トレースデータ域
1 OS execution means (OS)
2 Program execution means (program)
3 MMU
4 Memory area 5 Trace setting section 10 Trace processing section 11 Access prohibition exception handler 12 Trace data area

Claims (5)

検査対象となるメモリ領域へのアクセスに関する情報であるトレース情報を記録するメモリアクセストレースシステムであって,
検査対象となるメモリ領域の指定を入力する手段と,
前記検査対象となるメモリ領域を,メモリ管理ユニットによってアクセス禁止状態または書込み禁止状態にする手段と,
トレース情報を記録するための領域であるトレースデータ域を獲得する手段と,
前記検査対象となるメモリ領域へのアクセスによりアクセス例外が発生した場合に,トレース情報を採取する手段と,
前記採取されたトレース情報を前記トレースデータ域に記録する手段とを備える
ことを特徴とするメモリアクセストレースシステム。
A memory access trace system for recording trace information that is information related to access to a memory area to be inspected,
Means for inputting a designation of a memory area to be inspected;
Means for bringing the memory area to be inspected into an access prohibited state or a write prohibited state by a memory management unit;
Means for obtaining a trace data area, which is an area for recording trace information;
Means for collecting trace information when an access exception occurs due to access to the memory area to be inspected;
A memory access trace system comprising: means for recording the collected trace information in the trace data area.
検査対象となるメモリ領域へのアクセスに関する情報であるトレース情報を記録するメモリアクセストレースシステムであって,
メモリの割り当て要求を受ける手段と,
前記メモリの割り当て要求に応じて,メモリ領域を割り当てる手段と,
前記割り当てたメモリ領域を検査対象となるメモリ領域として,メモリ管理ユニットによってアクセス禁止状態または書込み禁止状態にする手段と,
トレース情報を記録するための領域であるトレースデータ域を獲得する手段と,
前記検査対象となるメモリ領域へのアクセスによりアクセス例外が発生した場合に,トレース情報を採取する手段と,
前記採取されたトレース情報を前記トレースデータ域に記録する手段とを備える
ことを特徴とするメモリアクセストレースシステム。
A memory access trace system for recording trace information that is information related to access to a memory area to be inspected,
A means of receiving a memory allocation request;
Means for allocating a memory area in response to the memory allocation request;
Means for setting the allocated memory area as a memory area to be inspected and setting the access prohibited state or the write prohibited state by the memory management unit;
Means for obtaining a trace data area, which is an area for recording trace information;
Means for collecting trace information when an access exception occurs due to access to the memory area to be inspected;
A memory access trace system comprising: means for recording the collected trace information in the trace data area.
請求項1または請求項2に記載されたメモリアクセストレースシステムにおいて,
トレース情報を採取するための条件を入力する手段を備え,
前記トレース情報を採取する手段は,前記トレース情報を採取するための条件が満たされる場合にのみ,前記トレース情報を採取する
ことを特徴とするメモリアクセストレースシステム。
In the memory access trace system according to claim 1 or 2,
A means for inputting conditions for collecting trace information is provided.
The memory access trace system characterized in that the means for collecting the trace information collects the trace information only when a condition for collecting the trace information is satisfied.
検査対象となるメモリ領域へのアクセスに関する情報であるトレース情報を記録するメモリアクセストレース方法であって,
検査対象となるメモリ領域の指定を入力する過程と,
前記検査対象となるメモリ領域を,メモリ管理ユニットによってアクセス禁止状態または書込み禁止状態にする過程と,
トレース情報を記録するための領域であるトレースデータ域を獲得する過程と,
前記検査対象となるメモリ領域へのアクセスによりアクセス例外が発生した場合に,トレース情報を採取する過程と,
前記採取されたトレース情報を前記トレースデータ域に記録する過程とを有する
ことを特徴とするメモリアクセストレース方法。
A memory access tracing method for recording trace information, which is information relating to access to a memory area to be inspected,
A process of inputting a specification of a memory area to be inspected;
A process of bringing the memory area to be inspected into an access prohibited state or a write prohibited state by the memory management unit;
A process of acquiring a trace data area which is an area for recording trace information;
A process of collecting trace information when an access exception occurs due to access to the memory area to be inspected;
And a step of recording the collected trace information in the trace data area.
検査対象となるメモリ領域へのアクセスに関する情報であるトレース情報を記録するメモリアクセストレース方法であって,
メモリの割り当て要求を受ける過程と,
前記メモリの割り当て要求に応じて,メモリ領域を割り当てる過程と,
前記割り当てたメモリ領域を検査対象となるメモリ領域として,メモリ管理ユニットによってアクセス禁止状態または書込み禁止状態にする過程と,
トレース情報を記録するための領域であるトレースデータ域を獲得する過程と,
前記検査対象となるメモリ領域へのアクセスによりアクセス例外が発生した場合に,トレース情報を採取する過程と,
前記採取されたトレース情報を前記トレースデータ域に記録する過程とを有する
ことを特徴とするメモリアクセストレース方法。
A memory access tracing method for recording trace information, which is information relating to access to a memory area to be inspected,
Receiving a memory allocation request;
Allocating a memory area in response to the memory allocation request;
The memory management unit sets the allocated memory area as a memory area to be inspected, and sets the access prohibited state or the write prohibited state by the memory management unit;
A process of acquiring a trace data area which is an area for recording trace information;
A process of collecting trace information when an access exception occurs due to access to the memory area to be inspected;
And a step of recording the collected trace information in the trace data area.
JP2004197531A 2004-07-05 2004-07-05 Memory access trace system and memory access trace method Withdrawn JP2006018705A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004197531A JP2006018705A (en) 2004-07-05 2004-07-05 Memory access trace system and memory access trace method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004197531A JP2006018705A (en) 2004-07-05 2004-07-05 Memory access trace system and memory access trace method

Publications (1)

Publication Number Publication Date
JP2006018705A true JP2006018705A (en) 2006-01-19

Family

ID=35792903

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004197531A Withdrawn JP2006018705A (en) 2004-07-05 2004-07-05 Memory access trace system and memory access trace method

Country Status (1)

Country Link
JP (1) JP2006018705A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010032330A1 (en) * 2008-09-22 2010-03-25 富士通株式会社 Information processing device and its memory protection method
WO2010095416A1 (en) * 2009-02-17 2010-08-26 パナソニック株式会社 Multi-thread processor and digital tv system
US9003146B2 (en) 2011-08-03 2015-04-07 International Business Machines Corporation Managing memory of a computer
US9098628B2 (en) 2012-07-26 2015-08-04 International Business Machines Corporation Memory system with multiple block write control to control state data
JP2015531521A (en) * 2012-10-09 2015-11-02 コンチネンタル オートモーティヴ ゲゼルシャフト ミット ベシュレンクテル ハフツングContinental Automotive GmbH Method and controller for controlling the separate execution of a plurality of linked program blocks
CN106294089A (en) * 2015-06-23 2017-01-04 阿里巴巴集团控股有限公司 The method and apparatus assisting the access monitoring to monitored memory headroom

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010032330A1 (en) * 2008-09-22 2010-03-25 富士通株式会社 Information processing device and its memory protection method
JP5392263B2 (en) * 2008-09-22 2014-01-22 富士通株式会社 Information processing apparatus and memory protection method thereof
WO2010095416A1 (en) * 2009-02-17 2010-08-26 パナソニック株式会社 Multi-thread processor and digital tv system
CN102317912A (en) * 2009-02-17 2012-01-11 松下电器产业株式会社 Multi-thread processor and digital TV system
US9003146B2 (en) 2011-08-03 2015-04-07 International Business Machines Corporation Managing memory of a computer
US9098628B2 (en) 2012-07-26 2015-08-04 International Business Machines Corporation Memory system with multiple block write control to control state data
JP2015531521A (en) * 2012-10-09 2015-11-02 コンチネンタル オートモーティヴ ゲゼルシャフト ミット ベシュレンクテル ハフツングContinental Automotive GmbH Method and controller for controlling the separate execution of a plurality of linked program blocks
CN106294089A (en) * 2015-06-23 2017-01-04 阿里巴巴集团控股有限公司 The method and apparatus assisting the access monitoring to monitored memory headroom

Similar Documents

Publication Publication Date Title
US7000225B2 (en) Method for inserting global breakpoints
US7313734B2 (en) Method and system for instruction tracing with enhanced interrupt avoidance
US7366887B2 (en) System and method for loading programs from HDD independent of operating system
US6728907B1 (en) System and method for self-diagnosing system crashes
US6742148B1 (en) System and method for testing memory while an operating system is active
US6523141B1 (en) Method and apparatus for post-mortem kernel memory leak detection
US20080127112A1 (en) Software tracing
CN108959526B (en) Log management method and log management device
WO2016123908A1 (en) Memory overflow detection method and apparatus
US20100082929A1 (en) Memory protection method, information processing apparatus, and computer-readable storage medium that stores memory protection program
CN102968353A (en) Fail address processing method and fail address processing device
US11822419B2 (en) Error information processing method and device, and storage medium
JP2006018705A (en) Memory access trace system and memory access trace method
JP5392263B2 (en) Information processing apparatus and memory protection method thereof
US20100095081A1 (en) Early detection of an access to de-allocated memory
JP2015114750A (en) Examination program, information processing device, and information processing method
US8776232B2 (en) Controller capable of preventing spread of computer viruses and storage system and method thereof
US7617374B2 (en) Hard disk testing method under extensible firmware interface
JP2005135409A (en) System and method for testing cell
US8280927B2 (en) Electronic equipment and memory managing program
US20140372806A1 (en) Virtual machine system and information storing processing method
US8930661B2 (en) Operation processing device and method of detecting memory leak
US8176250B2 (en) System and method for testing a memory
CN101201778A (en) Method for testing hard disk with expandable firmware interface
JP2005338892A (en) Memory abnormal usage detecting device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20071002