JP7000892B2 - Memory management program, memory management method, and memory management device - Google Patents

Memory management program, memory management method, and memory management device Download PDF

Info

Publication number
JP7000892B2
JP7000892B2 JP2018019641A JP2018019641A JP7000892B2 JP 7000892 B2 JP7000892 B2 JP 7000892B2 JP 2018019641 A JP2018019641 A JP 2018019641A JP 2018019641 A JP2018019641 A JP 2018019641A JP 7000892 B2 JP7000892 B2 JP 7000892B2
Authority
JP
Japan
Prior art keywords
area
data
read
memory
write
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.)
Active
Application number
JP2018019641A
Other languages
Japanese (ja)
Other versions
JP2019139330A (en
Inventor
益康 杉山
将生 矢島
悠 熊埜御堂
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 JP2018019641A priority Critical patent/JP7000892B2/en
Publication of JP2019139330A publication Critical patent/JP2019139330A/en
Application granted granted Critical
Publication of JP7000892B2 publication Critical patent/JP7000892B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System (AREA)

Description

本発明は、メモリ管理プログラム、メモリ管理方法、およびメモリ管理装置に関する。 The present invention relates to a memory management program, a memory management method, and a memory management device.

プログラム設計ミス等により、メモリへの書き込み対象のデータサイズが予め確保されたメモリ領域のサイズを超えた場合、メモリオーバーラン(以下、オーバーランと称する)が発生する。そして、Operating System(OS)は、オーバーランを検知した場合、例外処理として、例えば、オーバーランを発生させたアプリケーションを強制終了させる。 When the size of the data to be written to the memory exceeds the size of the memory area secured in advance due to a program design error or the like, a memory overrun (hereinafter referred to as an overrun) occurs. Then, when the Operating System (OS) detects an overrun, as an exception handling, for example, the application that caused the overrun is forcibly terminated.

関連する技術として、動的メモリ確保用のアルゴリズムの実行の命令の発行をフックし、動的メモリ確保用のアルゴリズムの実行で確保されたアドレスの領域内の内容を検査する技術が提案されている(例えば、特許文献1を参照)。 As a related technique, a technique has been proposed in which the issuance of an instruction for executing an algorithm for allocating dynamic memory is hooked and the contents in the area of the address secured by executing the algorithm for allocating dynamic memory are inspected. (See, for example, Patent Document 1).

また、関連する技術として、ファイルサーバアプリケーション部のファイルI/O発行要求をフックし、フックしたファイルI/O発行要求からアクセス対象となるファイルの情報を取得する技術が提案されている(例えば、特許文献2を参照)。 Further, as a related technique, a technique has been proposed in which a file I / O issuance request of the file server application unit is hooked and information of a file to be accessed is acquired from the hooked file I / O issuance request (for example). See Patent Document 2).

また、関連する技術として、ファイル更新時において管理テーブルを更新し、管理テーブルの内容から次回の処理でオーバフローの可能性があると判断した時にファイル領域を拡張する技術が提案されている(例えば、特許文献3を参照)。 Further, as a related technology, a technology has been proposed in which the management table is updated at the time of file update and the file area is expanded when it is determined from the contents of the management table that there is a possibility of overflow in the next processing (for example). See Patent Document 3).

特開2016-42318号公報Japanese Unexamined Patent Publication No. 2016-42318 特開2013-196066号公報Japanese Unexamined Patent Publication No. 2013-196066 特開平5-233391号公報Japanese Unexamined Patent Publication No. 5-233391

オーバーランが発生したことによりアプリケーションが強制終了した場合、アプリケーションを使用するユーザの業務に支障をきたす可能性がある。 If the application is forcibly terminated due to an overrun, it may hinder the business of the user who uses the application.

オーバーランを防止するために、例えば、メモリ確保の際に必要なサイズに余裕分のサイズを加算したメモリ領域をアプリケーションが確保することが考えられる。しかし、余裕分のサイズをどのくらい確保すればオーバーランを防止できるかをメモリ確保の際に判定することは困難である。また、メモリの容量に余裕がない場合、余裕分のメモリを確保することは困難である。 In order to prevent overrun, for example, it is conceivable that the application secures a memory area obtained by adding a marginal size to the size required for allocating memory. However, it is difficult to determine how much size can be secured to prevent overrun when securing memory. Further, when there is no margin in the memory capacity, it is difficult to secure the spare memory.

1つの側面として、本発明は、オーバーランが発生した場合に、アプリケーションの強制終了を抑制することを目的とする。 As one aspect, it is an object of the present invention to suppress forced termination of an application in the event of an overrun.

1つの態様では、メモリ管理プログラムは、コンピュータに、メモリ内の第1領域を確保する命令を検知した場合、前記第1領域を示す情報を記録し、前記第1領域へのデータの書き込み命令を検知した場合、前記書き込み命令と前記第1領域を示す情報とに基づいて、前記データを前記第1領域内に書き込み可能であるか判定し、前記データを前記第1領域内に書き込み可能でないと判定した場合、前記メモリ内における前記第1領域とは異なる第2領域を確保し、前記データの一部分を前記第1領域に書き込み、前記データの残りの部分を前記第2領域に書き込む指示を出力する処理を実行させる。 In one embodiment, when the memory management program detects in the computer an instruction to secure the first area in the memory, it records information indicating the first area and issues an instruction to write data to the first area. When detected, it is determined whether the data can be written in the first area based on the write command and the information indicating the first area, and the data cannot be written in the first area. When it is determined, a second area different from the first area is secured in the memory, a part of the data is written to the first area, and an instruction to write the remaining part of the data to the second area is output. To execute the process to be performed.

1つの側面によれば、オーバーランが発生した場合に、アプリケーションの強制終了を抑制することができる。 According to one aspect, it is possible to suppress the forced termination of the application in the event of an overrun.

実施形態におけるシステムの全体構成の一例を示す。An example of the overall configuration of the system in the embodiment is shown. メモリ管理部の一例を示す図である。It is a figure which shows an example of a memory management part. 第1領域管理テーブルの一例を示す図である。It is a figure which shows an example of the 1st area management table. 第2領域管理テーブルの一例を示す図である。It is a figure which shows an example of the 2nd area management table. 複数回拡張が行われた場合の第2領域管理テーブルの一例を示す図である。It is a figure which shows an example of the 2nd area management table when expansion is performed a plurality of times. メモリ領域の拡張方法を示す図である。It is a figure which shows the expansion method of the memory area. トレーステーブルの一例を示す図である。It is a figure which shows an example of a trace table. 第2領域へのデータの書き込みに関する情報の一例を示す図である。It is a figure which shows an example of the information about the writing of data to a 2nd area. 第2領域からのデータの読み込みに関する情報の一例を示す図である。It is a figure which shows an example of the information about reading of data from a 2nd area. 実施形態の設定処理の一例を示すフローチャートである。It is a flowchart which shows an example of the setting process of an embodiment. メモリ管理部の処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process of a memory management part. 図11のステップS203におけるメモリ確保監視処理の一例を示すフローチャートである。It is a flowchart which shows an example of the memory allocation monitoring process in step S203 of FIG. 図11のステップS205におけるメモリ書き込み監視処理の一例を示すフローチャートである。It is a flowchart which shows an example of the memory write monitoring process in step S205 of FIG. 図11のS207におけるメモリ読み込み監視処理の一例を示すフローチャート(その1)である。FIG. 1 is a flowchart (No. 1) showing an example of the memory read monitoring process in S207 of FIG. 図11のS207におけるメモリ読み込み監視処理の一例を示すフローチャート(その2)である。FIG. 2 is a flowchart (No. 2) showing an example of the memory read monitoring process in S207 of FIG. 実施例における監視対象アプリケーションに用いられるソースコードである。This is the source code used for the monitored application in the embodiment. 実施例におけるメモリ確保処理に関するアセンブラコードを示す図である。It is a figure which shows the assembler code about the memory allocation processing in an Example. 実施例のメモリ確保処理におけるトレーステーブルを示す図である。It is a figure which shows the trace table in the memory allocation processing of an Example. 実施例における第1領域管理テーブルを示す図である。It is a figure which shows the 1st area management table in an Example. 実施例における確保されたメモリ領域を示す図である。It is a figure which shows the reserved memory area in an Example. 実施例におけるメモリ書き込み処理に関するアセンブラコードを示す図である。It is a figure which shows the assembler code about the memory write processing in an Example. 実施例のメモリ書き込み処理におけるトレーステーブルを示す図である。It is a figure which shows the trace table in the memory write processing of an Example. 実施例における書き込み処理後の第2領域管理テーブルと第1領域管理テーブルとを示す図である。It is a figure which shows the 2nd area management table and the 1st area management table after the writing process in an Example. 実施例におけるメモリ領域の拡張方法を示す図である。It is a figure which shows the expansion method of the memory area in an Example. 実施例におけるメモリ読み込み処理に関するアセンブラコードである。It is an assembler code about the memory read processing in an Example. 実施例のメモリ読み込み処理におけるトレーステーブルを示す図である。It is a figure which shows the trace table in the memory read process of an Example. 実施例の読み込み処理におけるメモリ領域を示す図である。It is a figure which shows the memory area in the read process of an Example. 情報処理装置のハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware composition of an information processing apparatus.

以下、図面を参照して、実施形態について説明する。図1は、実施形態におけるシステムの全体構成の一例を示す。実施形態におけるシステムは、情報処理装置1と表示装置2とを含む。情報処理装置1は、コンピュータの一例である。 Hereinafter, embodiments will be described with reference to the drawings. FIG. 1 shows an example of the overall configuration of the system in the embodiment. The system in the embodiment includes an information processing device 1 and a display device 2. The information processing device 1 is an example of a computer.

情報処理装置1は、OS11とメモリ管理部12と管理情報記憶部13と設定部14とアプリケーション15-1~アプリケーション15-nとを含む。以下、アプリケーション15-1~アプリケーション15-nを区別しない場合、アプリケーション15と称する。 The information processing apparatus 1 includes an OS 11, a memory management unit 12, a management information storage unit 13, a setting unit 14, and applications 15-1 to 15-n. Hereinafter, when application 15-1 to application 15-n are not distinguished, they are referred to as application 15.

OS11は、アプリケーション15からの命令に応じて、メモリ確保、メモリへのデータ書き込み、およびメモリからのデータ読み込み等の処理を行う。また、OS11は、メモリ管理部12からの指示に応じた処理を行う。 The OS 11 performs processing such as allocating memory, writing data to the memory, and reading data from the memory in response to an instruction from the application 15. Further, the OS 11 performs processing according to an instruction from the memory management unit 12.

メモリ管理部12は、アプリケーション15によるメモリ使用状況を管理する。また、メモリ管理部12は、アプリケーション15からOS11に対するメモリアクセスに関する命令をフックし、所定の条件に応じて、フックした命令と異なる命令をOS11に出力する。 The memory management unit 12 manages the memory usage status by the application 15. Further, the memory management unit 12 hooks an instruction regarding memory access from the application 15 to the OS 11, and outputs an instruction different from the hooked instruction to the OS 11 according to a predetermined condition.

メモリ管理部12は、例えば、アプリケーション15の実行ファイルからアセンブラコードを取得し、解析を行うことにより、アプリケーション15からOS11への命令をフックする。以下、アプリケーション15の実行ファイルからアセンブラコードを取得し、解析を行うことをアセンブラ解析と称することがある。メモリ管理部12は、例えば、アプリケーション15のOS11に対する処理を監視するフィルタドライバとして動作する。メモリ管理部12の詳細については、後述する。 The memory management unit 12 hooks an instruction from the application 15 to the OS 11 by, for example, acquiring an assembler code from an executable file of the application 15 and performing analysis. Hereinafter, acquiring the assembler code from the executable file of the application 15 and performing analysis may be referred to as assembler analysis. The memory management unit 12 operates, for example, as a filter driver for monitoring the processing of the application 15 for the OS 11. The details of the memory management unit 12 will be described later.

管理情報記憶部13は、メモリ管理部12によるメモリ管理に用いられる各種管理情報を記憶する。管理情報の詳細については、後述する。 The management information storage unit 13 stores various management information used for memory management by the memory management unit 12. Details of the management information will be described later.

設定部14は、メモリ管理に関する各種設定を行う。設定部14は、情報処理装置1に、フックモジュールを登録する。フックモジュールは、メモリ管理部12により実現されるプログラムモジュールである。 The setting unit 14 makes various settings related to memory management. The setting unit 14 registers the hook module in the information processing device 1. The hook module is a program module realized by the memory management unit 12.

アプリケーション15は、OS11上で動作するソフトウェアである。情報処理装置1に搭載されるアプリケーション15は、一つであってもよいし、複数であってもよい。 Application 15 is software that runs on OS 11. The application 15 mounted on the information processing apparatus 1 may be one or a plurality.

表示装置2は、情報処理装置1と通信可能であり、情報処理装置1から出力された情報を表示する。表示装置2は、例えば、メモリ管理部12が生成した情報を表示する。表示装置2は、情報処理装置1に含まれていてもよい。 The display device 2 can communicate with the information processing device 1 and displays the information output from the information processing device 1. The display device 2 displays, for example, the information generated by the memory management unit 12. The display device 2 may be included in the information processing device 1.

図2は、メモリ管理部12の一例を示す図である。メモリ管理部12は、検知部21と記録部22と書き込み判定部23と書き込み指示部24と読み込み判定部25と読み込み指示部26と出力部27とを含む。 FIG. 2 is a diagram showing an example of the memory management unit 12. The memory management unit 12 includes a detection unit 21, a recording unit 22, a write determination unit 23, a write instruction unit 24, a read determination unit 25, a read instruction unit 26, and an output unit 27.

検知部21は、監視対象であるアプリケーション15が、メモリを確保する命令、メモリへのデータ書き込み命令、またはメモリからのデータ読み込み命令をOS11に出力したことを検知する。検知部21は、例えば、アプリケーション15からOS11への命令をフックすることにより検知を行う。以下、監視対象であるアプリケーション15を監視対象アプリケーションと称する。 The detection unit 21 detects that the application 15 to be monitored outputs a memory securing instruction, a data writing instruction to the memory, or a data reading instruction from the memory to the OS 11. The detection unit 21 detects, for example, by hooking an instruction from the application 15 to the OS 11. Hereinafter, the application 15 to be monitored is referred to as a monitored application.

記録部22は、検知部21がメモリ内の領域(第1領域)を確保する命令を検知した場合、第1領域を示す情報を第1領域管理テーブルに記録する。第1領域管理テーブルは、管理情報記憶部13に記憶される。 When the detection unit 21 detects an instruction for securing an area (first area) in the memory, the recording unit 22 records information indicating the first area in the first area management table. The first area management table is stored in the management information storage unit 13.

書き込み判定部23は、検知部21がメモリの第1領域へのデータの書き込み命令を検知した場合、書き込み命令と、第1領域管理テーブルに記録された第1領域を示す情報とに基づいて、データを第1領域内に書き込み可能であるか判定する。以下、書き込み命令において書き込み対象として特定されているデータを書き込み対象データと称する。 When the detection unit 21 detects a data write command to the first area of the memory, the write determination unit 23 is based on the write command and the information indicating the first area recorded in the first area management table. It is determined whether the data can be written in the first area. Hereinafter, the data specified as the write target in the write command is referred to as the write target data.

書き込み指示部24は、書き込み判定部23が書き込み対象データを第1領域内に書き込み可能でないと判定した場合、メモリ内における第1領域とは異なる第2領域を確保する指示をOS11に出力する。さらに、書き込み指示部24は、書き込み対象データの一部分を前記第1領域に書き込み、残りの部分を前記第2領域に書き込む指示をOS11に出力する。 When the write determination unit 23 determines that the write target data cannot be written in the first area, the write instruction unit 24 outputs an instruction to secure a second area different from the first area in the memory to the OS 11. Further, the write instruction unit 24 outputs an instruction to write an instruction to write a part of the data to be written to the first area and write the remaining part to the second area to the OS 11.

OS11は、書き込み指示部24からの指示に基づいて、新たに第2領域を確保し、データの一部分を第1領域に書き込み、残りの部分を第2領域に書き込む。 Based on the instruction from the write instruction unit 24, the OS 11 newly secures a second area, writes a part of the data in the first area, and writes the remaining part in the second area.

記録部22は、書き込み判定部23が書き込み対象データを第1領域に書き込み可能でないと判定した場合、第2領域を示す情報を、第1領域を示す情報に対応付けて第2領域管理テーブルに記録する。第2領域を示す情報は、例えば、第2領域の先頭アドレスおよび確保したメモリサイズである。第2領域管理テーブルは、管理情報記憶部13に記憶される。 When the write determination unit 23 determines that the write target data cannot be written to the first area, the recording unit 22 associates the information indicating the second area with the information indicating the first area and puts it in the second area management table. Record. The information indicating the second area is, for example, the start address of the second area and the reserved memory size. The second area management table is stored in the management information storage unit 13.

出力部27は、書き込み判定部23が、書き込み対象データを第1領域内に書き込み可能でないと判定した場合、第2領域へのデータの書き込みに関する情報を出力する。 When the write determination unit 23 determines that the write target data is not writable in the first area, the output unit 27 outputs information regarding writing of the data to the second area.

なお、本実施形態では、書き込み指示部24が、第2領域にデータを書き込むことをOS11に指示した場合に、オーバーランが発生したとみなすこととする。 In this embodiment, when the write instruction unit 24 instructs the OS 11 to write data in the second area, it is considered that an overrun has occurred.

読み込み判定部25は、検知部21が読み込み命令を検知した場合、読み込み命令と、第1領域を示す情報とに基づいて、読み込み対象領域のうちの少なくとも一部が第2領域に含まれるかを判定する。以下、読み込み命令において読み込み対象として特定されているデータを読み込み対象データと称する。 When the detection unit 21 detects a read command, the read determination unit 25 determines whether at least a part of the read target area is included in the second area based on the read command and the information indicating the first area. judge. Hereinafter, the data specified as the read target in the read command is referred to as the read target data.

読み込み指示部26は、読み込み対象領域のうちの少なくとも一部が第2領域に含まれると判定した場合、読み込み対象データのうちの少なくとも一部を、第2領域から読み込む指示をOS11に出力する。読み込み指示部26は、第1領域を示す情報に対応付けられた第2領域を示す情報に基づいてOS11に指示する第2領域を特定する。 When the read instruction unit 26 determines that at least a part of the read target area is included in the second area, the read instruction unit 26 outputs an instruction to read at least a part of the read target data from the second area to the OS 11. The read instruction unit 26 specifies a second area to be instructed to the OS 11 based on the information indicating the second area associated with the information indicating the first area.

出力部27は、読み込み判定部25が、読み込み対象領域のうちの少なくとも一部が第2領域に含まれると判定した場合、第2領域からのデータの読み込みに関する情報を出力する。 When the read determination unit 25 determines that at least a part of the read target area is included in the second area, the output unit 27 outputs information regarding reading of data from the second area.

出力部27は、例えば、第2領域へのデータの書き込みまたは第2領域からのデータの読み込みに関する情報を生成して、表示装置2に表示させてもよい。また、出力部27は、情報処理装置1と通信可能な他の情報処理装置等(例えば、管理用サーバ)に、生成した情報を送信してもよい。 The output unit 27 may generate, for example, information regarding writing data to the second area or reading data from the second area and display it on the display device 2. Further, the output unit 27 may transmit the generated information to another information processing device or the like (for example, a management server) capable of communicating with the information processing device 1.

図3は、第1領域管理テーブルの一例を示す図である。図3に示すように、第1領域管理テーブルは、モジュール名とハンドル名とBaseアドレスとサイズとリンクIdentification(ID)とを含む。第1領域管理テーブルに記録されるハンドル名、Baseアドレスおよびサイズは、第1領域を示す情報の一例である。第1領域管理テーブルの各項目は、検知部21がメモリ内の第1領域を確保する命令を検知した際に、記録部22により記録される。 FIG. 3 is a diagram showing an example of the first area management table. As shown in FIG. 3, the first area management table includes a module name, a handle name, a base address, a size, and a link identification (ID). The handle name, Base address, and size recorded in the first area management table are examples of information indicating the first area. Each item of the first area management table is recorded by the recording unit 22 when the detection unit 21 detects an instruction for securing the first area in the memory.

「モジュール名」は、メモリ確保命令をOS11に出力するプログラムのモジュール名を示す。「ハンドル名」は、メモリ確保に用いられるハンドル名を示す。「baseアドレス」は、確保されるメモリの先頭アドレスを示す。「サイズ」は、確保されるメモリのサイズ[byte]を示す。「リンクID」は、第1領域と第2領域とを対応付ける情報の一例である。 The "module name" indicates the module name of the program that outputs the memory allocation instruction to the OS 11. "Handle name" indicates a handle name used for memory allocation. The "base address" indicates the start address of the reserved memory. “Size” indicates the size of the memory to be allocated [byte]. The "link ID" is an example of information that associates the first area with the second area.

なお、第1領域管理テーブルに記録される情報は、図3に示す情報に限られない。例えば、第1領域管理テーブルに記録される情報は、確保される第1領域の終端アドレスを含んでいてもよい。 The information recorded in the first area management table is not limited to the information shown in FIG. For example, the information recorded in the first area management table may include the end address of the first area to be secured.

図4は、第2領域管理テーブルの一例を示す図である。第2領域管理テーブルは、リンクIDとBaseアドレスとサイズとを含む。Baseアドレスおよびサイズは、第2領域を示す情報の一例である。記録部22は、第2領域が確保された場合、第2領域管理テーブルの各項目を記録する。 FIG. 4 is a diagram showing an example of the second area management table. The second area management table includes a link ID, a Base address, and a size. The Base address and size are examples of information indicating the second region. When the second area is secured, the recording unit 22 records each item of the second area management table.

「リンクID」は、図3に示す第1領域管理テーブル内のリンクIDに対応している。記録部22は、拡張元の第1領域のBaseアドレスおよびサイズに対応付けられたリンクIDと同じリンクIDを第2領域のBaseアドレスおよびサイズに対応付けて記録する。 The "link ID" corresponds to the link ID in the first area management table shown in FIG. The recording unit 22 records the same link ID as the link ID associated with the base address and size of the first region of the expansion source in association with the base address and size of the second region.

「Baseアドレス」は、第2領域のメモリの先頭アドレスを示す。「サイズ」は、第2領域のメモリサイズ[byte]を示す。 The "Base address" indicates the start address of the memory in the second area. “Size” indicates the memory size [byte] of the second area.

なお、第2領域管理テーブルに記録される情報は、図4に示す情報に限られない。例えば、第2領域管理テーブルに記録される情報は、確保される第2領域の終端アドレスを含んでいてもよい。 The information recorded in the second area management table is not limited to the information shown in FIG. For example, the information recorded in the second area management table may include the end address of the second area to be secured.

第1領域管理テーブルと第2領域管理テーブルとは一つのテーブルであってもよい。例えば、記録部は、第2領域が確保された場合に、第2領域のBaseアドレスおよびサイズを、第1領域を示す情報と対応づけて第1領域管理テーブル内に記録してもよい。 The first area management table and the second area management table may be one table. For example, when the second area is secured, the recording unit may record the Base address and size of the second area in the first area management table in association with the information indicating the first area.

図5は、複数回拡張が行われた場合の第2領域管理テーブルの一例を示す図である。図5(a)に示す第2領域管理テーブル1は、1回目の拡張(第2領域の確保)が行われた際に生成されるテーブルであり、図4に示す第2領域管理テーブルにリンクID’が追加された構成である。記録部22は、1回目の拡張が行われた際に、第2領域管理テーブル1に、リンクID、Baseアドレス、およびサイズを記録する。 FIG. 5 is a diagram showing an example of a second area management table when expansion is performed a plurality of times. The second area management table 1 shown in FIG. 5A is a table generated when the first expansion (securing of the second area) is performed, and is linked to the second area management table shown in FIG. This is a configuration in which ID'is added. The recording unit 22 records the link ID, the base address, and the size in the second area management table 1 when the first expansion is performed.

図5(b)に示す第2領域管理テーブル2は、2回目の拡張が行われた際に生成されるテーブルである。第2領域管理テーブル2は、リンクID’とリンクID’’とBaseアドレスとサイズとを含む。第2領域管理テーブル2のリンクID’は、第2領域管理テーブル1のリンクID’に対応する。すなわち、リンクID’は、1回目に確保された第2領域と2回目に確保された第2領域とを対応付ける情報である。 The second area management table 2 shown in FIG. 5B is a table generated when the second expansion is performed. The second area management table 2 includes a link ID ′, a link ID ″, a base address, and a size. The link ID'of the second area management table 2 corresponds to the link ID'of the second area management table 1. That is, the link ID'is information that associates the second region secured for the first time with the second region secured for the second time.

例えば、1回目の第2領域の確保が行われた後に、第1領域と第2領域の合計サイズを超えるデータの書き込み命令が出力された場合に、別の第2領域が確保され、記録部22は、第2領域管理テーブル2を生成する。そして、記録部22は、第2領域管理テーブル2のリンクID’、Baseアドレス、およびサイズを記録する。また、記録部22は、第2領域管理テーブル1のリンクID’に第2領域管理テーブル2に記録したリンクID’と同一のIDを記録する。 For example, when a write command for data exceeding the total size of the first area and the second area is output after the first securing of the second area is performed, another second area is secured and the recording unit is used. 22 generates the second area management table 2. Then, the recording unit 22 records the link ID', the base address, and the size of the second area management table 2. Further, the recording unit 22 records the same ID as the link ID'recorded in the second area management table 2 in the link ID'of the second area management table 1.

リンクID’’は、3回目の第2領域の確保が行われた場合に、2回目に確保された第2領域と、3回目に確保された第2領域とを対応付けるために記録される。よって、記録部22は、2回目の第2領域の確保が行われた時点では、リンクID’’を記録しない。 The link ID ″ is recorded to associate the second area secured for the second time with the second area secured for the third time when the second area is secured for the third time. Therefore, the recording unit 22 does not record the link ID ″ at the time when the second region is secured for the second time.

図6は、メモリ領域の拡張方法を示す図である。図6に示す例では、メモリを確保する命令に応じて、OS11が第1領域A、第1領域B、および第1領域Cを確保したとする。また、監視対象アプリケーションから、第1領域Aのサイズを超えるデータの書き込み命令が出力され、OS11が第1領域Aに対応する第2領域Aを確保したとする。また、監視対象アプリケーションから、第1領域Bのサイズを超えるデータの書き込み命令が出力され、OS11が第1領域Bに対応する第2領域Bを確保したとする。すなわち、第1領域Aと第2領域Aには、一つのデータが分割して記憶されている。また、第1領域Bと第2領域Bには、一つのデータが分割して記憶されている。 FIG. 6 is a diagram showing a method of expanding the memory area. In the example shown in FIG. 6, it is assumed that the OS 11 secures the first area A, the first area B, and the first area C in response to the instruction to secure the memory. Further, it is assumed that the monitored application outputs a write command for data exceeding the size of the first area A, and the OS 11 secures the second area A corresponding to the first area A. Further, it is assumed that the monitored application outputs a write command for data exceeding the size of the first area B, and the OS 11 secures the second area B corresponding to the first area B. That is, one piece of data is divided and stored in the first area A and the second area A. Further, one piece of data is divided and stored in the first area B and the second area B.

図6に示すように、第2領域が確保された場合、第2領域と拡張元の第1領域とはメモリ上で連続した領域にならない可能性がある。本実施形態では、図3~図5に示すように、第1領域管理テーブルおよび第2領域管理テーブルにおいて、リンクIDにより第1領域を示す情報と第2領域を示す情報とが対応付けられている。そのため、読み込み指示部26は、読み込み対象領域の少なくとも一部が第2領域に含まれる場合、読み込み対象領域に含まれる第2領域を特定し、特定した第2領域からデータを読み込むことをOS11に指示することができる。 As shown in FIG. 6, when the second area is secured, the second area and the expansion source first area may not be continuous areas on the memory. In the present embodiment, as shown in FIGS. 3 to 5, in the first area management table and the second area management table, the information indicating the first area and the information indicating the second area are associated with each other by the link ID. There is. Therefore, when at least a part of the read target area is included in the second area, the read instruction unit 26 specifies the second area included in the read target area, and tells the OS 11 to read the data from the specified second area. Can be instructed.

図7は、トレーステーブルの一例を示す図である。トレーステーブルは、レジスタとハンドルとの対応関係を示すテーブルである。記録部22は、メモリアクセスに用いられたハンドルのハンドル名と、そのメモリアクセスに関する情報が記憶されたレジスタのレジスタ名とを対応付けてトレーステーブルに記録する。トレーステーブルは、例えば、管理情報記憶部13に記憶される。 FIG. 7 is a diagram showing an example of a trace table. The trace table is a table showing the correspondence between registers and handles. The recording unit 22 records the handle name of the handle used for the memory access and the register name of the register in which the information about the memory access is stored in the trace table in association with each other. The trace table is stored in, for example, the management information storage unit 13.

図7に示すg_hMem100、g_hMem200およびg_hMem300およびは、ハンドル名の例である。また、図7に示すrcxおよびraxは、レジスタ名の例である。図7に示す例ではg_hMem200とrcxとが対応し、g_hMem200とrcxとが対応している。 G_hMem100, g_hMem200 and g_hMem300 shown in FIG. 7 are examples of handle names. Further, rcx and rax shown in FIG. 7 are examples of register names. In the example shown in FIG. 7, g_hMem200 and rcx correspond to each other, and g_hMem200 and rcx correspond to each other.

メモリ管理部12は、トレーステーブルを参照することにより、レジスタに記憶されている値が、どのハンドルに関する値かを容易に特定することができる。 By referring to the trace table, the memory management unit 12 can easily specify which handle the value stored in the register is related to.

図8は、第2領域へのデータの書き込みに関する情報の一例を示す図である。出力部27は、書き込み判定部23が書き込み対象データを第1領域に書き込み可能でないと判定した場合に、図8の例に示す、データの書き込みに関する情報を出力する。 FIG. 8 is a diagram showing an example of information regarding writing of data to the second region. When the write determination unit 23 determines that the write target data is not writable in the first area, the output unit 27 outputs the information related to data writing shown in the example of FIG.

図8に示す「時刻」は、例えば、書き込み指示部24が、OS11に第2領域への書き込み指示を行ったタイミングである。「イベント」は、発生したイベント内容を示す。出力部27は、第2領域への書き込みの場合、例えば、「オーバーラン発生」と記述する。「詳細情報」には、例えば、書き込みが行われる第2領域の先頭アドレスとサイズが記述される。「スタック情報」には、書き込みを実行したモジュール名および関数名、モジュールが使用するスタック領域のアドレスが記述される。図8に示す「スタック情報」は、モジュール「mod_4.dll」における関数「WriteMem」が実行する書き込み処理において、オーバーランが発生したことを示している。 The “time” shown in FIG. 8 is, for example, the timing at which the write instruction unit 24 gives an instruction to write to the second area to the OS 11. "Event" indicates the content of the event that occurred. In the case of writing to the second area, the output unit 27 describes, for example, "overrun occurrence". In the "detailed information", for example, the start address and size of the second area where writing is performed are described. In the "stack information", the name of the module and the function that executed the write, and the address of the stack area used by the module are described. The "stack information" shown in FIG. 8 indicates that an overrun has occurred in the write process executed by the function "WriteMem" in the module "mod_4.dll".

「スタック情報」には、オーバーランを発生させたモジュールおよび関数と、呼び出し元のモジュールおよび関数が順に記述される。すなわち、図8に示す情報は、モジュール「mod_3.dll」における関数「function3」が、モジュール「mod_4.dll」における関数「WriteMem」を呼び出したことを示している。また、図8に示す情報は、モジュール「mod_2.dll」における関数「function2」が、モジュール「mod_3.dll」における関数「function3」を呼び出したことを示している。また、図8に示す情報は、モジュール「mod_1.dll」における関数「function1」がモジュール「mod_2.dll」における関数「function2」を呼び出したことを示している。 In the "stack information", the module and function that caused the overrun and the calling module and function are described in order. That is, the information shown in FIG. 8 indicates that the function "function3" in the module "mod_3.dll" called the function "WriteMem" in the module "mod_4.dll". Further, the information shown in FIG. 8 indicates that the function "function 2" in the module "mod_2.dll" has called the function "function 3" in the module "mod_3.dll". Further, the information shown in FIG. 8 indicates that the function "function1" in the module "mod_1.dl" has called the function "function2" in the module "mod_1.dl".

アプリケーション15によるオーバーランが発生し、OS11が例外を発生させてアプリケーションを異常終了させた場合、オーバーランの発生タイミングと例外の発生タイミングが一致しない。従って、情報が出力されなかった場合、オーバーランを行ったタイミングを特定することが困難である。また、情報が出力されなかった場合、オーバーランを発生させたモジュール、関数、書き込まれたメモリ領域のアドレスおよびサイズ等を特定することが困難である。 When an overrun by the application 15 occurs and the OS 11 generates an exception and terminates the application abnormally, the overrun occurrence timing and the exception occurrence timing do not match. Therefore, when the information is not output, it is difficult to specify the timing of overrun. Further, when the information is not output, it is difficult to specify the module, the function, the address and the size of the written memory area that caused the overrun, and the like.

本実施形態の情報処理装置1は、第2領域への書き込みに関する情報を出力することにより、オーバーランの発生タイミング、オーバーランを発生させたモジュール、関数、書き込まれたメモリ領域のアドレスおよびサイズ等を明示することができる。 The information processing apparatus 1 of the present embodiment outputs information regarding writing to the second area, such as the timing of overrun occurrence, the module and function that caused the overrun, the address and size of the written memory area, and the like. Can be specified.

図9は、第2領域からのデータの読み込みに関する情報の一例を示す図である。図9に示す「時刻」は、例えば、読み込み指示部26が、OS11に第2領域からの読み込み指示を行ったタイミングである。「イベント」は、発生したイベント内容を示す。出力部27は、第2領域からの読み込みの際に情報を出力する場合、例えば、「オーバーラン領域読み込み」と記述する。「詳細情報」には、例えば、第2領域の先頭アドレスと読み込み対象データサイズとが記述される。 FIG. 9 is a diagram showing an example of information regarding reading of data from the second region. The “time” shown in FIG. 9 is, for example, the timing at which the read instruction unit 26 gives an instruction to read from the second area to the OS 11. "Event" indicates the content of the event that occurred. When the output unit 27 outputs information when reading from the second area, it is described as, for example, "overrun area reading". In the "detailed information", for example, the start address of the second region and the data size to be read are described.

「スタック情報」には、読み込みを実行したモジュール名および関数名、モジュールが使用するスタック領域のアドレスが記述される。図9に示す情報は、モジュール「mod_4.dll」における関数「ReadMem」が実行する読み込み処理において、オーバーランが発生したことを示している。また、図8と同様に、オーバーラン領域への読み込みを発生させたモジュールおよび関数と、呼び出し元のモジュールおよび関数が順に記述される。 In the "stack information", the name of the module and the function that executed the reading, and the address of the stack area used by the module are described. The information shown in FIG. 9 indicates that an overrun has occurred in the reading process executed by the function "ReadMem" in the module "mod_4.dll". Further, similarly to FIG. 8, the module and the function that caused the reading into the overrun area and the calling module and the function are described in order.

本実施形態の情報処理装置1は、第2領域からのデータ読み込みに関する情報を出力することにより、読み込みタイミング、第2領域からの読み込みを実行したモジュール、関数、読み込まれたメモリ領域のアドレスおよびサイズ等を明示することができる。 The information processing apparatus 1 of the present embodiment outputs information regarding data reading from the second area, so that the reading timing, the module that executed the reading from the second area, the function, and the address and size of the read memory area. Etc. can be clearly stated.

以下、本実施形態における情報処理装置1の処理の流れについて説明する。
図10は、実施形態の設定処理の一例を示すフローチャートである。設定部14は、メモリ管理に関する各種設定を行う(ステップS101)。設定部14は、例えば、ユーザの操作に応じて、監視対象アプリケーション名、および情報出力形式等を記録した設定ファイルを生成する。
Hereinafter, the processing flow of the information processing apparatus 1 in the present embodiment will be described.
FIG. 10 is a flowchart showing an example of the setting process of the embodiment. The setting unit 14 makes various settings related to memory management (step S101). The setting unit 14 generates, for example, a setting file in which the name of the application to be monitored, the information output format, and the like are recorded according to the operation of the user.

設定部14は、情報処理装置1に、フックモジュールを登録する(ステップS102)。フックモジュールは、メモリ管理部12により実現されるプログラムモジュールである。設定部14は、例えば、ユーザの操作に応じて、フックモジュールを情報処理装置1にインストールして、フックモジュールを実行可能な状態とする。 The setting unit 14 registers the hook module in the information processing device 1 (step S102). The hook module is a program module realized by the memory management unit 12. For example, the setting unit 14 installs the hook module in the information processing apparatus 1 according to the operation of the user, and makes the hook module executable.

図11は、メモリ管理部12の処理の一例を示すフローチャートである。図11に示す処理は、メモリ管理部12により実現されるフックモジュールが起動する際に開始する。なお、監視対象アプリケーションが複数存在する場合、メモリ管理部12は、監視対象アプリケーション毎に、図11に示す処理を実行する。 FIG. 11 is a flowchart showing an example of processing by the memory management unit 12. The process shown in FIG. 11 starts when the hook module realized by the memory management unit 12 is activated. When there are a plurality of monitored applications, the memory management unit 12 executes the process shown in FIG. 11 for each monitored application.

検知部21は、監視対象アプリケーションが起動したかを判定する(ステップS201)。検知部21は、例えば、起動したアプリケーションが監視対象であるかをプロセスID、または設定ファイルに記録された監視対象アプリケーション名等に基づいて判定する。検知部21が、監視対象アプリケーションが起動していないと判定した場合(ステップS201でNO)、処理は、ステップS202に移行しない。 The detection unit 21 determines whether the monitored application has been started (step S201). The detection unit 21 determines, for example, whether the started application is a monitoring target based on the process ID, the monitoring target application name recorded in the setting file, or the like. When the detection unit 21 determines that the monitored application is not started (NO in step S201), the process does not shift to step S202.

検知部21が、監視対象アプリケーションが起動したと判定した場合(ステップS201でYES)、処理は、ステップS202に移行する。 When the detection unit 21 determines that the monitored application has been started (YES in step S201), the process proceeds to step S202.

監視対象アプリケーションがメモリ内の領域(第1領域)を確保する命令をOS11に出力したことを検知部21が検知した場合(ステップS202でYES)、メモリ管理部12は、メモリ確保監視処理を実行する(ステップS203)。ステップS203のメモリ確保監視処理について、詳細は後述する。ステップS202でNOの場合、処理は、ステップS204に移行する。 When the detection unit 21 detects that the monitored application outputs an instruction for allocating an area (first area) in the memory to the OS 11 (YES in step S202), the memory management unit 12 executes the memory allocation monitoring process. (Step S203). The details of the memory allocation monitoring process in step S203 will be described later. If NO in step S202, the process proceeds to step S204.

監視対象アプリケーションがメモリの第1領域へのデータ書き込み命令をOS11に出力したことを検知部21が検知した場合(ステップS204でYES)、メモリ管理部12は、メモリ書き込み監視処理を実行する(ステップS205)。ステップS205のメモリ書き込み監視処理について、詳細は後述する。ステップS204でNOの場合、処理は、ステップS206に移行する。 When the detection unit 21 detects that the monitored application outputs a data write command to the first area of the memory to the OS 11 (YES in step S204), the memory management unit 12 executes the memory write monitoring process (step). S205). The details of the memory write monitoring process in step S205 will be described later. If NO in step S204, the process proceeds to step S206.

監視対象アプリケーションがメモリに書き込まれたデータに対する読み込み命令をOS11に出力したことを検知部21が検知した場合(ステップS206でYES)、メモリ管理部12は、メモリ読み込み監視処理を実行する(ステップS207)。メモリ読み込み監視処理について、詳細は後述する。ステップS206でNOの場合、処理は、ステップS208に移行する。 When the detection unit 21 detects that the monitored application has output a read instruction for the data written in the memory to the OS 11 (YES in step S206), the memory management unit 12 executes the memory read monitoring process (step S207). ). The details of the memory read monitoring process will be described later. If NO in step S206, the process proceeds to step S208.

検知部21は、監視対象アプリケーションが停止したか判定する(ステップS208)。監視対象のアプリケーションが停止していないと判定された場合(ステップS208でNO)、処理は、ステップS202に戻る。 The detection unit 21 determines whether the monitored application has stopped (step S208). If it is determined that the application to be monitored is not stopped (NO in step S208), the process returns to step S202.

監視対象アプリケーションが停止していると判定された場合(ステップS208でYES)、検知部21は、監視終了指示を受けたか判定する(ステップS209)。監視終了指示は、例えば、ユーザの操作に基づいて行われる。 When it is determined that the monitored application is stopped (YES in step S208), the detection unit 21 determines whether or not the monitoring end instruction has been received (step S209). The monitoring end instruction is given based on, for example, a user operation.

メモリ管理部12は、監視終了指示を受けていない場合(ステップS209でNO)、処理をステップS201に戻す。メモリ管理部12は、監視終了指示を受けた場合(ステップS209でYES)、処理を終了する。 If the memory management unit 12 has not received the monitoring end instruction (NO in step S209), the memory management unit 12 returns the process to step S201. When the memory management unit 12 receives the monitoring end instruction (YES in step S209), the memory management unit 12 ends the process.

図12は、図11のステップS203におけるメモリ確保監視処理の一例を示すフローチャートである。 FIG. 12 is a flowchart showing an example of the memory allocation monitoring process in step S203 of FIG.

記録部22は、第1領域を示す情報を、第1領域管理テーブルに記録する(ステップS301)。記録部22は、例えば、図3に示す第1領域管理テーブルに列を追加する。そして、記録部22は、第1領域を示す情報として、メモリ確保命令を実行したモジュール名、メモリ確保に用いられたハンドル名、確保するメモリのBaseアドレス、確保するメモリのサイズを記録する。 The recording unit 22 records the information indicating the first area in the first area management table (step S301). The recording unit 22 adds a column to, for example, the first area management table shown in FIG. Then, the recording unit 22 records, as information indicating the first area, the name of the module in which the memory allocation instruction is executed, the name of the handle used for allocating the memory, the base address of the memory to be allocated, and the size of the memory to be allocated.

記録部22は、メモリ確保に用いられたハンドル名に対応するトレーステーブルが存在するか判定する(ステップS302)。ステップS302でNOの場合、記録部22は、メモリ確保に用いられたハンドル名に対応するトレーステーブルを作成する(ステップS303)。トレーステーブルは、例えば、図7に示すテーブルであり、作成された時点では、ハンドル名が記録されており、レジスタ名が記録されていない。 The recording unit 22 determines whether or not a trace table corresponding to the handle name used for allocating the memory exists (step S302). If NO in step S302, the recording unit 22 creates a trace table corresponding to the handle name used for allocating the memory (step S303). The trace table is, for example, the table shown in FIG. 7, and at the time of creation, the handle name is recorded and the register name is not recorded.

ステップS302でYESの場合またはステップS303の処理後、記録部22は、メモリ確保に用いられたハンドル名に対応するトレーステーブルに、確保するメモリのBaseアドレスが記憶されたレジスタのレジスタ名を記録する(ステップS304)。なお、確保するメモリのBaseアドレスは、OS11の処理により予めレジスタに記憶されているとする。 If YES in step S302 or after the processing in step S303, the recording unit 22 records the register name of the register in which the Base address of the memory to be allocated is stored in the trace table corresponding to the handle name used for allocating the memory. (Step S304). It is assumed that the Base address of the memory to be secured is stored in the register in advance by the processing of the OS 11.

記録部22は、ステップS304で記録したレジスタ名が他のトレーステーブルに記録されている場合、そのレジスタ名を削除する(ステップS305)。 If the register name recorded in step S304 is recorded in another trace table, the recording unit 22 deletes the register name (step S305).

図13は、図11のステップS205におけるメモリ書き込み監視処理の一例を示すフローチャートである。書き込み判定部23は、書き込み命令における書き込み先頭アドレスが、どのハンドルに対応するメモリ領域(第1領域)内に存在するかを、第1領域管理テーブルに基づいて特定する(ステップS401)。書き込み判定部23は、例えば、書き込み命令をフックして、書き込み命令に含まれる書き込み先頭アドレスを取得する。そして、書き込み判定部23は、書き込み先頭アドレスが、第1領域管理テーブルにおけるいずれかのハンドルのBaseアドレスから、Baseアドレス+サイズまでの間に存在する場合、書き込みアドレスがそのハンドルのメモリ領域内であると判定する。第1領域管理テーブルに第1領域の終端アドレスが含まれている場合、書き込み判定部23は、書き込み先頭アドレスが、Baseアドレスから終端アドレスまでの間に含まれているかを判定してもよい。以下、ステップS401で書き込み判定部23が特定した、書き込みに使用されるハンドルを書き込み対象ハンドルと称する。 FIG. 13 is a flowchart showing an example of the memory write monitoring process in step S205 of FIG. The write determination unit 23 specifies in the memory area (first area) corresponding to which handle the write start address in the write command exists based on the first area management table (step S401). The write determination unit 23 hooks the write instruction, for example, and acquires the write start address included in the write instruction. Then, when the write start address exists between the Base address of any handle in the first area management table and the Base address + size, the write determination unit 23 has the write address in the memory area of the handle. Judge that there is. When the end address of the first area is included in the first area management table, the write determination unit 23 may determine whether the write start address is included between the Base address and the end address. Hereinafter, the handle used for writing specified by the write determination unit 23 in step S401 is referred to as a write target handle.

書き込み判定部23は、書き込み先頭アドレスに書き込み対象データサイズを加算した値が記憶されたレジスタを、例えば、アセンブラ解析により特定する(ステップS402)。なお、書き込み先頭アドレスに書き込み対象データサイズを加算した値は、OS11の処理により予めレジスタに記憶されているとする。 The write determination unit 23 identifies a register in which a value obtained by adding the write target data size to the write start address is stored, for example, by assembler analysis (step S402). It is assumed that the value obtained by adding the write target data size to the write start address is stored in the register in advance by the processing of the OS 11.

記録部22は、ステップS401で特定した書き込み対象ハンドルのトレーステーブルに、ステップS402で特定したレジスタのレジスタ名を記録する(ステップS403)。すなわち、記録部22は、書き込み対象ハンドルと、ステップS402で特定したレジスタのレジスタ名とを対応付けて記録する。レジスタ名は、レジスタを示す情報の一例である。 The recording unit 22 records the register name of the register specified in step S402 in the trace table of the write target handle specified in step S401 (step S403). That is, the recording unit 22 records the write target handle in association with the register name of the register specified in step S402. The register name is an example of information indicating a register.

書き込み判定部23は、レジスタに記憶された値と第1領域管理テーブルにおいて書き込み対象ハンドルに対応付けられているBaseアドレスとの差分であるoffset1を算出する(ステップS405)。レジスタの値は、上述のように、書き込み先頭アドレスに書き込み対象データサイズを加算した値である。 The write determination unit 23 calculates offset1, which is the difference between the value stored in the register and the Base address associated with the write target handle in the first area management table (step S405). As described above, the register value is a value obtained by adding the write target data size to the write start address.

なお、書き込み判定部23は、例えば、トレーステーブルに書き込み先頭アドレスと書込みデータサイズをそれぞれ記憶している場合は、書き込み先頭アドレスと書き込みデータサイズとをレジスタからそれぞれ取得し、取得した書き込み先頭アドレスと書き込みデータサイズとを加算して、ステップS405の算出に用いてもよい。 For example, when the write determination unit 23 stores the write start address and the write data size in the trace table, the write start address and the write data size are acquired from the registers, respectively, and the acquired write start address and the acquired write start address are used. The write data size may be added and used in the calculation of step S405.

書き込み判定部23は、第1領域管理テーブルを参照して、書き込み対象データが第1領域内に書き込み可能であるか判定する(ステップS406)。書き込み判定部23は、例えば、第1領域管理テーブルを参照して、offset1が、書き込み対象ハンドルの第1領域のサイズ以下である場合、書き込み対象データが第1領域に書き込み可能であると判定する(ステップS406でYES)。また、書き込み判定部23は、第1領域管理テーブルを参照して、offset1が、書き込み対象ハンドルの第1領域のサイズより大きい場合、書き込み対象データが第1領域に書き込み可能でないと判定する(ステップS406でNO)。 The write determination unit 23 refers to the first area management table and determines whether the data to be written can be written in the first area (step S406). The write determination unit 23, for example, refers to the first area management table and determines that the write target data can be written to the first area when the offset1 is equal to or smaller than the size of the first area of the write target handle. (YES in step S406). Further, the write determination unit 23 refers to the first area management table, and if offset1 is larger than the size of the first area of the write target handle, determines that the write target data is not writable in the first area (step). NO in S406).

ステップS406でNOの場合、書き込み指示部24は、第1領域とは異なる第2領域を確保することと、書き込み対象データの一部分を第1領域に書き込み、残りの部分を第2領域に書き込むことを、OS11に指示する(ステップS407)。ステップS407で確保される第2領域は、offset1から書き込み対象ハンドルのサイズを減算したサイズの領域である。書き込み指示部24は、例えば、書き込み対象データを、第1領域に書き込み可能な第1部分と残りの部分である第2部分とに分割し、第1部分を第1領域に書き込み、第2部分を第2領域に書き込みことをOS11に指示する。OS11は、書き込み指示部24からの指示に基づいて、書き込みを行う。 When NO in step S406, the write instruction unit 24 secures a second area different from the first area, writes a part of the data to be written to the first area, and writes the remaining part to the second area. Is instructed to OS 11 (step S407). The second area secured in step S407 is an area having a size obtained by subtracting the size of the write target handle from offset1. The write instruction unit 24, for example, divides the data to be written into a first part writable in the first area and a second part which is the remaining part, writes the first part in the first area, and the second part. Instructs OS 11 to write to the second area. The OS 11 writes based on the instruction from the write instruction unit 24.

記録部22は、第2領域管理テーブルを作成する(ステップS408)。そして、記録部22は、第2領域を示す情報を、第1領域を示す情報に対応付けて記録する(ステップS409)。記録部22は、例えば、第1領域管理テーブルにおいて書き込み対象ハンドルに対応付けてリンクIDを記録し、第2領域管理テーブルにおいて、そのリンクIDと第2領域のBaseアドレスおよびサイズとを対応付けて記録する。 The recording unit 22 creates a second area management table (step S408). Then, the recording unit 22 records the information indicating the second area in association with the information indicating the first area (step S409). For example, the recording unit 22 records the link ID in association with the write target handle in the first area management table, and associates the link ID with the Base address and size of the second area in the second area management table. Record.

出力部27は、第2領域へのデータの書き込みに関する情報を出力する(ステップS410)。出力部27は、例えば、図8に示す情報を生成し、表示装置2に表示させる、または所定の領域に記憶する。 The output unit 27 outputs information regarding writing of data to the second area (step S410). The output unit 27 generates, for example, the information shown in FIG. 8, displays it on the display device 2, or stores it in a predetermined area.

以上のように、書き込み判定部23は、書き込み対象データのサイズが予め確保されたメモリ領域のサイズを超えた場合、新たに第2領域を確保するとともに第2領域にデータを書き込むことをOS11に指示する。そのため、本実施形態の情報処理装置1は、アプリケーションの強制終了を抑制することができる。 As described above, when the size of the data to be written exceeds the size of the memory area secured in advance, the write determination unit 23 newly secures the second area and writes the data to the second area to the OS 11. Instruct. Therefore, the information processing device 1 of the present embodiment can suppress the forced termination of the application.

また、出力部27は、第2領域へのデータ書き込みに関する情報を出力するので、オーバーランの発生タイミング、オーバーランを発生させたモジュール、関数、書き込まれたメモリ領域のアドレスおよびサイズ等を明示することができる。 Further, since the output unit 27 outputs information regarding data writing to the second area, the overrun occurrence timing, the module and function that caused the overrun, the address and size of the written memory area, and the like are clearly indicated. be able to.

図14および図15は、図11のS207におけるメモリ読み込み監視処理の一例を示すフローチャートである。読み込み判定部25は、読み込み命令をフックして読み込みに用いられるハンドルを特定し、第1領域管理テーブルから、そのハンドルに対応するbaseアドレスとサイズを取得する(ステップS501)。以下、ステップS501で特定されたハンドルを読み込み対象ハンドルと称する。 14 and 15 are flowcharts showing an example of the memory read monitoring process in S207 of FIG. 11. The read determination unit 25 hooks the read instruction, identifies the handle used for reading, and acquires the base address and size corresponding to the handle from the first area management table (step S501). Hereinafter, the handle specified in step S501 is referred to as a read target handle.

記録部22は、読み込み先頭アドレスが記憶されたレジスタをアセンブラ解析により特定し、特定したレジスタのレジスタ名を読み込み対象ハンドルと対応付けてトレーステーブルに記憶する(ステップS502)。なお読み込み先頭アドレスは、OS11の処理により予めレジスタに記憶されているとする。 The recording unit 22 identifies the register in which the read start address is stored by assembler analysis, and stores the register name of the specified register in the trace table in association with the handle to be read (step S502). It is assumed that the read start address is stored in the register in advance by the processing of OS11.

読み込み判定部25は、トレーステーブルから読み込み対象ハンドルのレジスタを特定し、そのレジスタに記憶されたデータを取得する(ステップS503)。すなわち、読み込み判定部25は、読み込み命令における読み込み先頭アドレスをレジスタから取得する。 The read determination unit 25 identifies the register of the handle to be read from the trace table, and acquires the data stored in the register (step S503). That is, the read determination unit 25 acquires the read start address in the read instruction from the register.

読み込み判定部25は、読み込み対象データサイズが記憶されたレジスタをアセンブラ解析により特定し、レジスタから読み込み対象データサイズを取得する(ステップS504)。なお、読み込み対象データサイズは、OS11の処理により予めレジスタに記憶されているとする。 The read determination unit 25 identifies the register in which the read target data size is stored by assembler analysis, and acquires the read target data size from the register (step S504). It is assumed that the data size to be read is stored in the register in advance by the processing of the OS 11.

読み込み判定部25は、下記の式によりoffset2を計算する(ステップS505)。
offset2=読み込み先頭アドレス-読み込み対象ハンドルのbaseアドレス
The read determination unit 25 calculates offset2 by the following formula (step S505).
offset2 = read start address-base address of read target handle

読み込み判定部25は、読み込み対象領域の全範囲が第2領域に含まれるかを判定する(ステップS506)。読み込み判定部25は、offset2が読み込み対象ハンドルの第1領域のサイズより大きい場合、読み込み対象データが第1領域に含まれず、読み込み対象データの全範囲が第2領域に含まれていると判定する(ステップS506でYES)。読み込み判定部25は、offset2が読み込み対象ハンドルについて確保された第1領域のサイズ以下である場合、読み込み対象データの少なくとも一部が第1領域に含まれていると判定する(ステップS506でNO)。 The read determination unit 25 determines whether the entire range of the read target area is included in the second area (step S506). When offset2 is larger than the size of the first area of the read target handle, the read determination unit 25 determines that the read target data is not included in the first area and the entire range of the read target data is included in the second area. (YES in step S506). When the offset 2 is equal to or smaller than the size of the first region reserved for the read target handle, the read determination unit 25 determines that at least a part of the read target data is included in the first region (NO in step S506). ..

ステップS506でNOの場合、読み込み判定部25は、読み込み対象領域の一部が第2領域に含まれるかを判定する(ステップS507)。読み込み判定部25は、offset2と読み込み対象データサイズを加算した値が第1領域のサイズ以下である場合、読み込み末尾アドレスが第1領域に含まれるので、読み込み対象データが第1領域にのみ記憶されていると判定する(ステップS507でNO)。読み込み判定部25は、offset2と読み込み対象データサイズを加算した値が第1領域のサイズより大きい場合、読み込み末尾アドレスが第2領域に含まれるので、読み込み対象領域の一部が第2領域に含まれると判定する(ステップS507でYES)。 If NO in step S506, the read determination unit 25 determines whether a part of the read target area is included in the second area (step S507). When the value obtained by adding offset2 and the read target data size is equal to or less than the size of the first area, the read determination unit 25 includes the read end address in the first area, so that the read target data is stored only in the first area. (NO in step S507). When the value obtained by adding offset2 and the read target data size is larger than the size of the first area, the read determination unit 25 includes the read end address in the second area, so that a part of the read target area is included in the second area. (YES in step S507).

ステップS507でNOの場合、メモリ読み込み監視処理が終了する。すなわち、読み込み指示部26からOS11へ指示を出力せず、OS11は、アプリケーション15からの命令に基づいて、読み込み処理を実行する。 If NO in step S507, the memory read monitoring process ends. That is, the reading instruction unit 26 does not output an instruction to the OS 11, and the OS 11 executes the reading process based on the instruction from the application 15.

ステップS507でYESの場合、読み込み指示部26は、読み込み先頭アドレスから第1領域の末尾のアドレスまでデータを読み込むことをOS11に指示する(ステップS508)。読み込み指示部26は、例えば、第1領域の末尾のアドレスを第1領域管理テーブルのbaseアドレスとサイズを加算することにより算出し、ステップS508の処理に用いる。 If YES in step S507, the read instruction unit 26 instructs the OS 11 to read data from the read start address to the end address of the first region (step S508). The read instruction unit 26 calculates, for example, the address at the end of the first area by adding the base address and the size of the first area management table, and uses it in the process of step S508.

そして、読み込み指示部26は、第2領域の先頭アドレスから、読み込み残データを読み込むことをOS11に指示する(ステップS509)。読み込み指示部26は、例えば、第2領域の先頭アドレスと読み込み残データサイズをOS11に指示する。読み込み残データサイズは、読み込み対象データサイズから、第1領域で読み込むサイズを減算した値である。読み込み指示部26は、例えば、第1領域管理テーブルのリンクIDと第2領域管理テーブルのリンクIDに基づいて、第1領域に対応する第2領域を特定する。そして、読み込み指示部26は、第2領域管理テーブルから、その第2領域の先頭アドレス(Baseアドレス)を取得し、ステップS509の処理に用いる。 Then, the read instruction unit 26 instructs the OS 11 to read the read residual data from the start address of the second area (step S509). The read instruction unit 26 instructs the OS 11, for example, the start address of the second area and the read remaining data size. The read remaining data size is a value obtained by subtracting the size to be read in the first area from the read target data size. The read instruction unit 26 identifies a second area corresponding to the first area based on, for example, the link ID of the first area management table and the link ID of the second area management table. Then, the read instruction unit 26 acquires the start address (base address) of the second area from the second area management table and uses it for the process of step S509.

OS11は、読み込み指示部26からの指示に基づいて、読み込み対象データの読み込みを行う。 The OS 11 reads the data to be read based on the instruction from the read instruction unit 26.

出力部27は、第2領域からのデータの読み込みに関する情報を出力する(ステップS510)。出力部27は、例えば、図9に示す情報を生成して、表示装置2に出力する、または所定の領域に記憶する。 The output unit 27 outputs information regarding reading of data from the second area (step S510). For example, the output unit 27 generates the information shown in FIG. 9 and outputs it to the display device 2 or stores it in a predetermined area.

ステップS506でYESの場合、読み込み指示部26は、第2領域内における新たな読み込み先頭アドレスから読み込み対象データを読み込むことOS11に指示する(図15のステップS511)。読み込み判定部25は、新たな読み込み先頭アドレスを下記式により算出して、ステップS511の処理に用いる。
新たな読み込み先頭アドレス=offset2-第1領域のサイズ+第2領域のbaseアドレス
If YES in step S506, the read instruction unit 26 instructs the OS 11 to read the data to be read from the new read start address in the second area (step S511 in FIG. 15). The read determination unit 25 calculates a new read start address by the following formula and uses it for the process of step S511.
New read start address = offset2-size of first area + base address of second area

読み込み指示部26は、例えば、第1領域管理テーブルのリンクIDと第2領域管理テーブルのリンクIDに基づいて、第1領域に対応する第2領域を特定する。そして、読み込み指示部26は、第2領域管理テーブルから、その第2領域のBaseアドレスを取得し、上記式に用いる。 The read instruction unit 26 identifies a second area corresponding to the first area based on, for example, the link ID of the first area management table and the link ID of the second area management table. Then, the read instruction unit 26 acquires the Base address of the second area from the second area management table and uses it in the above equation.

OS11は、読み込み指示部26からの指示に基づいて、読み込み対象データの読み込みを行う。 The OS 11 reads the data to be read based on the instruction from the read instruction unit 26.

読み込み指示部26は、ステップS511において、例えば、読み込み先頭アドレスが記憶されていたレジスタの値を、新たな読み込み先頭アドレスに書き換えてもよい。 In step S511, the read instruction unit 26 may, for example, rewrite the value of the register in which the read start address is stored to a new read start address.

出力部27は、第2領域からのデータの読み込みに関する情報を出力する(ステップS512)。出力部27は、例えば、図9に示す情報を生成して、表示装置2に出力する、または所定の領域に記憶する。 The output unit 27 outputs information regarding reading of data from the second area (step S512). For example, the output unit 27 generates the information shown in FIG. 9 and outputs it to the display device 2 or stores it in a predetermined area.

以上のように、読み込み指示部26は、読み込み対象領域の少なくとも一部が第2領域に含まれる場合、OS11に読み込み対象領域を示し、読み込みを行う指示を送る。書き込み監視処理において第2領域管理テーブルが記録されているため、読み込み指示部26は、読み込み対象領域が第2領域を含む場合であっても、適切な領域をOS11に指示することができる。 As described above, when at least a part of the read target area is included in the second area, the read instruction unit 26 indicates the read target area to the OS 11 and sends an instruction to read. Since the second area management table is recorded in the write monitoring process, the read instruction unit 26 can instruct the OS 11 of an appropriate area even when the read target area includes the second area.

以下、実施例について説明する。
図16は、実施例における監視対象アプリケーションに用いられるソースコードである。図16に示すソースコードは、C言語で記述されているが、監視対象アプリケーションに用いられるソースコードは、他のプログラミング言語で記述されていてもよい。なお、図16に示すソースコードは、監視対象アプリケーションに用いられるソースコードの一部である。また、図16に示す「//メモリ確保」、「//メモリ書き込み」、および「//メモリ読み込み」は、処理内容を説明するためのコメントであり、コンパイルの際にスキップされる。
Hereinafter, examples will be described.
FIG. 16 is a source code used for the monitored application in the embodiment. The source code shown in FIG. 16 is written in C language, but the source code used for the monitored application may be written in another programming language. The source code shown in FIG. 16 is a part of the source code used for the monitored application. Further, "// memory allocation", "// memory write", and "// memory read" shown in FIG. 16 are comments for explaining the processing contents and are skipped at the time of compilation.

本実施例では、監視対象アプリケーションが、メモリ確保処理において、ハンドル「g_hMem100」、「g_hMem200」、および「g_hMem300」を用いてそれぞれ100byteのメモリを確保する(1-1、1-2、1-3)。 In this embodiment, the monitored application allocates 100 bytes of memory by using the handles "g_hMem100", "g_hMem200", and "g_hMem300" in the memory allocation process (1-1, 1-2, 1-3). ).

また、監視対象アプリケーションは、メモリ書き込み処理において、ハンドル「g_hMem100」に対応するメモリに300byteのデータを書き込む(1-4)。また、監視対象アプリケーションは、ハンドル「g_hMem200」に対応するメモリに250byteのデータを書き込む(1-5)。 Further, the monitored application writes 300 bytes of data to the memory corresponding to the handle "g_hMem100" in the memory write process (1-4). Further, the monitored application writes 250 bytes of data in the memory corresponding to the handle “g_hMem200” (1-5).

また、監視対象アプリケーションは、メモリ読み込み処理において、ハンドル「g_hMem100」に対応する第1領域のBaseアドレスに280を加算したアドレスから10byteのデータを読み込む(1-6)。監視対象アプリケーションは、メモリ読み込み処理において、ハンドル「g_hMem200」に対応する第1領域のBaseアドレスに180を加算したアドレスから30byteのデータを読み込む(1-7)。 Further, in the memory reading process, the monitored application reads 10 bytes of data from the address obtained by adding 280 to the Base address of the first area corresponding to the handle "g_hMem100" (1-6). In the memory read process, the monitored application reads 30 bytes of data from the address obtained by adding 180 to the Base address of the first area corresponding to the handle "g_hMem200" (1-7).

図17は、実施例におけるメモリ確保処理に関するアセンブラコードを示す図である。図17に示すソースコードは、アセンブラ解析により得られたコードであり、図16の1-1、1-2、および1-3に対応している。「rax」は、メモリ確保の際に用いられるレジスタの一例であり、他のレジスタが用いられてもよい。なお、図17に示すソースコードは、メモリ確保処理に関する全ソースコードではなく、一部のソースコードが省略されている。 FIG. 17 is a diagram showing an assembler code related to the memory allocation process in the embodiment. The source code shown in FIG. 17 is the code obtained by the assembler analysis, and corresponds to 1-1, 1-2, and 1-3 of FIG. “Rax” is an example of a register used for allocating memory, and other registers may be used. In the source code shown in FIG. 17, some source codes are omitted, not all source codes related to the memory allocation process.

図18は、実施例のメモリ確保処理におけるトレーステーブルを示す図である。記録部22は、図17の2-1に示す処理が行われた際に、図18(a)に示すように、ハンドル名「g_hMem100」とレジスタ名「rax」とを対応付けて記録する。 FIG. 18 is a diagram showing a trace table in the memory allocation process of the embodiment. When the process shown in 2-1 of FIG. 17 is performed, the recording unit 22 records the handle name “g_hMem100” and the register name “rax” in association with each other, as shown in FIG. 18A.

記録部22は、図17の2-2に示す処理が行われた際に、図18(b)に示すように、ハンドル名「g_hMem200」とレジスタ名「rax」とを対応付けて記録する。また、記録部22は、ハンドル「g_hMem100」に対応付けられたレジスタ名「rax」を削除する。 When the process shown in 2-2 of FIG. 17 is performed, the recording unit 22 records the handle name “g_hMem200” and the register name “rax” in association with each other, as shown in FIG. 18B. Further, the recording unit 22 deletes the register name “rax” associated with the handle “g_hMem100”.

記録部22は、図17の2-3に示す処理が行われた際に、図18(c)に示すように、ハンドル名「g_hMem300」とレジスタ名「rax」とを対応付けて記録する。また、記録部22は、ハンドル名「g_hMem200」に対応付けられたレジスタ名「rax」を削除する。 When the process shown in 2-3 of FIG. 17 is performed, the recording unit 22 records the handle name “g_hMem300” and the register name “rax” in association with each other, as shown in FIG. 18 (c). Further, the recording unit 22 deletes the register name "rax" associated with the handle name "g_hMem200".

図19は、実施例における第1領域管理テーブルを示す図である。図16、図17に示すプログラムによりメモリ確保が実行された場合に、記録部22は、図19に示す第1領域管理テーブルを記録する。なお、図19に示す例では、説明を容易にするために、Baseアドレスとして、16進数によるアドレスではなく所定アドレスからの距離を10進数で示したアドレスを用いている。例えば、「Addr100」は、所定アドレスからの距離が100byteであるアドレスを示す。例えば、「Addr200」は、所定アドレスからの距離が200byteであるアドレスを示す。例えば、「Addr300」は、所定アドレスからの距離が300byteであるアドレスを示す。 FIG. 19 is a diagram showing a first area management table in the embodiment. When the memory allocation is executed by the program shown in FIGS. 16 and 17, the recording unit 22 records the first area management table shown in FIG. In the example shown in FIG. 19, for ease of explanation, an address showing the distance from a predetermined address in decimal is used as the Base address instead of the address in hexadecimal. For example, "Addr100" indicates an address whose distance from a predetermined address is 100 bytes. For example, "Addr200" indicates an address whose distance from a predetermined address is 200 bytes. For example, "Addr300" indicates an address whose distance from a predetermined address is 300 bytes.

図20は、実施例における確保されたメモリ領域を示す図である。図20に示す「第1領域A」は、ハンドル「g_hMem100」に対応する第1領域である。「第1領域B」は、ハンドル「g_hMem200」に対応する第1領域である。「第1領域C」は、ハンドル「g_hMem300」に対応する第1領域である。 FIG. 20 is a diagram showing a reserved memory area in the embodiment. The “first region A” shown in FIG. 20 is the first region corresponding to the handle “g_hMem100”. The "first region B" is the first region corresponding to the handle "g_hMem200". The "first region C" is the first region corresponding to the handle "g_hMem300".

図21は、実施例におけるメモリ書き込み処理に関するアセンブラコードを示す図である。図21に示すソースコードは、アセンブラ解析により得られたコードであり、図16の1-4、1-5に対応している。なお、図21に示すソースコードは、メモリ書き込み処理に関する全ソースコードではなく、一部のソースコードが省略されている。例えば、図21に示すソースコードでは、「Func writemem」の後に、書き込み先頭アドレスに書き込み対象データサイズを加算した値をレジスタrcxに書き込むコードが記述されているとするが、図示を省略している。 FIG. 21 is a diagram showing an assembler code related to the memory writing process in the embodiment. The source code shown in FIG. 21 is the code obtained by the assembler analysis and corresponds to 1-4 and 1-5 of FIG. In the source code shown in FIG. 21, some source codes are omitted, not all source codes related to the memory writing process. For example, in the source code shown in FIG. 21, it is assumed that a code for writing the value obtained by adding the data size to be written to the write start address to the register rcx is described after "Func writemem", but the illustration is omitted. ..

図22は、実施例のメモリ書き込み処理におけるトレーステーブルを示す図である。記録部22は、図21の3-1に示す処理が行われた際に、図22(a)に示すように、ハンドル名「g_hMem100」とレジスタ名「rcx」とを対応付けて記録する。そして、rcxに、書き込み先頭アドレスに書き込み対象データサイズを加算した値「400」が書き込まれたとする。書き込み判定部23は、図21の3-3に示す処理が行われた際に、第1領域管理テーブルにおいて「g_hMem100」に対応付けられたレジスタrcxの値を取得する。 FIG. 22 is a diagram showing a trace table in the memory writing process of the embodiment. When the process shown in 3-1 of FIG. 21 is performed, the recording unit 22 records the handle name “g_hMem100” and the register name “rcx” in association with each other, as shown in FIG. 22 (a). Then, it is assumed that the value "400" obtained by adding the write target data size to the write start address is written in rcx. The write determination unit 23 acquires the value of the register rcx associated with "g_hMem100" in the first area management table when the process shown in 3-3 of FIG. 21 is performed.

書き込み判定部23は、取得したレジスタrcxの値と、第1領域管理テーブルにおいてg_hMem100に対応付けられているBaseアドレスとの差分であるoffset1を以下のように算出する。
offset1=400-100=300
The write determination unit 23 calculates offset1, which is the difference between the acquired register rcx value and the Base address associated with g_hMem100 in the first area management table, as follows.
offset1 = 400-100 = 300

offset1は、書き込み対象ハンドルのサイズである100より大きいため、書き込み判定部23は、書き込み対象データを第1領域内に書き込み可能ではないと判定する。 Since the offset 1 is larger than 100, which is the size of the write target handle, the write determination unit 23 determines that the write target data cannot be written in the first area.

書き込み指示部24は、offset1から書き込み対象ハンドルの第1領域のサイズである「100byte」を減算したサイズ「200byte」の第2領域を新たに確保することをOS11に指示する。さらに、書き込み指示部24は、書き込み対象データの一部分を第1領域に書き込み、残りの部分を第2領域に書き込むことを、OS11に指示する。 The write instruction unit 24 instructs the OS 11 to newly secure a second area having a size of "200 bytes" obtained by subtracting "100 bytes", which is the size of the first area of the write target handle, from offset1. Further, the write instruction unit 24 instructs the OS 11 to write a part of the data to be written to the first area and write the remaining part to the second area.

記録部22は、図21の3-2に示す処理が行われた際に、図22(b)に示すように、書き込み対象ハンドル「g_hMem200」とレジスタ名「rcx」とを対応付けて記録する。また、記録部22は、書き込み対象ハンドル「g_hMem100」に対応付けられたレジスタrcxを削除する。そして、レジスタ「rcx」に、書き込み先頭アドレスに書き込み対象データサイズを加算した値「450」が書き込まれたとする。書き込み判定部23は、図21の3-3に示す処理が行われた際に、第1領域管理テーブルにおいて書き込み対象ハンドル「g_hMem200」に対応付けられたレジスタ「rcx」の値を取得する。 When the process shown in 3-2 of FIG. 21 is performed, the recording unit 22 records the write target handle “g_hMem200” and the register name “rcx” in association with each other, as shown in FIG. 22 (b). .. Further, the recording unit 22 deletes the register rcx associated with the write target handle “g_hMem100”. Then, it is assumed that the value "450" obtained by adding the write target data size to the write start address is written in the register "rcx". The write determination unit 23 acquires the value of the register “rcx” associated with the write target handle “g_hMem200” in the first area management table when the process shown in 3-3 of FIG. 21 is performed.

書き込み判定部23は、取得したレジスタ「rcx」の値と、第1領域管理テーブルにおいてハンドル「g_hMem200」に対応付けられているBaseアドレスとの差分であるoffset1を以下のように算出する。
offset1=450-200=250
The write determination unit 23 calculates offset1, which is the difference between the acquired value of the register “rcx” and the Base address associated with the handle “g_hMem200” in the first area management table, as follows.
offset1 = 450-200 = 250

offset1は、書き込み対象ハンドルの第1領域のサイズである100より大きいため、書き込み判定部23は、書き込み対象データを第1領域内に書き込み可能ではないと判定する。 Since the offset 1 is larger than 100, which is the size of the first area of the write target handle, the write determination unit 23 determines that the write target data cannot be written in the first area.

書き込み指示部24は、offset1から書き込み対象ハンドルのサイズを減算したサイズ「150byte」の第2領域を新たに確保することをOS11に指示する。さらに、書き込み指示部24は、書き込み対象データの一部分を第1領域に書き込み、残りの部分を第2領域に書き込むことを、OS11に指示する。 The write instruction unit 24 instructs the OS 11 to newly secure a second area of the size "150 bytes" obtained by subtracting the size of the write target handle from offset1. Further, the write instruction unit 24 instructs the OS 11 to write a part of the data to be written to the first area and write the remaining part to the second area.

図23は、実施例における書き込み処理後の第2領域管理テーブルと第1領域管理テーブルとを示す図である。図23(a)は、図16、図21に示すプログラムによりデータ書き込みが実行された際に、記録部22が作成する第2領域管理テーブルである。図23(b)は、図16、図21に示すプログラムによりデータ書き込みが実行された際に、記録部22が更新する第1領域管理テーブルである。 FIG. 23 is a diagram showing a second area management table and a first area management table after the writing process in the embodiment. FIG. 23A is a second area management table created by the recording unit 22 when data writing is executed by the program shown in FIGS. 16 and 21. FIG. 23B is a first area management table updated by the recording unit 22 when data writing is executed by the program shown in FIGS. 16 and 21.

上述のように、書き込み指示部24は、書き込み対象ハンドル「g_hMem100」による書き込み処理において、第2領域を確保することをOS11に指示する。そして、記録部22は、書き込み対象ハンドル「g_hMem100」に対応する第2領域を示す情報として、リンクID「ID_A」、Baseアドレス「Addr1000」、およびサイズ「200」をそれぞれ記録する。 As described above, the write instruction unit 24 instructs the OS 11 to secure a second area in the write process by the write target handle “g_hMem100”. Then, the recording unit 22 records the link ID “ID_A”, the Base address “Addr1000”, and the size “200” as information indicating the second area corresponding to the write target handle “g_hMem100”.

記録部22は、第1領域管理テーブルに書き込み対象ハンドル「g_hMem100」と対応付けて、第2領域管理テーブルに記録したリンクIDと同じリンクID「ID_A」を記録する。 The recording unit 22 records the same link ID “ID_A” as the link ID recorded in the second area management table in association with the write target handle “g_hMem100” in the first area management table.

また、書き込み指示部24は、書き込み対象ハンドル「g_hMem200」による書き込み処理において、第2領域を確保することをOS11に指示する。そして、記録部22は、書き込み対象ハンドル「g_hMem200」に対応する第2領域を示す情報として、リンクID「ID_B」、第2領域のBaseアドレス「Addr1200」、サイズ「150」をそれぞれ記録する。 Further, the write instruction unit 24 instructs the OS 11 to secure a second area in the write process by the write target handle “g_hMem200”. Then, the recording unit 22 records the link ID “ID_B”, the Base address “Addr1200” of the second area, and the size “150” as information indicating the second area corresponding to the write target handle “g_hMem200”.

そして、記録部22は、第1領域管理テーブルにおいて、書き込み対象ハンドル「g_hMem200」と対応付けて、第2領域管理テーブルのリンクIDと同じリンクID「ID_B」を記録する。 Then, the recording unit 22 records the same link ID “ID_B” as the link ID of the second area management table in association with the write target handle “g_hMem200” in the first area management table.

図24は、実施例におけるメモリ領域の拡張方法を示す図である。本実施例では、ハンドル「g_hMem100」に対応する第1領域Aと、新たに確保された第2領域Aとが対応している。すなわち、書き込み処理において、第1領域Aが拡張されて、ハンドル「g_hMem100」に第1領域Aおよび第2領域Aが対応した状態となる。また、本実施例では、ハンドル「g_hMem200」に対応する第1領域Bと、新たに確保された第2領域Bとが対応している。すなわち、書き込み処理において、第1領域Bが拡張されて、ハンドル「g_hMem200」に第1領域Bおよび第2領域Bが対応した状態となる。 FIG. 24 is a diagram showing a method of expanding the memory area in the embodiment. In this embodiment, the first region A corresponding to the handle “g_hMem100” and the newly secured second region A correspond to each other. That is, in the writing process, the first area A is expanded so that the first area A and the second area A correspond to the handle “g_hMem100”. Further, in this embodiment, the first region B corresponding to the handle “g_hMem200” and the newly secured second region B correspond to each other. That is, in the writing process, the first area B is expanded so that the first area B and the second area B correspond to the handle “g_hMem200”.

図25は、実施例におけるメモリ読み込み処理に関するアセンブラコードである。図25に示すソースコードは、アセンブラ解析により得られたコードであり、図16の1-6および1-7に対応している。なお、図25に示すソースコードは、メモリ読み込み処理に関する全ソースコードではなく、一部のソースコードが省略されている。 FIG. 25 is an assembler code relating to the memory reading process in the embodiment. The source code shown in FIG. 25 is the code obtained by the assembler analysis and corresponds to 1-6 and 1-7 of FIG. In the source code shown in FIG. 25, not all the source code related to the memory reading process but a part of the source code is omitted.

図26は、実施例のメモリ読み込み処理におけるトレーステーブルを示す図である。記録部22は、図25の4-1に示す処理が行われた際に、図26(a)に示すように、ハンドル「g_hMem100」とレジスタ名「rcx」を対応付けて記録する。そして、レジスタ「rcx」に、読み込み先頭アドレスを示す値「Addr380」が書き込まれたとする。 FIG. 26 is a diagram showing a trace table in the memory reading process of the embodiment. When the process shown in 4-1 of FIG. 25 is performed, the recording unit 22 records the handle “g_hMem100” and the register name “rcx” in association with each other, as shown in FIG. 26 (a). Then, it is assumed that the value "Addr380" indicating the read start address is written in the register "rcx".

読み込み判定部25は、図25の4-3に示す処理が行われた際に、トレーステーブルから、読み込み対象ハンドル「g_hMem100」に対応付けられたレジスタ名「rcx」を特定する。そして、読み込み判定部25は、レジスタ「rcx」に記憶されている読み込み先頭アドレス「Addr380」を取得する。読み込み判定部25は、図25の4-4に示す処理が行われた際に、読み込み対象データサイズが記憶されたレジスタr8を特定し、r8から読み込み対象データサイズ「10」を取得する。 The read determination unit 25 identifies the register name “rcx” associated with the read target handle “g_hMem100” from the trace table when the process shown in 4-3 of FIG. 25 is performed. Then, the read determination unit 25 acquires the read start address “Addr380” stored in the register “rcx”. When the process shown in 4-4 of FIG. 25 is performed, the read determination unit 25 identifies the register r8 in which the read target data size is stored, and acquires the read target data size “10” from r8.

読み込み判定部25は、下記の式により、offset2を算出する。
offset2=読み込み先頭アドレス-読み込み対象ハンドルのbaseアドレス=380-100=280
The read determination unit 25 calculates offset2 by the following formula.
offset2 = read start address-base address of read target handle = 380-100 = 280

算出されたoffset2は、読み込み対象ハンドルについて確保された第1領域のサイズより大きいため、読み込み判定部25は、読み込み対象領域の全範囲が第2領域に含まれていると判定する。 Since the calculated offset 2 is larger than the size of the first area reserved for the read target handle, the read determination unit 25 determines that the entire range of the read target area is included in the second area.

読み込み指示部26は、第2領域内における新たな読み込み先頭アドレスから読み込み対象データを取得することOS11に指示する。読み込み判定部25は、新たな読み込み先頭アドレスを下記式により算出する。
新たな読み込み先頭アドレス=offset2-第1領域サイズ+第2領域のbaseアドレス=280-100+1000=1180(Addr1180)
The read instruction unit 26 instructs the OS 11 to acquire the read target data from the new read start address in the second area. The read determination unit 25 calculates a new read start address by the following formula.
New read start address = offset2-first area size + second area base address = 280-100 + 1000 = 1180 (Addr1180)

また、記録部22は、図21の4-2に示す処理が行われた際に、図26(b)に示すように、ハンドル「g_hMem200」とレジスタ名「rcx」を対応付けて記録する。記録部22は、ハンドル「g_hMem100」に対応付けられていたレジスタ名「rcx」を削除する。そして、レジスタrcxに、読み込み先頭アドレスを示す値「Addr280」が書き込まれたとする。 Further, when the process shown in 4-2 of FIG. 21 is performed, the recording unit 22 records the handle “g_hMem200” and the register name “rcx” in association with each other, as shown in FIG. 26B. The recording unit 22 deletes the register name “rcx” associated with the handle “g_hMem100”. Then, it is assumed that the value "Addr280" indicating the read start address is written in the register rcx.

読み込み判定部25は、図25の4-3に示す処理が行われた際に、トレーステーブルから、読み込み対象ハンドル「g_hMem200」に対応付けられたレジスタ名「rcx」を特定し、rcxに記憶されている読み込み先頭アドレス「Addr280」を取得する。読み込み判定部25は、図25の4-4に示す処理が行われた際に、読み込み対象データサイズが記憶されたレジスタr8を特定し、r8から読み込み対象データサイズ「30」を取得する。 When the process shown in 4-3 of FIG. 25 is performed, the read determination unit 25 identifies the register name “rcx” associated with the read target handle “g_hMem200” from the trace table and stores it in the rcx. Acquires the read start address "Addr280". When the process shown in 4-4 of FIG. 25 is performed, the read determination unit 25 identifies the register r8 in which the read target data size is stored, and acquires the read target data size “30” from r8.

読み込み判定部25は、下記の式により、offset2を算出する。
offset2=読み込み先頭アドレス-読み込み対象ハンドルのbaseアドレス=280-200=80
The read determination unit 25 calculates offset2 by the following formula.
offset2 = read start address-base address of read target handle = 280-200 = 80

算出されたoffset2「80」は、第1領域のサイズ「100」より小さい。また、offset2と読み込み対象データサイズを加算した値「110」(80+30)が第1領域のサイズ「100」より大きい。よって、読み込み判定部25は、読み込み対象領域の一部が第2領域に含まれていると判定する。 The calculated offset2 "80" is smaller than the size "100" of the first region. Further, the value "110" (80 + 30), which is the sum of offset2 and the data size to be read, is larger than the size "100" of the first region. Therefore, the read determination unit 25 determines that a part of the read target area is included in the second area.

読み込み指示部26は、読み込み先頭アドレス「Addr280」から第1領域の末尾のアドレス「300」までデータを読み込むことをOS11に指示する。 The read instruction unit 26 instructs the OS 11 to read data from the read start address "Addr280" to the end address "300" of the first area.

読み込み指示部26は、第1領域管理テーブルにおいて読み込み対象ハンドル「g_hMem200」に対応するリンクID「ID_B」を参照し、第2領域管理テーブルでリンクID「ID_B」に対応するBaseアドレス「Addr1200」を取得する。そして、読み込み指示部26は、第2領域管理テーブルから取得した第2領域のBaseアドレス「Addr1200」から、読み込み残データを読み込むことをOS11に指示する。読み込み残データサイズは、読み込み対象データサイズ「30」から、第1領域で読み込むサイズ「20」を減算した値「10」である。よって、読み込み指示部26は、例えば、第2領域の先頭アドレス「Addr1200」と読み込み残データサイズ「10」をOS11に指示する。 The read instruction unit 26 refers to the link ID "ID_B" corresponding to the read target handle "g_hMem200" in the first area management table, and sets the Base address "Addr1200" corresponding to the link ID "ID_B" in the second area management table. get. Then, the read instruction unit 26 instructs the OS 11 to read the read residual data from the Base address "Addr1200" of the second area acquired from the second area management table. The read remaining data size is a value "10" obtained by subtracting the size "20" to be read in the first area from the read target data size "30". Therefore, the read instruction unit 26 instructs the OS 11, for example, the start address “Addr1200” of the second region and the read remaining data size “10”.

図27は、実施例の読み込み処理におけるメモリ領域を示す図である。図27において、「a」は、ハンドル「g_hMem100」による読み込みが行われる領域である。上述のように、読み込み指示部26の指示により、OS11は、新たな読み込み先頭アドレス「Addr1180」からサイズ「10」のデータを読み込む。 FIG. 27 is a diagram showing a memory area in the reading process of the embodiment. In FIG. 27, “a” is an area where reading is performed by the handle “g_hMem100”. As described above, according to the instruction of the read instruction unit 26, the OS 11 reads the data of the size "10" from the new read start address "Addr1180".

なお、図27に示す「a’」は、読み込み命令における読み込み先頭アドレスが、「Addr380」であり、本実施形態の読み込み処理を行わなかった場合に読み込まれる領域である。監視対象アプリケーションからの命令には、第2領域に読み込み対象データが書き込まれていることが考慮されていない。よって、本実施形態の読み込み処理を行わなかった場合、図27の「a’」のように、実際の読み込み対象データが記憶された領域とは異なる領域から読み込みが行われるおそれがある。 Note that "a'" shown in FIG. 27 is an area where the read start address in the read command is "Addr380" and is read when the read process of the present embodiment is not performed. The instruction from the monitored application does not consider that the read target data is written in the second area. Therefore, if the reading process of the present embodiment is not performed, the reading may be performed from an area different from the area in which the actual reading target data is stored, as shown in "a'" in FIG. 27.

また、例えば、読み込み命令における読み込み先頭アドレスの指定が、「Addr100+80」、「Addr200+80」、または「Addr300+80」であった場合、本実施形態の読み込み処理を行わなかった場合に読み込まれる領域は同じである。しかし、第2領域の確保が行われている場合、実際の読み込み対象データが記憶された領域は異なる可能性がある。 Further, for example, when the designation of the read start address in the read command is "Addr100 + 80", "Addr200 + 80", or "Addr300 + 80", the area to be read is the same when the read process of the present embodiment is not performed. .. However, when the second area is secured, the area in which the actual read target data is stored may be different.

図27において、「b1」および「b2」は、ハンドル「g_hMem200」による読み込みが行われる領域である。読み込み指示部26は、読み込み先頭アドレス「Addr280」から第1領域の末尾のアドレス「Addr300」まで領域「b1」を読み込むことをOS11に指示する。さらに、読み込み指示部26は、第2領域管理テーブルから取得した第2領域の先頭アドレス「Addr1200」から、読み込み残データサイズ「10」の領域「b2」を読み込むことをOS11に指示する。そして、OS11は、図27に示す「b1」および「b2」から、データの読み込みを行う。 In FIG. 27, “b1” and “b2” are areas where reading is performed by the handle “g_hMem200”. The read instruction unit 26 instructs the OS 11 to read the area "b1" from the read start address "Addr280" to the address "Addr300" at the end of the first area. Further, the read instruction unit 26 instructs the OS 11 to read the area “b2” having the remaining read data size “10” from the start address “Addr1200” of the second area acquired from the second area management table. Then, the OS 11 reads data from "b1" and "b2" shown in FIG. 27.

なお、上述の処理において、メモリ管理部12は、OS11によりレジスタに記憶された各種アドレスやデータサイズ等を取得するが、そのような例には限られない。例えば、メモリ管理部12は、アプリケーション15からOSに送られるコマンドを参照することにより各種アドレスやデータサイズ等を取得してもよい。すなわち、レジスタに各種アドレスやデータサイズ等が記憶されていない場合でも、メモリ管理部12は、各種アドレスやデータサイズ等を取得することができる。 In the above processing, the memory management unit 12 acquires various addresses, data sizes, and the like stored in the registers by the OS 11, but is not limited to such an example. For example, the memory management unit 12 may acquire various addresses, data sizes, and the like by referring to a command sent from the application 15 to the OS. That is, even when various addresses, data sizes, and the like are not stored in the registers, the memory management unit 12 can acquire various addresses, data sizes, and the like.

次に、情報処理装置1のハードウェア構成の一例を説明する。
図28は、情報処理装置1のハードウェア構成の一例を示す図である。図28の例に示すように、情報処理装置1において、バス100に、プロセッサ111とメモリ112と補助記憶装置113と通信インタフェース114と媒体接続部115と入力装置116と出力装置117とが接続される。
Next, an example of the hardware configuration of the information processing apparatus 1 will be described.
FIG. 28 is a diagram showing an example of the hardware configuration of the information processing apparatus 1. As shown in the example of FIG. 28, in the information processing device 1, the processor 111, the memory 112, the auxiliary storage device 113, the communication interface 114, the medium connection unit 115, the input device 116, and the output device 117 are connected to the bus 100. To.

プロセッサ111は、メモリ112に展開されたプログラムを実行する。実行されるプログラムには、実施形態における処理を行うメモリ管理プログラムが適用されてもよい。本実施形態における「レジスタ」は、例えば、プロセッサ111内の記憶回路であってもよい。 The processor 111 executes the program expanded in the memory 112. A memory management program that performs processing in the embodiment may be applied to the program to be executed. The "register" in this embodiment may be, for example, a storage circuit in the processor 111.

メモリ112は、例えば、Random Access Memory(RAM)である。本実施形態における「メモリ」には、図28におけるメモリ112が適用される。 The memory 112 is, for example, a Random Access Memory (RAM). The memory 112 in FIG. 28 is applied to the “memory” in the present embodiment.

補助記憶装置113は、種々の情報を記憶する記憶装置であり、例えばハードディスクドライブや半導体メモリ等が適用されてもよい。補助記憶装置113に実施形態の処理を行うメモリ管理プログラムが記憶されていてもよい。 The auxiliary storage device 113 is a storage device that stores various types of information, and for example, a hard disk drive, a semiconductor memory, or the like may be applied. The memory management program that performs the processing of the embodiment may be stored in the auxiliary storage device 113.

通信インタフェース114は、Local Area Network(LAN)、Wide Area Network(WAN)等の通信ネットワークに接続され、通信に伴うデータ変換等を行う。出力部27が他の情報処理装置等に情報を送信する場合、通信インタフェース114を介して、情報を送信する。 The communication interface 114 is connected to a communication network such as a Local Area Network (LAN) or Wide Area Network (WAN), and performs data conversion and the like associated with the communication. When the output unit 27 transmits information to another information processing device or the like, the information is transmitted via the communication interface 114.

媒体接続部115は、可搬型記録媒体118が接続可能なインタフェースである。可搬型記録媒体118には、光学式ディスク(例えば、Compact Disc(CD)やDigital Versatile Disc(DVD))、半導体メモリ等が適用されてもよい。可搬型記録媒体118に実施形態の処理を行うメモリ管理プログラムが記録されていてもよい。 The medium connection unit 115 is an interface to which the portable recording medium 118 can be connected. An optical disc (for example, Compact Disc (CD) or Digital Versatile Disc (DVD)), a semiconductor memory, or the like may be applied to the portable recording medium 118. A memory management program that performs the processing of the embodiment may be recorded on the portable recording medium 118.

入力装置116は、例えば、キーボード、ポインティングデバイス等であり、ユーザからの指示及び情報等の入力を受け付ける。 The input device 116 is, for example, a keyboard, a pointing device, or the like, and receives instructions and information input from the user.

出力装置117は、例えば、表示装置、プリンタ、スピーカ等であり、ユーザへの問い合わせ又は指示、及び処理結果等を出力する。図1に示す表示装置2には、図28に示す出力装置117が適用されてもよい。 The output device 117 is, for example, a display device, a printer, a speaker, or the like, and outputs an inquiry or instruction to a user, a processing result, or the like. The output device 117 shown in FIG. 28 may be applied to the display device 2 shown in FIG.

図1に示す管理情報記憶部13は、メモリ112、補助記憶装置113または可搬型記録媒体118等により実現されてもよい。図1に示すメモリ管理部12、および設定部14は、メモリ112に展開されたメモリ管理プログラムをプロセッサ111が実行することにより実現されてもよい。 The management information storage unit 13 shown in FIG. 1 may be realized by a memory 112, an auxiliary storage device 113, a portable recording medium 118, or the like. The memory management unit 12 and the setting unit 14 shown in FIG. 1 may be realized by the processor 111 executing the memory management program expanded in the memory 112.

メモリ112、補助記憶装置113および可搬型記録媒体118は、コンピュータが読み取り可能であって非一時的な有形の記憶媒体であり、信号搬送波のような一時的な媒体ではない。 The memory 112, the auxiliary storage 113, and the portable recording medium 118 are computer-readable and non-temporary tangible storage media, not temporary media such as signal carriers.

<その他>
本実施形態は、以上に述べた実施の形態に限定されるものではなく、本実施形態の要旨を逸脱しない範囲内で様々な変更、追加、省略が行われてもよい。
<Others>
The present embodiment is not limited to the embodiments described above, and various changes, additions, and omissions may be made without departing from the gist of the present embodiment.

1 情報処理装置
2 表示装置
11 OS
12 メモリ管理部
13 管理情報記憶部
14 設定部
15-1~15-n アプリケーション
21 検知部
22 記録部
23 書き込み判定部
24 書き込み指示部
25 読み込み判定部
26 読み込み指示部
27 出力部
100 バス
111 プロセッサ
112 メモリ
113 補助記憶装置
114 通信インタフェース
115 媒体接続部
116 入力装置
117 出力装置
118 可搬型記録媒体
1 Information processing device 2 Display device 11 OS
12 Memory management unit 13 Management information storage unit 14 Setting unit 15-1 to 15-n Application 21 Detection unit 22 Recording unit 23 Write judgment unit 24 Write instruction unit 25 Read judgment unit 26 Read instruction unit 27 Output unit 100 Bus 111 Processor 112 Memory 113 Auxiliary storage 114 Communication interface 115 Media connection 116 Input device 117 Output device 118 Portable recording medium

Claims (9)

コンピュータに、
メモリ内の第1領域を確保する命令を検知した場合、前記第1領域を示す情報を記録し、
前記第1領域へのデータの書き込み命令を検知した場合、前記書き込み命令と前記第1領域を示す情報とに基づいて、前記データを前記第1領域内に書き込み可能であるか判定し、
前記データを前記第1領域内に書き込み可能でないと判定した場合、前記メモリ内における前記第1領域とは異なる第2領域を確保し、前記データの一部分を前記第1領域に書き込み、前記データの残りの部分を前記第2領域に書き込む指示を出力する、
処理を実行させることを特徴とするメモリ管理プログラム。
On the computer
When an instruction to secure the first area in the memory is detected, the information indicating the first area is recorded.
When a command to write data to the first area is detected, it is determined whether or not the data can be written to the first area based on the write command and the information indicating the first area.
When it is determined that the data is not writable in the first area, a second area different from the first area is secured in the memory, and a part of the data is written in the first area to obtain the data. Outputs an instruction to write the remaining part to the second area.
A memory management program characterized by executing processing.
前記コンピュータに、
前記データを前記第1領域内に書き込み可能でないと判定した場合、前記第2領域を示す情報を、前記第1領域を示す情報に対応付けて記録する、
処理を実行させることを特徴とする請求項1記載のメモリ管理プログラム。
To the computer
When it is determined that the data is not writable in the first area, the information indicating the second area is recorded in association with the information indicating the first area.
The memory management program according to claim 1, wherein the process is executed.
前記コンピュータに、
前記データを前記第1領域内に書き込み可能でないと判定した場合、前記第2領域への前記データの書き込みに関する情報を出力する、
処理を実行させることを特徴とする請求項1または2に記載のメモリ管理プログラム。
To the computer
When it is determined that the data cannot be written in the first area, information regarding writing of the data to the second area is output.
The memory management program according to claim 1 or 2, wherein the process is executed.
前記コンピュータに、
前記書き込み命令を検知した場合、前記書き込み命令に含まれる書き込み先頭アドレスに前記データのサイズを加算した値と、前記第1領域の先頭アドレスとの差分が、前記第1領域のサイズより大きい場合、前記データを前記第1領域内に書き込み可能でないと判定する、
処理を実行させることを特徴とする請求項1乃至3のうち何れか1項に記載のメモリ管理プログラム。
To the computer
When the write command is detected, when the difference between the value obtained by adding the size of the data to the write start address included in the write command and the start address of the first area is larger than the size of the first area. It is determined that the data is not writable in the first area.
The memory management program according to any one of claims 1 to 3, wherein the process is executed.
前記コンピュータに、
前記メモリに書き込まれた前記データに対する読み込み命令を検知した場合、前記読み込み命令と、前記第1領域を示す情報とに基づいて、読み込み対象領域のうちの少なくとも一部が前記第2領域に含まれるかを判定し、
前記読み込み対象領域のうちの少なくとも一部が前記第2領域に含まれると判定した場合、前記データのうちの少なくとも一部を、前記第1領域を示す情報に対応付けられた前記第2領域を示す情報に基づいて特定した前記第2領域から読み込む指示を出力する、
処理を実行させることを特徴とする請求項2に記載のメモリ管理プログラム。
To the computer
When a read instruction for the data written in the memory is detected, at least a part of the read target area is included in the second area based on the read instruction and the information indicating the first area. Judging whether
When it is determined that at least a part of the read target area is included in the second area, at least a part of the data is associated with the information indicating the first area. Outputs an instruction to read from the second area specified based on the indicated information.
The memory management program according to claim 2, wherein the process is executed.
前記コンピュータに、
前記読み込み対象領域のうちの少なくとも一部が前記第2領域に含まれると判定した場合、前記第2領域からの前記データの読み込みに関する情報を出力する、
処理を実行させることを特徴とする請求項5に記載のメモリ管理プログラム。
To the computer
When it is determined that at least a part of the read target area is included in the second area, information regarding reading of the data from the second area is output.
The memory management program according to claim 5, wherein the process is executed.
前記コンピュータに、
前記読み込み命令を検知し、読み込み先頭アドレスから前記第1領域の先頭アドレスを減算した値が前記第1領域のサイズより大きい場合、前記読み込み対象領域の全範囲が前記第2領域に含まれると判定し、
前記読み込み先頭アドレスから前記第1領域の先頭アドレスを減算した値が前記第1領域のサイズ以下であり、かつ、前記読み込み先頭アドレスから前記第1領域の先頭アドレスを減算した値に読み込み対象データサイズを加算した値が、前記第1領域のサイズより大きい場合、前記読み込み対象領域の一部が前記第2領域に含まれると判定する、
処理を実行させることを特徴とする請求項5または6に記載のメモリ管理プログラム。
To the computer
When the read command is detected and the value obtained by subtracting the start address of the first area from the read start address is larger than the size of the first area, it is determined that the entire range of the read target area is included in the second area. death,
The value obtained by subtracting the start address of the first area from the read start address is equal to or less than the size of the first area, and the read target data size is obtained by subtracting the start address of the first area from the read start address. When the value obtained by adding the above is larger than the size of the first region, it is determined that a part of the read target region is included in the second region.
The memory management program according to claim 5 or 6, wherein the process is executed.
コンピュータが、
メモリ内の第1領域を確保する命令を検知した場合、前記第1領域を示す情報を記録し、
前記第1領域へのデータの書き込み命令を検知した場合、前記書き込み命令と前記第1領域を示す情報とに基づいて、前記データを前記第1領域内に書き込み可能であるか判定し、
前記データを前記第1領域内に書き込み可能でないと判定した場合、前記メモリ内における前記第1領域とは異なる第2領域を確保し、前記データの一部分を前記第1領域に書き込み、前記データの残りの部分を前記第2領域に書き込む指示を出力する、
処理を実行することを特徴とするメモリ管理方法。
The computer
When an instruction to secure the first area in the memory is detected, the information indicating the first area is recorded.
When a command to write data to the first area is detected, it is determined whether or not the data can be written to the first area based on the write command and the information indicating the first area.
When it is determined that the data is not writable in the first area, a second area different from the first area is secured in the memory, and a part of the data is written in the first area to obtain the data. Outputs an instruction to write the remaining part to the second area.
A memory management method characterized by performing processing.
メモリ内の第1領域を確保する命令が検知された場合、前記第1領域を示す情報を記録する記録部と、
前記第1領域へのデータの書き込み命令が検知された場合、前記書き込み命令と前記第1領域を示す情報とに基づいて、前記データを前記第1領域内に書き込み可能であるか判定する書き込み判定部と、
前記データを前記第1領域内に書き込み可能でないと判定された場合、前記メモリ内における前記第1領域とは異なる第2領域を確保し、前記データの一部分を前記第1領域に書き込み、前記データの残りの部分を前記第2領域に書き込む指示を出力する書き込み指示部と、
を備えることを特徴とするメモリ管理装置。
When an instruction to secure the first area in the memory is detected, a recording unit for recording information indicating the first area and a recording unit.
When a write command for data to the first area is detected, a write determination is made to determine whether the data can be written in the first area based on the write command and the information indicating the first area. Department and
When it is determined that the data cannot be written in the first area, a second area different from the first area is secured in the memory, a part of the data is written in the first area, and the data is written. A write instruction unit that outputs an instruction to write the remaining part of the data to the second area, and a write instruction unit.
A memory management device characterized by being equipped with.
JP2018019641A 2018-02-06 2018-02-06 Memory management program, memory management method, and memory management device Active JP7000892B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018019641A JP7000892B2 (en) 2018-02-06 2018-02-06 Memory management program, memory management method, and memory management device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018019641A JP7000892B2 (en) 2018-02-06 2018-02-06 Memory management program, memory management method, and memory management device

Publications (2)

Publication Number Publication Date
JP2019139330A JP2019139330A (en) 2019-08-22
JP7000892B2 true JP7000892B2 (en) 2022-01-19

Family

ID=67693931

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018019641A Active JP7000892B2 (en) 2018-02-06 2018-02-06 Memory management program, memory management method, and memory management device

Country Status (1)

Country Link
JP (1) JP7000892B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011221785A (en) 2010-04-09 2011-11-04 Seiko Epson Corp Information processor, memory management method and program
JP6222981B2 (en) 2013-05-10 2017-11-01 丸善製薬株式会社 Powder for powder cosmetic and powder cosmetic

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3391495B2 (en) * 1993-01-27 2003-03-31 大日本印刷株式会社 Method of managing memory area in IC card
JP2002055851A (en) * 2000-08-10 2002-02-20 Himacs Ltd Monitoring method for detecting unauthorized memory access in computer system, its program and recording medium therefor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011221785A (en) 2010-04-09 2011-11-04 Seiko Epson Corp Information processor, memory management method and program
JP6222981B2 (en) 2013-05-10 2017-11-01 丸善製薬株式会社 Powder for powder cosmetic and powder cosmetic

Also Published As

Publication number Publication date
JP2019139330A (en) 2019-08-22

Similar Documents

Publication Publication Date Title
US9111101B2 (en) Information processing apparatus capable of enabling selection of user data erase method, data processing method, and storage medium
JP2018128790A (en) Information processing apparatus, program and installation method
JP2014513338A5 (en) Method, computer readable storage medium and system for optimal compression of a virtual disk
US20110119662A1 (en) Method for updating firmware of embedded system
JP2007272763A (en) Module installation method and device
TWI450194B (en) Method and system for processing operating system, computer readable storage medium storing the method
JP7000892B2 (en) Memory management program, memory management method, and memory management device
US10430287B2 (en) Computer
JP2005352535A (en) Method of protecting data
US20040177183A1 (en) Interface circuit, disc controller, disc drive apparatus and interface control method
JP4064033B2 (en) Data backup device and program storage medium using a plurality of recording media
JP2007140628A (en) Information processor, imaging device, information processing method and computer program
JP5256247B2 (en) Software expiration date changing method and apparatus
JP5565187B2 (en) Information processing apparatus and interrupt control program
JP5868611B2 (en) Memory management apparatus and method considering user response time
JP4841371B2 (en) Computer system and its I / O space resource allocation method
WO2014091629A1 (en) Storage-device management program, and management method for electronic device and storage device
JP4471274B2 (en) How to boot OS from hard disk image file
KR102463847B1 (en) Method for monitoring task, and apparatus implementing the same method
US11061691B2 (en) Suppression of memory area fragmentation caused by booting an operating system
KR100939814B1 (en) Method of managing and writing log file for flash memory
US8869137B2 (en) Information processing apparatus that automatically and sequentially displays graphical user interface images and recording medium storing program
JP2011221785A (en) Information processor, memory management method and program
JP6163853B2 (en) Program and data conversion method
JP5125689B2 (en) Operation method and recording medium for multiple environments

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201110

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211118

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20211124

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20211207

R150 Certificate of patent or registration of utility model

Ref document number: 7000892

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150