[go: up one dir, main page]

JP2014052753A - Memory management device, and memory management method - Google Patents

Memory management device, and memory management method Download PDF

Info

Publication number
JP2014052753A
JP2014052753A JP2012195634A JP2012195634A JP2014052753A JP 2014052753 A JP2014052753 A JP 2014052753A JP 2012195634 A JP2012195634 A JP 2012195634A JP 2012195634 A JP2012195634 A JP 2012195634A JP 2014052753 A JP2014052753 A JP 2014052753A
Authority
JP
Japan
Prior art keywords
pointer area
memory
notification
heap memory
unit
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.)
Pending
Application number
JP2012195634A
Other languages
Japanese (ja)
Inventor
Rikio Nishino
力雄 西野
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2012195634A priority Critical patent/JP2014052753A/en
Publication of JP2014052753A publication Critical patent/JP2014052753A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To properly process a pointer area in the case of releasing a dynamic memory.SOLUTION: A memory management device of this invention includes translation means for adding notification processing for notifying an operation of a pointer area associated with a heap memory in processing of an application program to the application program, and memory management means for receiving notification from the notification processing, recording the operation of the pointer area due to release of the heap memory on the basis of the notification, and invalidating the pointer area corresponding to the released heap memory.

Description

本発明は、メモリ管理装置に関し、特に、動的に確保する記憶領域の管理に関する。   The present invention relates to a memory management device, and more particularly to management of a storage area that is dynamically secured.

中央処理装置(CPU:Central Processing Unit)を含む情報処理装置は、プログラムを実行するときに、メモリなどの記憶領域を動的に確保する。このように動的に確保する記憶領域は、ヒープメモリ又はヒープ領域と言う。   An information processing device including a central processing unit (CPU) dynamically secures a storage area such as a memory when executing a program. Such a storage area that is dynamically secured is called a heap memory or a heap area.

ヒープメモリは、静的なメモリと異なり、メモリの用途の自由度を高くし、高度なプログラムやオブジェクト指向プログラムなどで欠かすことのできない重要な機能である。   The heap memory is an important function that is indispensable for advanced programs and object-oriented programs, unlike the static memory, which increases the degree of freedom of memory usage.

一般的な情報処理装置では、情報処理装置で動作するオペレーティングシステム(OS:Operation System)が、ヒープメモリをプログラムに提供する。しかし、OSは、提供後のヒープメモリを管理しない。プログラム開発者が開発したプログラムが、プログラム内で使用するヒープメモリを管理する必要がある。   In a general information processing apparatus, an operating system (OS) that operates on the information processing apparatus provides heap memory to a program. However, the OS does not manage the heap memory after provision. A program developed by a program developer needs to manage heap memory used in the program.

プログラムが実施するヒープメモリの管理は、使用中のヒープメモリの管理(一般的にポインタを用いる)に加え、不要となったヒープメモリの解放が必要である。   The management of the heap memory implemented by the program requires the heap memory that is no longer needed to be released in addition to the management of the heap memory in use (generally using a pointer).

なお、ヒープメモリは、予約済みのメモリプールとして実現されていることが多い。また、一度確保されたヒープメモリは、プログラムでの解放後、OS側が未使用領域として管理する。そして、プログラムからヒープメモリの確保が要求された場合、OSは、解放後に未使用とした領域を、新なヒープメモリとして提供する。   The heap memory is often realized as a reserved memory pool. The heap memory once secured is managed as an unused area by the OS side after being released by the program. When the heap memory is requested from the program, the OS provides an unused area after the release as a new heap memory.

このように、ヒープメモリは、同じアドレスでも、プログラムの処理の流れに従い、異なる用途のメモリとなる場合が生じる。   As described above, the heap memory may be used for different purposes according to the processing flow of the program even at the same address.

そのため、解放したヒープメモリのアドレスを誤って参照すると、プログラムは、動作不正やメモリのデータ破壊を起こす。   For this reason, if the address of the released heap memory is erroneously referred to, the program will cause an operation error or memory data corruption.

また、ヒープメモリの容量は、上限がある。プログラムが、使用しなくなったヒープメモリを適切に解放しないと、OSは、提供するヒープメモリがなくなってしまう。そのため、長時間動作するプログラムは、ヒープメモリ不足を発生させないために、適切にヒープメモリを解放する必要がある。   In addition, the heap memory capacity has an upper limit. If the program does not properly release heap memory that is no longer used, the OS will run out of heap memory to provide. Therefore, a program that operates for a long time needs to release the heap memory appropriately in order not to cause a shortage of heap memory.

解放したヒープメモリを処理する機能として、ガベージコレクション(GC:Garbage Collection)がある。近年、GCを備えたヒープメモリが用いられている。しかし、GCを備えたヒープメモリは、高価であり、特定の用途に限定されている。また、プログラムにCG機能を実装することは、難易度が高いため、一般的には実施されていない。   As a function of processing the released heap memory, there is a garbage collection (GC). In recent years, heap memory equipped with GC has been used. However, heap memories with GC are expensive and limited to specific applications. Moreover, since it is difficult to implement a CG function in a program, it is not generally performed.

そのため、プログラム開発者は、ヒープメモリの管理について、プログラム開発の各段階で、確認作業を実施している。   For this reason, the program developer performs confirmation work on heap memory management at each stage of program development.

例えば、開発者は、プログラムの仕様検討時やソースのコーディング段階での机上デバッグ、プログラムのテスト及びデバッグ作業を繰り返して、ヒープメモリの管理のエラーを除去している。   For example, the developer eliminates heap memory management errors by repeating desktop debugging, program testing, and debugging work at the time of program specification review and source coding stage.

このように、ヒープメモリの管理は、プログラムの開発者にとって、大きな負担となっている。特に、不正なポインタのアクセスが原因となる動作不正やメモリ破壊が発生した場合、その原因の特定及びプログラムの正しい修正は、開発者の大きな負担となっている。   Thus, heap memory management is a heavy burden for program developers. In particular, when an illegal operation or memory corruption occurs due to an illegal pointer access, the identification of the cause and correct correction of the program are a heavy burden on the developer.

近年、プログラムの不正動作を検出する装置が、幾つか提案された。しかし、このような装置は、高価である。また、このような装置を使用するためには、専門的な知識が必要である。そのため、一般的な開発現場は、まだ、簡単には導入できない。   In recent years, several devices for detecting an illegal operation of a program have been proposed. However, such a device is expensive. Moreover, in order to use such a device, specialized knowledge is required. For this reason, general development sites cannot be easily introduced yet.

そこで、ヒープメモリの動作を検証するプログラムが、提案されている(例えば、特許文献1を参照)。   Therefore, a program for verifying the operation of the heap memory has been proposed (see, for example, Patent Document 1).

特開2008−276763JP 2008-276763 A

特許文献1に記載の検出方法は、ヒープメモリに関するポインタの不正を検出するものである。不正検出のため、特許文献1に記載の検出方法は、プログラムソースコードに、ポインタの内容を確認するAPI関数を組み込む。   The detection method described in Patent Document 1 detects fraud of a pointer related to a heap memory. In order to detect fraud, the detection method described in Patent Document 1 incorporates an API function for confirming the contents of the pointer in the program source code.

つまり、特許文献1に記載の検出方法は、ポインタの参照を用いて不正を検出する発明である。   In other words, the detection method described in Patent Document 1 is an invention for detecting fraud using a pointer reference.

しかし、前述のとおり、ヒープメモリは、プログラムの動作に基づき、解放される。そして、ヒープメモリを解放した場合、プログラムは、プログラムが解放したヒープメモリに対するポイントを使用すると、エラーを発生する。したがって、ヒープメモリを解放した場合、プログラムは、解放したヒープメモリに対するポインタを処理する必要がある。   However, as described above, the heap memory is released based on the operation of the program. When the heap memory is released, the program generates an error when using the point for the heap memory released by the program. Therefore, when the heap memory is released, the program needs to process a pointer to the released heap memory.

つまり、特許文献1に記載の検出方法は、ヒープメモリを解放した場合のポインタを処理できないという問題点があった。   That is, the detection method described in Patent Document 1 has a problem in that it cannot process the pointer when the heap memory is released.

本発明の目的は、上記問題点を解決し、ヒープメモリを解放した場合に、ポインタを適切に処理できるメモリ管理装置、及び、メモリ管理方法を提供することにある。   An object of the present invention is to solve the above problems and provide a memory management device and a memory management method capable of appropriately processing pointers when heap memory is released.

本発明のメモリ管理装置は、アプリケーションプログラムの処理におけるヒープメモリに関連するポインタ領域の操作を通知する通知処理を前記アプリケーションプログラムに追加する翻訳手段と、前記通知処理からの通知を受け取り、前記通知を基に、ヒープメモリの解放に伴うポインタ領域の操作を記録し、解放されたヒープメモリに対応するポインタ領域を無効とするメモリ管理手段とを含む。   The memory management device according to the present invention receives a notification from the notification process, a translation unit that adds a notification process for notifying an operation of a pointer area related to a heap memory in the process of the application program, and receives the notification from the notification process. And a memory management unit that records the operation of the pointer area associated with the release of the heap memory and invalidates the pointer area corresponding to the released heap memory.

本発明のメモリ管理方法は、アプリケーションプログラムの処理におけるヒープメモリに関連するポインタ領域の操作を通知する通知処理を前記アプリケーションプログラムに追加し、前記通知処理からの通知を受け取り、前記通知を基に、ヒープメモリの解放に伴うポインタ領域の操作を記録し、解放されたヒープメモリに対応するポインタ領域を無効とする。   The memory management method of the present invention adds a notification process for notifying an operation of a pointer area related to a heap memory in the process of an application program to the application program, receives a notification from the notification process, and based on the notification, The operation of the pointer area associated with the release of the heap memory is recorded, and the pointer area corresponding to the released heap memory is invalidated.

本発明のプログラムは、アプリケーションプログラムの処理におけるヒープメモリに関連するポインタ領域の操作を通知する通知処理を前記アプリケーションプログラムに追加する処理と、前記通知処理からの通知を受け取り、前記通知を基に、ヒープメモリの解放に伴うポインタ領域の操作を記録する処理と、解放されたヒープメモリに対応するポインタ領域を無効とする処理とをコンピュータに実行させる。   The program of the present invention receives a notification from the notification process, a process for adding a notification process for notifying an operation of a pointer area related to the heap memory in the process of the application program, and a notification from the notification process. A computer is caused to execute a process for recording a pointer area operation associated with the release of the heap memory and a process for invalidating the pointer area corresponding to the released heap memory.

本発明によれば、ヒープメモリを解放した場合に、ポインタを適切に処理できる。   According to the present invention, the pointer can be appropriately processed when the heap memory is released.

図1は、本発明における第1の実施形態に係るメモリ管理装置を含む情報処理システムの一例を示すブロック図である。FIG. 1 is a block diagram showing an example of an information processing system including a memory management device according to the first embodiment of the present invention. 図2は、第1の実施形態に係るメモリ管理装置の構成の一例を示すブロック図である。FIG. 2 is a block diagram illustrating an example of the configuration of the memory management device according to the first embodiment. 図3は、第1の実施形態に係るポインタ領域の情報の一例を示す図である。FIG. 3 is a diagram illustrating an example of pointer area information according to the first embodiment. 図4は、第1の実施形態に係るポインタ領域の変更に関する情報の一例を示す図である。FIG. 4 is a diagram illustrating an example of information related to the change of the pointer area according to the first embodiment. 図5は、第1の実施形態の変形例に係るメモリ管理装置の構成の一例を示すブロック図である。FIG. 5 is a block diagram illustrating an example of a configuration of a memory management device according to a modification of the first embodiment. 図6は、第1の実施形態の変形例に係るメモリ管理装置の構成の一例を示すブロック図である。FIG. 6 is a block diagram illustrating an example of a configuration of a memory management device according to a modification of the first embodiment. 図7は、第1の実施形態の変形例に係るメモリ管理装置の構成の一例を示すブロック図である。FIG. 7 is a block diagram illustrating an example of a configuration of a memory management device according to a modification of the first embodiment.

次に、本発明の実施形態について図面を参照して説明する。   Next, embodiments of the present invention will be described with reference to the drawings.

なお、各図面は、本発明の実施形態を説明するものである。そのため、本発明は、各図面の記載に限られるわけではない。また、各図面の同様の構成には、同じ番号を付し、その繰り返しの説明は、省略する場合がある。   Each drawing explains an embodiment of the present invention. Therefore, the present invention is not limited to the description of each drawing. Moreover, the same number is attached | subjected to the same structure of each drawing, and the repeated description may be abbreviate | omitted.

(第1の実施形態)
図1は、本発明における第1の実施形態に係るメモリ管理装置20を含む情報処理システム60の構成の一例を示すブロック図である。
(First embodiment)
FIG. 1 is a block diagram showing an example of the configuration of an information processing system 60 including a memory management device 20 according to the first embodiment of the present invention.

情報処理システム60は、CPU10と、メモリ管理装置20と、メモリ部30と、ROM(Read Only Memory)40と、内部記憶装置50とを含む。   The information processing system 60 includes a CPU 10, a memory management device 20, a memory unit 30, a ROM (Read Only Memory) 40, and an internal storage device 50.

ROM40は、情報処理システム60で用いる固定データや初期化プログラム(IPL:Initial Program Loader)を含む。   The ROM 40 includes fixed data used in the information processing system 60 and an initialization program (IPL: Initial Program Loader).

メモリ部30は、CPU10が使用するメモリである。   The memory unit 30 is a memory used by the CPU 10.

内部記憶装置50は、情報処理システム60の長期的に保存するデータやプログラムを保存する。   The internal storage device 50 stores data and programs stored in the information processing system 60 for a long time.

CPU10は、情報処理システム60の処理を実施する。   The CPU 10 performs processing of the information processing system 60.

例えば、CPU10は、ROM40のIPLに基づき、内部記憶装置50からOS310を読み出し、メモリ部30に保存し、OS310に基づく動作を開始する(起動する)。   For example, the CPU 10 reads the OS 310 from the internal storage device 50 based on the IPL of the ROM 40, stores it in the memory unit 30, and starts (starts up) the operation based on the OS 310.

OS310での動作を起動後、CPU10は、利用者の指示などを基に、アプリケーションプログラム320を内部記憶装置50からメモリ部30に読み出し、実行する。   After starting the operation in the OS 310, the CPU 10 reads the application program 320 from the internal storage device 50 to the memory unit 30 and executes it based on a user instruction or the like.

CPU10は、アプリケーションプログラム320を実行の際に、必要に応じて、メモリ部30上に、静的メモリ330と、スタックメモリ340と、ヒープメモリ350とを確保して使用する。   When executing the application program 320, the CPU 10 secures and uses the static memory 330, the stack memory 340, and the heap memory 350 on the memory unit 30 as necessary.

本実施形態のメモリ管理装置20は、ヒープメモリ350を含むメモリ部30を管理し、動的に確保されたメモリに関する動作を管理する。特に、メモリ管理装置20は、ヒープメモリ350の解放に伴うポインタの管理を実施する。   The memory management device 20 according to the present embodiment manages the memory unit 30 including the heap memory 350 and manages operations related to the dynamically reserved memory. In particular, the memory management device 20 manages pointers associated with releasing the heap memory 350.

なお、ポインタは、1つとは限らず、一般的に複数宣言される。複数宣言された場合、ポインタは、記憶領域の所定の範囲(ポインタ領域)を占有する。そのため、以下、1つ場合を含め「ポインタ領域」として説明する。   Note that the number of pointers is not limited to one, and a plurality of pointers are generally declared. When multiple declarations are made, the pointer occupies a predetermined range (pointer area) of the storage area. Therefore, the following description will be given as a “pointer area” including one case.

メモリ管理装置20ついて、図面を参照して、更に説明する。   The memory management device 20 will be further described with reference to the drawings.

図2は、本実施形態のメモリ管理装置20の構成の一例を示すブロック図である。   FIG. 2 is a block diagram illustrating an example of the configuration of the memory management device 20 according to the present embodiment.

メモリ管理装置20は、翻訳部210と、メモリ管理部220と、不正アクセス特定部230とを含む。   The memory management device 20 includes a translation unit 210, a memory management unit 220, and an unauthorized access specifying unit 230.

まず、翻訳部210について説明する。   First, the translation unit 210 will be described.

翻訳部210は、図示しないコンパイラが、ソース原文(ソースコードやソースファイル)を基にアプリケーションプログラム320を作成(コンパイル)する際に、アプリケーションプログラム320に、メモリ管理部220へ通知する仕組みを組み込む。より具体的には、翻訳部210は、アプリケーションプログラム320に、ポインタ領域の操作に対する通知処理を追加する。   The translation unit 210 incorporates a mechanism for notifying the memory management unit 220 of the application program 320 when a compiler (not shown) creates (compiles) the application program 320 based on the source text (source code or source file). More specifically, the translation unit 210 adds notification processing for the operation of the pointer area to the application program 320.

そのため、翻訳部210は、ポインタ領域登録部211と、ポインタ領域変更記録部212と、ヒープアドレス通知部213と、スタック領域通知部214とを含む。   Therefore, the translation unit 210 includes a pointer area registration unit 211, a pointer area change recording unit 212, a heap address notification unit 213, and a stack area notification unit 214.

ポインタ領域登録部211は、アプリケーションプログラム320のポインタ領域を宣言する部分に、使用開始するポインタ領域の情報をメモリ管理部220に登録(通知)する処理(以下、「ポインタ領域登録処理」と言う)を追加する。なお、ポインタ領域の宣言は、ポインタ領域の確保と言われる場合もある。   The pointer area registration unit 211 registers (notifies) information on the pointer area to be used in the memory management unit 220 in the part of the application program 320 where the pointer area is declared (hereinafter referred to as “pointer area registration process”). Add Note that the declaration of the pointer area may be referred to as securing the pointer area.

アプリケーションプログラム320で用いられるポインタ領域は、一般的に、次のような種類がある。   The pointer area used in the application program 320 generally has the following types.

(1)静的メモリ330に宣言されたポインタ領域:アプリケーションプログラム320の開始時に宣言されることが多い。   (1) Pointer area declared in the static memory 330: It is often declared at the start of the application program 320.

(2)スタックメモリ340に宣言されたポインタ領域:一般的に、関数を呼び出すときに、ローカル変数や引数として宣言されることが多い。   (2) Pointer area declared in the stack memory 340: Generally, when calling a function, it is often declared as a local variable or an argument.

(3)ヒープメモリ350に宣言されたポインタ領域:ヒープメモリ350確保時に宣言される。   (3) Pointer area declared in the heap memory 350: Declared when the heap memory 350 is secured.

ポインタ領域登録部211は、アプリケーションプログラム320のポインタ領域を登録する処理に、ポインタ領域登録処理を追加する。ただし、ポインタ領域登録部211は、上記の3種類の全てにポインタ領域登録処理を追加する必要はない。例えば、静的メモリ330は、アプリケーションプログラム320の動作中に解放されることがない。そのため、ポインタ領域登録部211は、静的メモリ330で用いられるポインタ領域にポインタ領域登録処理を追加しなくても良い。   The pointer area registration unit 211 adds a pointer area registration process to the process of registering the pointer area of the application program 320. However, the pointer area registration unit 211 does not need to add pointer area registration processing to all of the above three types. For example, static memory 330 is not freed during operation of application program 320. Therefore, the pointer area registration unit 211 may not add pointer area registration processing to the pointer area used in the static memory 330.

図3は、メモリ管理部220に通知するポインタ領域の情報の一例を表形式で示した図である。   FIG. 3 is a diagram showing an example of pointer area information notified to the memory management unit 220 in a table format.

図3に一例として示すポインタ領域の情報は、ポインタ名と、ソース原文名と、行番号と、アドレス情報と、状態とを含む。   The pointer area information shown as an example in FIG. 3 includes a pointer name, a source text name, a line number, address information, and a status.

ポインタ名は、宣言されたポインタ領域の名称である。   The pointer name is the name of the declared pointer area.

ソース原文名は、コンパイラがコンパイルしているソース原文の名称である。   The source text name is the name of the source text compiled by the compiler.

行番号は、ソース原文でポインタ領域が宣言された行番号である。   The line number is the line number where the pointer area is declared in the source text.

アドレス情報は、ポインタ領域が参照するメモリのアドレス情報である。   The address information is address information of the memory referred to by the pointer area.

状態は、宣言されたポインタ領域の状態を示す情報である。例えば、ポインタが宣言された場合、状態は、「生成」となる。   The state is information indicating the state of the declared pointer area. For example, when a pointer is declared, the state is “generated”.

図2を用いた説明に戻る。   Returning to the description using FIG.

ポインタ領域変更記録部212は、アプリケーションプログラム320のポインタ領域の内容を変更する処理に、ポインタ領域の変更に関する情報をメモリ管理部220に通知する処理(以下、「ポインタ領域変更通知処理」と言う)を追加する。   The pointer area change recording unit 212 notifies the memory management unit 220 of information related to the change of the pointer area in the process of changing the contents of the pointer area of the application program 320 (hereinafter referred to as “pointer area change notification process”). Add

なお、ポインタ領域変更記録部212は、ポインタ領域登録部211が登録するポインタ領域に対応して動作する。そのため、例えば、ポインタ領域登録部211が、静的メモリ330に処理を追加しない場合、ポインタ領域変更記録部212は、静的メモリ330における変更に、処理を追加しない。   The pointer area change recording unit 212 operates corresponding to the pointer area registered by the pointer area registration unit 211. Therefore, for example, when the pointer area registration unit 211 does not add processing to the static memory 330, the pointer area change recording unit 212 does not add processing to changes in the static memory 330.

図4は、メモリ管理部220に通知するポインタ領域の変更に関する情報の一例を表形式で示した図である。   FIG. 4 is a table showing an example of information related to the pointer area change notified to the memory management unit 220 in a table format.

図4に一例として示すポインタ領域の変更に関する情報は、例えば、ソース原文名と、行番号と、スレッドの識別子(ID:Identifier)と、状態とを含む。   The information regarding the change of the pointer area shown as an example in FIG. 4 includes, for example, a source text name, a line number, a thread identifier (ID: Identifier), and a state.

ソース原文名と行番号は、図3と同様である。   The source text name and line number are the same as in FIG.

スレッドIDは、アプリケーションプログラム320において、ポインタ領域を変更(操作)したスレッドのIDである。   The thread ID is an ID of a thread that has changed (operated) the pointer area in the application program 320.

状態は、図3の状態を同様である。例えば、ポインタ領域に値を設定した場合、状態は、「設定」となる。   The state is the same as the state of FIG. For example, when a value is set in the pointer area, the state is “set”.

図2を用いた説明に戻る。   Returning to the description using FIG.

ヒープアドレス通知部213は、アプリケーションプログラム320のヒープメモリ350の解放する処理に、ヒープメモリ350の解放をメモリ管理部220に通知する処理(以下、「ヒープメモリ解放通知処理」と言う)を追加する。さらに、ヒープアドレス通知部213は、アプリケーションプログラム320のヒープメモリ350の領域の大きさを変更する処理に、ヒープメモリ350の領域の大きさの変更に関する情報をメモリ管理部220に通知する処理(以下、「ヒープメモリ範囲変更通知処理」と言う)を追加する。   The heap address notification unit 213 adds a process of notifying the memory management unit 220 of the release of the heap memory 350 (hereinafter referred to as “heap memory release notification process”) to the process of releasing the heap memory 350 of the application program 320. . Further, the heap address notifying unit 213 notifies the memory management unit 220 of information related to the change in the size of the heap memory 350 in the process of changing the size of the heap memory 350 in the application program 320 (hereinafter referred to as “the heap memory 350”) , "Heap memory range change notification process") is added.

以下、「ヒープメモリ解放通知処理」と「ヒープメモリ範囲変更通知処理」とを合わせて「ヒープメモリ変更通知処理」と言う。   Hereinafter, “heap memory release notification processing” and “heap memory range change notification processing” are collectively referred to as “heap memory change notification processing”.

なお、ヒープメモリ350の解放は、ヒープメモリ350の範囲を「0」に変更することと同様である。そのため、ヒープアドレス通知部213は、「ヒープメモリ解放通知処理」と「ヒープメモリ範囲変更通知処理」とを区別せず、「ヒープメモリ変更通知処理」として実施しても良い。   Note that releasing the heap memory 350 is the same as changing the range of the heap memory 350 to “0”. Therefore, the heap address notification unit 213 may perform “heap memory change notification processing” without distinguishing between “heap memory release notification processing” and “heap memory range change notification processing”.

スタック領域通知部214は、アプリケーションプログラム320のスタックメモリ340を操作する処理に、スタックメモリ340の操作に関する情報をメモリ管理部220に通知する処理(以下、「スタック操作通知処理」と言う)を追加する。   The stack area notification unit 214 adds a process of notifying the memory management unit 220 of information related to the operation of the stack memory 340 (hereinafter referred to as “stack operation notification process”) to the process of operating the stack memory 340 of the application program 320. To do.

なお、既に説明したとおり、本実施形態の翻訳部210は、スタックメモリ340を確保する場合、及び、ヒープメモリ350を確保する場合、ポインタ領域登録部211がポインタ領域に関する情報を通知する処理を追加する。   As described above, the translation unit 210 according to the present embodiment adds a process in which the pointer area registration unit 211 notifies the pointer area information when the stack memory 340 is secured and when the heap memory 350 is secured. To do.

そのため、ヒープアドレス通知部213は、ヒープメモリ350の解放時及び変更時に、メモリ管理部220に通知する処理を追加すればよい。   For this reason, the heap address notification unit 213 may add a process for notifying the memory management unit 220 when the heap memory 350 is released or changed.

同様に、スタック領域通知部214は、スタックメモリ340を解放する処理(例えば、呼び出された関数から読み出し元に戻る場合)に「スタック操作通知処理」を追加すれば良い。   Similarly, the stack area notification unit 214 may add a “stack operation notification process” to the process of releasing the stack memory 340 (for example, when returning from the called function to the reading source).

ただし、翻訳部210の構成は、これに限る必要はない。翻訳部210は、各メモリに対する構成を備えても良い。例えば、翻訳部210は、ヒープメモリ350を処理する処理部を備えてもよい。そして、そのヒープメモリ350を処理する処理部が、ヒープメモリ350にポインタ領域を宣言する処理にポインタ領域の登録の通知処理を追加し、ヒープメモリ350の解放の処理にヒープメモリ解放通知処理を追加しても良い。   However, the configuration of the translation unit 210 is not limited to this. The translation unit 210 may have a configuration for each memory. For example, the translation unit 210 may include a processing unit that processes the heap memory 350. Then, the processing unit that processes the heap memory 350 adds a pointer area registration notification process to the process of declaring a pointer area in the heap memory 350, and adds a heap memory release notification process to the heap memory 350 release process. You may do it.

次にメモリ管理部220について説明する。   Next, the memory management unit 220 will be described.

メモリ管理部220は、翻訳部210がアプリケーションプログラム320に組み込んだ仕組み(通知処理)からの通知を基に、ポインタ領域を管理する。   The memory management unit 220 manages the pointer area based on the notification from the mechanism (notification processing) incorporated in the application program 320 by the translation unit 210.

そのため、メモリ管理部220は、ポインタ領域管理部221と、ポインタ領域初期化部222と、ポインタ領域操作記録部223とを含む。   Therefore, the memory management unit 220 includes a pointer area management unit 221, a pointer area initialization unit 222, and a pointer area operation recording unit 223.

ポインタ領域管理部221は、翻訳部210が組み込んだ各処理からの通知を基に、ポインタ領域の情報を管理する。   The pointer area management unit 221 manages pointer area information based on notifications from the processes incorporated in the translation unit 210.

ポインタ領域初期化部222は、ポインタ領域管理部221の指示を基に、ポインタ領域を初期化する。   The pointer area initialization unit 222 initializes the pointer area based on an instruction from the pointer area management unit 221.

ポインタ領域操作記録部223は、ポインタ領域管理部221の指示を基に、ポインタ領域の操作(状態の変更)を記憶する。   The pointer area operation recording unit 223 stores the pointer area operation (change of state) based on an instruction from the pointer area management unit 221.

このように、本実施形態のメモリ管理部220は、ポインタ領域管理部221が、中心となって、ポインタ領域に関する処理を実行する。   As described above, in the memory management unit 220 according to the present embodiment, the pointer area management unit 221 performs processing related to the pointer area with the center.

そのため、ポインタ領域管理部221の動作を中心にメモリ管理部220について更に詳細に説明する。   Therefore, the memory management unit 220 will be described in more detail with a focus on the operation of the pointer area management unit 221.

ポインタ領域管理部221は、翻訳部210が組み込んだ各処理からの通知を受け取り、ポインタ領域を管理する。これらの処理を、翻訳部210が組み込んだ各処理に対応して説明する。   The pointer area management unit 221 receives a notification from each process incorporated in the translation unit 210 and manages the pointer area. These processes will be described corresponding to each process incorporated in the translation unit 210.

まず、「ポインタ領域登録処理」に対応する動作を説明する。   First, an operation corresponding to the “pointer area registration process” will be described.

「ポインタ領域登録処理」からの通知を受け取ると、ポインタ領域管理部221は、受け取ったポインタ領域の情報をポインタ領域操作記録部223に記録(登録)する。さらに、ポインタ領域管理部221は、ポインタ領域初期化部222に指示を出し、登録したポインタ領域を初期化する。ポインタ領域管理部221は、初期化後、初期化済みであることを、ポインタ領域操作記録部223に記録しても良い。   When the notification from the “pointer area registration process” is received, the pointer area management unit 221 records (registers) the received pointer area information in the pointer area operation recording unit 223. Further, the pointer area management unit 221 issues an instruction to the pointer area initialization unit 222 to initialize the registered pointer area. The pointer area management unit 221 may record in the pointer area operation recording unit 223 that initialization has been completed after initialization.

次に、「ポインタ領域変更通知処理」に対応する動作を説明する。   Next, an operation corresponding to the “pointer area change notification process” will be described.

「ポインタ領域変更通知処理」からポインタ領域の変更に関する通知を受けと、ポインタ領域管理部221は、この通知を基に、ポインタ領域操作記録部223に変更(操作)を記録する。   Upon receiving a notification regarding the change of the pointer area from the “pointer area change notification process”, the pointer area management unit 221 records the change (operation) in the pointer area operation recording unit 223 based on this notification.

次に、「ヒープメモリ変更通知処理」に対応する動作を説明する。   Next, an operation corresponding to the “heap memory change notification process” will be described.

なお、「ヒープメモリ変更通知処理」は、「ヒープメモリ解放通知処理」及び「ヒープメモリ範囲変更通知処理」である。   The “heap memory change notification process” is a “heap memory release notification process” and a “heap memory range change notification process”.

「ヒープメモリ解放通知処理」からの通知の場合、ポインタ領域管理部221は、解放されたヒープメモリ350の範囲に含まれるポインタ領域を管理対象外(無効)として、ポインタ領域操作記録部223に記録する。さらに、ポインタ領域管理部221は、ポインタ領域初期化部222を用いて、対象外としてポインタ領域を初期化する。   In the case of notification from the “heap memory release notification process”, the pointer area management unit 221 records the pointer area included in the released heap memory 350 as a non-management target (invalid) in the pointer area operation recording unit 223. To do. Furthermore, the pointer area management unit 221 uses the pointer area initialization unit 222 to initialize the pointer area as a non-target.

この処理に基づき、メモリ管理装置20は、解放されたヒープメモリ350に対応するポインタ領域を無効とする。その結果、アプリケーションプログラム320は、解放されたヒープメモリ350に対応するポインタ領域を適切に処理できる。   Based on this processing, the memory management device 20 invalidates the pointer area corresponding to the released heap memory 350. As a result, the application program 320 can appropriately process the pointer area corresponding to the released heap memory 350.

「ヒープメモリ範囲変更通知処理」からの通知の場合、ポインタ領域管理部221は、解放されたヒープメモリ350の範囲と、追加されたヒープメモリ350の範囲とを算出する。   In the case of notification from the “heap memory range change notification process”, the pointer area management unit 221 calculates the range of the released heap memory 350 and the range of the added heap memory 350.

そして、ポインタ領域管理部221は、解放されたヒープメモリ350の範囲に対応するポインタ領域を、「ヒープメモリ解放通知処理」からの通知の場合と同様に、対象外(無効)とし、さらに、ポインタ領域を初期化する。   Then, the pointer area management unit 221 sets the pointer area corresponding to the released range of the heap memory 350 to be excluded (invalid) as in the case of the notification from the “heap memory release notification process”, and further, the pointer area Initialize the area.

なお、ポインタ領域管理部221は、追加されたヒープメモリ350の範囲に対応するポインタ領域がある場合、ポインタ領域の情報をポインタ領域操作記録部223に記録し、ポインタ領域初期化部222を用いてポインタ領域を初期化する。   If there is a pointer area corresponding to the range of the added heap memory 350, the pointer area management unit 221 records the pointer area information in the pointer area operation recording unit 223, and uses the pointer area initialization unit 222. Initialize the pointer area.

この処理に基づき、メモリ管理装置20は、解放されたヒープメモリ350に対応するポインタ領域を無効とする。その結果、アプリケーションプログラム320は、解放されたヒープメモリ350に対応するポインタ領域を適切に処理できる。   Based on this processing, the memory management device 20 invalidates the pointer area corresponding to the released heap memory 350. As a result, the application program 320 can appropriately process the pointer area corresponding to the released heap memory 350.

次に、「スタック操作通知処理」に対応する動作を説明する。   Next, an operation corresponding to the “stack operation notification process” will be described.

「スタック操作通知処理」から通知の場合、ポインタ領域管理部221は、解放されたスタックメモリ340に対応するポインタ領域を対象外(無効)として、ポインタ領域操作記録部223に記録する。さらに、ポインタ領域管理部221は、ポインタ領域初期化部222を用いて、対象外としてポインタ領域を初期化する。   In the case of notification from the “stack operation notification process”, the pointer area management unit 221 records the pointer area corresponding to the released stack memory 340 as a non-target (invalid) in the pointer area operation recording unit 223. Furthermore, the pointer area management unit 221 uses the pointer area initialization unit 222 to initialize the pointer area as a non-target.

この処理に基づき、メモリ管理装置20は、解放されたスタックメモリ340に対応するポインタ領域を無効とする。その結果、アプリケーションプログラム320は、解放されたヒープメモリ350に対応するポインタ領域を適切に処理できる。   Based on this processing, the memory management device 20 invalidates the pointer area corresponding to the released stack memory 340. As a result, the application program 320 can appropriately process the pointer area corresponding to the released heap memory 350.

次に、不正アクセス特定部230について説明する。   Next, the unauthorized access specifying unit 230 will be described.

不正アクセス特定部230は、不正アクセスなどポインタ領域の不正な処理が発生した場合、メモリ管理部220を参照して、ポインタ領域の不正な処理となった箇所を特定する。より具体的には、ポインタ領域の不正が発生した場合、不正アクセス特定部230は、不正となったポインタ領域に関する情報を、ポインタ領域操作記録部223から取り出し、不正な処理を特定する。   When unauthorized processing such as unauthorized access occurs in the pointer area, the unauthorized access identifying unit 230 refers to the memory management unit 220 and identifies the location where the illegal processing in the pointer area has occurred. More specifically, when an illegal pointer area occurs, the unauthorized access identification unit 230 extracts information on the invalid pointer area from the pointer area operation recording unit 223 and identifies an unauthorized process.

例えば、ポインタ領域を参照してヒープメモリ350にアクセスする場合の不正な処理は、次のような処理が想定される。   For example, the following process is assumed as an illegal process when the heap memory 350 is accessed by referring to the pointer area.

(1)初期化されていない内容が原因の不正なアクセス
(2)不正なポインタ値の設定に基づく不正なアクセス
不正なアクセスが発生した場合、不正アクセス特定部230は、ポインタ領域操作記録部223の記録を確認する。例えば、不正アクセス特定部230は、図3に示すポインタ領域の情報を参照し、ポインタ領域を宣言したソース原文と行数を特定する。また、不正アクセス特定部230は、図4に示すポインタ領域の変更に関する情報を基にポインタ領域の状態や、その状態に変更したスレッドやソース原文の位置を特定する。
(1) Unauthorized access due to uninitialized contents (2) Unauthorized access based on unauthorized pointer value setting When unauthorized access occurs, the unauthorized access specifying unit 230, the pointer area operation recording unit 223 Check the record. For example, the unauthorized access specifying unit 230 refers to the information of the pointer area shown in FIG. 3 and specifies the source text and the number of lines in which the pointer area is declared. Further, the unauthorized access specifying unit 230 specifies the state of the pointer area, the position of the thread and the source text changed to the state based on the information related to the change of the pointer area shown in FIG.

開発者は、不正アクセス特定部230が特定した情報を参照し、不正を分析できる。   The developer can analyze fraud by referring to the information identified by the unauthorized access identifying unit 230.

そのため、不正アクセス特定部230は、開発者などへ通知する機能を含んでも良い。   Therefore, the unauthorized access specifying unit 230 may include a function for notifying a developer or the like.

このように、本実施形態のメモリ管理装置20は、ヒープメモリ350を解放した場合にポインタ領域を適切に処理できる。   As described above, the memory management device 20 according to the present embodiment can appropriately process the pointer area when the heap memory 350 is released.

その理由は、次のとおりである。   The reason is as follows.

本実施形態の翻訳部210は、アプリケーションプログラム320のヒープメモリ350の確保(宣言)、変更及び解放の処理に、メモリ管理部220への通知の処理を追加する。   The translation unit 210 of this embodiment adds a process of notifying the memory management unit 220 to the process of securing (declaring), changing, and releasing the heap memory 350 of the application program 320.

そして、メモリ管理部220は、通知を基に、解放されたヒープメモリ350に対応するポインタ領域を対象外(無効)とすることができるためである。   This is because the memory management unit 220 can exclude (invalidate) the pointer area corresponding to the released heap memory 350 based on the notification.

さらに、メモリ管理装置20は、スタックメモリ340に対応するポインタ領域も適切に管理できる。   Furthermore, the memory management device 20 can also appropriately manage the pointer area corresponding to the stack memory 340.

その理由は、次のとおりである。   The reason is as follows.

本実施形態の翻訳部210は、アプリケーションプログラム320のスタックメモリ340の確保、変更及び解放の処理に、メモリ管理部220への通知の処理を追加する。   The translation unit 210 according to the present embodiment adds a process of notifying the memory management unit 220 to the process of securing, changing, and releasing the stack memory 340 of the application program 320.

そして、メモリ管理部220は、通知を基に、解放されたスタックメモリ340に対応するポインタ領域を対象外(無効)とすることができるためである。   This is because the memory management unit 220 can exclude (invalidate) the pointer area corresponding to the released stack memory 340 based on the notification.

また、本実施形態のメモリ管理装置20は、不正アクセスの特定を容易とする効果を得ることができる。   In addition, the memory management device 20 according to the present embodiment can obtain an effect of easily identifying unauthorized access.

その理由は、次のとおりである。   The reason is as follows.

本実施形態のメモリ管理部220は、翻訳部210が追加した通知を基にポインタ領域の操作を記録する。そして、その記録を基に、不正アクセス特定部230が、ポインタ領域の不正アクセスを特定できるためである。   The memory management unit 220 of the present embodiment records the pointer area operation based on the notification added by the translation unit 210. This is because the unauthorized access identification unit 230 can identify unauthorized access in the pointer area based on the record.

<変形例>
なお、本実施形態のメモリ管理装置20の構成は、これまで説明した構成に限る必要はない。
<Modification>
Note that the configuration of the memory management device 20 of the present embodiment is not limited to the configuration described so far.

例えば、スタックメモリ340は、ヒープメモリ350と同様に動的に確保されるため、スタックメモリ340を含めて説明した。   For example, since the stack memory 340 is dynamically secured in the same manner as the heap memory 350, the stack memory 340 has been described.

しかし、本実施形態のメモリ管理装置20は、ヒープメモリ350とスタックメモリ340とを別装置として管理しても良い。   However, the memory management device 20 of the present embodiment may manage the heap memory 350 and the stack memory 340 as separate devices.

また、不正アクセス特定部230は、メモリ管理装置20と別装置でも良い。   The unauthorized access specifying unit 230 may be a separate device from the memory management device 20.

図5は、変形例の一例であるメモリ管理装置25の構成の一例のブロック図である。   FIG. 5 is a block diagram of an example of the configuration of the memory management device 25 that is an example of a modification.

メモリ管理装置25は、不正アクセス特定部230とスタック領域通知部214とを含まない点を除き、メモリ管理装置20と同様の構成を含む。   The memory management device 25 includes the same configuration as that of the memory management device 20 except that the unauthorized access specifying unit 230 and the stack area notification unit 214 are not included.

このように構成されたメモリ管理装置25は、メモリ管理装置20と同様に、ヒープメモリ350を解放した場合にポインタ領域を適切に処理できる。   Similarly to the memory management device 20, the memory management device 25 configured as described above can appropriately process the pointer area when the heap memory 350 is released.

その理由は、次のとおりである。   The reason is as follows.

本実施形態の翻訳部215は、アプリケーションプログラム320のヒープメモリ350の確保、変更及び解放の処理に、メモリ管理部220への通知の処理を追加する。   The translation unit 215 of this embodiment adds a process of notifying the memory management unit 220 to the process of securing, changing, and releasing the heap memory 350 of the application program 320.

そして、メモリ管理部220は、通知を基に、解放されたヒープメモリ350に対応するポインタ領域を対象外とし、さらに操作を記録するためである。   Then, based on the notification, the memory management unit 220 excludes the pointer area corresponding to the released heap memory 350 and records the operation.

さらに、本実施形態のメモリ管理装置25は、1台の装置に翻訳部215と、メモリ管理部220とを含んでいるが、これに限る必要はない。例えば、メモリ管理装置25は、図6に示すように、翻訳部215とメモリ管理部220とを、バスを介して接続した別のボード、又は、ネットワーク介して接続する別の装置として構成しても良い。なお、図6に示す構成は、本実施形態の最小構成である。   Furthermore, although the memory management device 25 of this embodiment includes the translation unit 215 and the memory management unit 220 in one device, the present invention is not limited to this. For example, as shown in FIG. 6, the memory management device 25 is configured such that the translation unit 215 and the memory management unit 220 are configured as another board connected via a bus or another device connected via a network. Also good. Note that the configuration shown in FIG. 6 is the minimum configuration of the present embodiment.

また、本実施形態の説明では、メモリ管理装置20をCPU10とは異なる装置として説明したが、メモリ管理装置20の実現は、これに限る必要はない。   In the description of the present embodiment, the memory management device 20 is described as a device different from the CPU 10, but the implementation of the memory management device 20 is not limited to this.

例えば、メモリ管理装置20の機能をプログラムで実現し、CPU10が実行するOS310に組み込んでも良い。あるいは、メモリ管理装置20は、独立した管理プログラムとして実現しても良い。   For example, the function of the memory management device 20 may be realized by a program and incorporated in the OS 310 executed by the CPU 10. Alternatively, the memory management device 20 may be realized as an independent management program.

また、メモリ管理装置20は、図示しないコンピュータで読み込み可能が記録媒体にメモリ管理装置20の機能を実現するプログラムとして保存されても良い。その場合、CPU10が、図示しない記録媒体読み取り装置を用いて、メモリ管理装置20の相当するプログラムとして読み込んで、実行しても良い。   The memory management device 20 may be stored in a recording medium that can be read by a computer (not shown) as a program that implements the functions of the memory management device 20. In that case, the CPU 10 may read and execute as a corresponding program of the memory management device 20 using a recording medium reading device (not shown).

あるいは、本実施形態のメモリ管理装置20は、CPU10とは異なるCPUと、ROMと、RAM(Random Access Memory)と、IO(Input/Output)インターフェース(以下、IOと言う)と、NIC(Network Interface Card)とを含むコンピュータとして実現しても良い。   Alternatively, the memory management device 20 of the present embodiment includes a CPU different from the CPU 10, a ROM, a RAM (Random Access Memory), an IO (Input / Output) interface (hereinafter referred to as IO), and a NIC (Network Interface). Card).

図7は、CPU710を用いた本実施形態のメモリ管理装置70を構成の一例を示す図である。   FIG. 7 is a diagram showing an example of the configuration of the memory management device 70 of this embodiment using the CPU 710.

メモリ管理装置70は、CPU710と、ROM720と、RAM730と、内部記憶装置740と、IO750と、NIC780とを含み、コンピュータを構成している。   The memory management device 70 includes a CPU 710, a ROM 720, a RAM 730, an internal storage device 740, an IO 750, and a NIC 780, and constitutes a computer.

CPU710は、ROM720又は内部記憶装置740からプログラムを読み込む。そして、CPU710は、読み込んだプログラムに基づいて、メモリ管理装置20の翻訳部210と、メモリ管理部220と、不正アクセス特定部230としての各機能を実現する。CPU710は、各機能を実現する際に、RAM730及び内部記憶装置740を一時記憶として使用する。また、CPU710は、NIC780を介して、CPU10などの他の構成と接続する。   The CPU 710 reads a program from the ROM 720 or the internal storage device 740. The CPU 710 implements the functions of the translation unit 210, the memory management unit 220, and the unauthorized access specifying unit 230 of the memory management device 20 based on the read program. The CPU 710 uses the RAM 730 and the internal storage device 740 as temporary storage when realizing each function. The CPU 710 is connected to other components such as the CPU 10 via the NIC 780.

なお、CPU710は、コンピュータで読み取り可能にプログラムを記憶した記憶媒体790が含むプログラムを、図示しない記憶媒体読み取り装置を用いて読み込んでも良い。あるいは、CPU710は、図示しないネットワークを介して、外部の装置からプログラムを受け取っても良い。   Note that the CPU 710 may read a program included in the storage medium 790 that stores the computer-readable program using a storage medium reading device (not shown). Alternatively, the CPU 710 may receive a program from an external device via a network (not shown).

ROM720は、CPU710が実行するプログラム、及び、固定的なデータを記憶する。ROM720は、例えば、P−ROM(Programmable-ROM)やフラッシュROMである。   The ROM 720 stores programs executed by the CPU 710 and fixed data. The ROM 720 is, for example, a P-ROM (Programmable-ROM) or a flash ROM.

RAM730は、CPU710が実行するプログラムやデータを一時的に記憶する。RAM730は、例えば、D−RAM(Dynamic-RAM)である。   The RAM 730 temporarily stores programs and data executed by the CPU 710. The RAM 730 is, for example, a D-RAM (Dynamic-RAM).

内部記憶装置740は、メモリ管理装置70の長期的に保存するデータやプログラムを保存する。また、内部記憶装置740は、ポインタ領域操作記録部223として動作しても良い。さらに、内部記憶装置740は、CPU710の一時記憶装置として動作しても良い。内部記憶装置740は、例えば、ハードディスク装置、光磁気ディスク装置、SSD(Solid State Drive)又はディスクアレイ装置である。   The internal storage device 740 stores data and programs stored in the memory management device 70 for a long time. Further, the internal storage device 740 may operate as the pointer area operation recording unit 223. Further, the internal storage device 740 may operate as a temporary storage device for the CPU 710. The internal storage device 740 is, for example, a hard disk device, a magneto-optical disk device, an SSD (Solid State Drive), or a disk array device.

IO750は、CPU710と、入力機器760及び表示機器770とを接続する。IO750は、例えば、IOインターフェースカードである。   The IO 750 connects the CPU 710 to the input device 760 and the display device 770. The IO 750 is, for example, an IO interface card.

入力機器760は、メモリ管理装置70の操作者からの入力指示を受信する入力部である。入力機器760は、例えば、キーボード、マウス又はタッチパネルである。   The input device 760 is an input unit that receives an input instruction from an operator of the memory management device 70. The input device 760 is, for example, a keyboard, a mouse, or a touch panel.

表示機器770は、メモリ管理装置70の表示部である。表示機器770は、例えば、液晶ディスプレイである。   The display device 770 is a display unit of the memory management device 70. The display device 770 is a liquid crystal display, for example.

NIC780は、メモリ管理装置70とCPU10など他の構成とのデータをやり取りする仲介する。NIC780は、例えば、PCI(Peripheral Component Interface)カードである。   The NIC 780 mediates data exchange between the memory management device 70 and other components such as the CPU 10. The NIC 780 is, for example, a PCI (Peripheral Component Interface) card.

このように構成されたメモリ管理装置70は、メモリ管理装置20と同様の効果を得ることができる。   The memory management device 70 configured as described above can obtain the same effects as the memory management device 20.

その理由は、メモリ管理装置70のCPU710が、プログラムに基づいてメモリ管理装置20と同様の動作を実現できるためである。   This is because the CPU 710 of the memory management device 70 can realize the same operation as the memory management device 20 based on the program.

以上、実施形態を参照して本願発明を説明したが、本願発明は上記実施形態に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。   While the present invention has been described with reference to the embodiments, the present invention is not limited to the above embodiments. Various changes that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.

10 CPU
20 メモリ管理装置
25 メモリ管理装置
30 メモリ部
40 ROM
50 内部記憶装置
60 情報処理システム
70 メモリ管理装置
210 翻訳部
211 ポインタ領域登録部
212 ポインタ領域変更記録部
213 ヒープアドレス通知部
214 スタック領域通知部
215 翻訳部
220 メモリ管理部
221 ポインタ領域管理部
222 ポインタ領域初期化部
223 ポインタ領域操作記録部
230 不正アクセス特定部
310 OS
320 アプリケーションプログラム
330 静的メモリ
340 スタックメモリ
350 ヒープメモリ
710 CPU
720 ROM
730 RAM
740 内部記憶装置
750 IO
760 入力機器
770 表示機器
780 NIC
790 記憶媒体
10 CPU
20 Memory management device 25 Memory management device 30 Memory unit 40 ROM
DESCRIPTION OF SYMBOLS 50 Internal storage device 60 Information processing system 70 Memory management apparatus 210 Translation part 211 Pointer area registration part 212 Pointer area change recording part 213 Heap address notification part 214 Stack area notification part 215 Translation part 220 Memory management part 221 Pointer area management part 222 Pointer Area initialization unit 223 Pointer area operation recording unit 230 Unauthorized access specifying unit 310 OS
320 Application program 330 Static memory 340 Stack memory 350 Heap memory 710 CPU
720 ROM
730 RAM
740 Internal storage device 750 IO
760 Input device 770 Display device 780 NIC
790 storage media

Claims (8)

アプリケーションプログラムの処理におけるヒープメモリに関連するポインタ領域の操作を通知する通知処理を前記アプリケーションプログラムに追加する翻訳手段と、
前記通知処理からの通知を受け取り、前記通知を基に、ヒープメモリの解放に伴うポインタ領域の操作を記録し、解放されたヒープメモリに対応するポインタ領域を無効とするメモリ管理手段とを
含むメモリ管理装置。
Translation means for adding notification processing to the application program for notifying operation of a pointer area related to heap memory in processing of the application program;
A memory management unit that receives a notification from the notification process, records a pointer area operation associated with the release of the heap memory based on the notification, and invalidates the pointer area corresponding to the released heap memory. Management device.
前記メモリ管理部は、
ポインタ領域を初期化するポインタ領域初期化手段と、
ポインタ領域の操作に関する情報を記録するポインタ操作記録手段と、
前記通知を基に、ポインタ領域の操作を前記ポインタ操作記録手段に記録し、
前記通知がヒープメモリの宣言に関する場合、前記ポインタ領域初期化手段を基に前記対応するポインタ領域を初期化し、
前記通知がヒープメモリの解放に関する場合、前記ポインタ操作記録手段に解放されたヒープメモリに対応するポインタ領域の無効を記録し、前記ポインタ領域初期化手段を基に前記対応するポインタ領域を初期化するポインタ領域管理手段とを
含む請求項1に記載のメモリ管理装置。
The memory management unit
Pointer area initialization means for initializing the pointer area;
Pointer operation recording means for recording information on the operation of the pointer area;
Based on the notification, the operation of the pointer area is recorded in the pointer operation recording means,
If the notification relates to the declaration of heap memory, the corresponding pointer area is initialized based on the pointer area initializing means,
When the notification relates to the release of the heap memory, the pointer operation recording unit records the invalidity of the pointer area corresponding to the released heap memory, and initializes the corresponding pointer area based on the pointer area initialization unit. The memory management device according to claim 1, further comprising pointer area management means.
前記翻訳部は、
ポインタ領域を宣言する処理に前記通知処理を追加するポインタ領域登録手段と、
ポインタ領域を変更する処理に前記通知処理を追加するポインタ領域変更記録手段と、
ヒープメモリを解放する処理とヒープメモリの範囲を変更する処理に前記通知処理を追加するヒープアドレス通知手段とを
含む請求項1又は請求項2に記載のメモリ管理装置。
The translation unit
Pointer area registration means for adding the notification process to the process of declaring a pointer area;
Pointer area change recording means for adding the notification process to the process of changing the pointer area;
The memory management device according to claim 1, further comprising: a heap address notifying unit that adds the notification process to a process of releasing heap memory and a process of changing a range of the heap memory.
前記翻訳部は、
スタックメモリを解放する処理に前記通知処理を追加するスタック領域通知手段
をさらに含む請求項3に記載のメモリ管理装置。
The translation unit
The memory management device according to claim 3, further comprising: a stack area notifying unit that adds the notification process to a process of releasing the stack memory.
前記メモリ管理手段が記録した情報を基に、ポインタ領域の操作の不正アクセスを特定する不正アクセス特定手段
をさらに含む請求項1乃至請求項4のいずれか1項に記載のメモリ管理装置。
The memory management device according to any one of claims 1 to 4, further comprising unauthorized access specifying means for specifying unauthorized access in the operation of the pointer area based on information recorded by the memory management means.
アプリケーションプログラムの処理におけるヒープメモリに関連するポインタ領域の操作を通知する通知処理を前記アプリケーションプログラムに追加し、
前記通知処理からの通知を受け取り、前記通知を基に、ヒープメモリの解放に伴うポインタ領域の操作を記録し、解放されたヒープメモリに対応するポインタ領域を無効とする
メモリ管理方法。
A notification process for notifying the operation of the pointer area related to the heap memory in the process of the application program is added to the application program;
A memory management method for receiving a notification from the notification processing, recording an operation of a pointer area accompanying release of a heap memory based on the notification, and invalidating a pointer area corresponding to the released heap memory.
ポインタ領域を追加する処理に前記通知処理を追加し、
ポインタ領域を変更する処理に前記通知処理を追加し、
ヒープメモリを解放する処理とヒープメモリの範囲を変更する処理とに前記通知処理を追加する
請求項6に記載のメモリ管理装置。
Add the notification process to the process of adding a pointer area,
Add the notification process to the process of changing the pointer area,
The memory management device according to claim 6, wherein the notification processing is added to processing for releasing heap memory and processing for changing a heap memory range.
アプリケーションプログラムの処理におけるヒープメモリに関連するポインタ領域の操作を通知する通知処理を前記アプリケーションプログラムに追加する処理と、
前記通知処理からの通知を受け取り、前記通知を基に、ヒープメモリの解放に伴うポインタ領域の操作を記録する処理と、解放されたヒープメモリに対応するポインタ領域を無効とする処理と
をコンピュータに実行させるプログラム。
A process of adding a notification process to the application program to notify the operation of the pointer area related to the heap memory in the process of the application program;
A process of receiving a notification from the notification process and recording a pointer area operation associated with the release of the heap memory and a process of invalidating the pointer area corresponding to the released heap memory based on the notification. The program to be executed.
JP2012195634A 2012-09-06 2012-09-06 Memory management device, and memory management method Pending JP2014052753A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012195634A JP2014052753A (en) 2012-09-06 2012-09-06 Memory management device, and memory management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012195634A JP2014052753A (en) 2012-09-06 2012-09-06 Memory management device, and memory management method

Publications (1)

Publication Number Publication Date
JP2014052753A true JP2014052753A (en) 2014-03-20

Family

ID=50611213

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012195634A Pending JP2014052753A (en) 2012-09-06 2012-09-06 Memory management device, and memory management method

Country Status (1)

Country Link
JP (1) JP2014052753A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413521A (en) * 2019-07-24 2019-11-05 杭州迪普信息技术有限公司 A kind of the write-overflow detection method and device of heap memory
JP2022174757A (en) * 2021-05-11 2022-11-24 アペックス.エーアイ,インコーポレイテッド Deterministic memory allocation for real-time application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07225703A (en) * 1994-02-04 1995-08-22 At & T Corp Software program error detection method
JP2003186700A (en) * 2001-12-20 2003-07-04 Ricoh Co Ltd Application generating method for image forming apparatus and program causing computer to execute the method
JP2006172205A (en) * 2004-12-16 2006-06-29 Canon Inc Information processing apparatus and control method therefor, computer program, and storage medium
JP2009020823A (en) * 2007-07-13 2009-01-29 Toshiba Corp Order relation analysis apparatus, method and program
JP2010277302A (en) * 2009-05-28 2010-12-09 Nec Corp Inspection program generation device, inspection program generation method and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07225703A (en) * 1994-02-04 1995-08-22 At & T Corp Software program error detection method
JP2003186700A (en) * 2001-12-20 2003-07-04 Ricoh Co Ltd Application generating method for image forming apparatus and program causing computer to execute the method
JP2006172205A (en) * 2004-12-16 2006-06-29 Canon Inc Information processing apparatus and control method therefor, computer program, and storage medium
JP2009020823A (en) * 2007-07-13 2009-01-29 Toshiba Corp Order relation analysis apparatus, method and program
JP2010277302A (en) * 2009-05-28 2010-12-09 Nec Corp Inspection program generation device, inspection program generation method and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413521A (en) * 2019-07-24 2019-11-05 杭州迪普信息技术有限公司 A kind of the write-overflow detection method and device of heap memory
CN110413521B (en) * 2019-07-24 2023-01-24 杭州迪普信息技术有限公司 Write-crossing detection method and device for heap memory
JP2022174757A (en) * 2021-05-11 2022-11-24 アペックス.エーアイ,インコーポレイテッド Deterministic memory allocation for real-time application

Similar Documents

Publication Publication Date Title
US11301375B2 (en) Reducing synchronization reliance in marking
EP3788490B1 (en) Execution control with cross-level trace mapping
US8176480B1 (en) Adaptive instrumentation through dynamic recompilation
JP7586895B2 (en) Data storage using memory aperture flash order
CN108475217A (en) System and method for virtual machine of auditing
CN108369520B (en) Protecting basic input/output (BIOS) code
Emamdoost et al. Detecting kernel memory leaks in specialized modules with ownership reasoning
US20090178028A1 (en) Method and system for invoking just-in-time debugger
JP7672403B2 (en) Integrated reference and secondary marking
US8548966B2 (en) Asynchronous assertions
US7523446B2 (en) User-space return probes
JP2014052753A (en) Memory management device, and memory management method
CN109582542B (en) Method for dumping core of embedded system
CN114968702A (en) Memory statistical method, memory statistical device and computer readable storage medium
Gatla et al. Understanding persistent-memory-related issues in the linux kernel
CN117971646A (en) A memory leak detection method for closed-source kernels under ARM architecture
Hermann et al. Getting to know you: Towards a capability model for java
Chang et al. Implementation of JVM tool interface on Dalvik virtual machine
Liu et al. Csod: context-sensitive overflow detection
Cole et al. Simplex: Repurposing Intel memory protection extensions for information hiding
Dolz et al. Enabling semantics to improve detection of data races and misuses of lock‐free data structures
CN113220334B (en) Program fault location method, terminal device and computer readable storage medium
CN108845889A (en) A kind of test method and system checked BIOS option and whether meet Intel demand
Razeen et al. Better performance through thread-local emulation
Yang et al. A RISC-V On-chip Operating System Based on Rust

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150824

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160428

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160524

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160712

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161213

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170208

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20170523