KR101375142B1 - Method and apparatus for detecting resource leak after executing a user program - Google Patents

Method and apparatus for detecting resource leak after executing a user program Download PDF

Info

Publication number
KR101375142B1
KR101375142B1 KR1020120096269A KR20120096269A KR101375142B1 KR 101375142 B1 KR101375142 B1 KR 101375142B1 KR 1020120096269 A KR1020120096269 A KR 1020120096269A KR 20120096269 A KR20120096269 A KR 20120096269A KR 101375142 B1 KR101375142 B1 KR 101375142B1
Authority
KR
South Korea
Prior art keywords
function
resource
resource allocation
user program
information
Prior art date
Application number
KR1020120096269A
Other languages
Korean (ko)
Other versions
KR20140028902A (en
Inventor
김주영
Original Assignee
에스코어 주식회사
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 에스코어 주식회사 filed Critical 에스코어 주식회사
Priority to KR1020120096269A priority Critical patent/KR101375142B1/en
Publication of KR20140028902A publication Critical patent/KR20140028902A/en
Application granted granted Critical
Publication of KR101375142B1 publication Critical patent/KR101375142B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/28Error detection; Error correction; Monitoring by checking the correct order of processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

메모리 할당 또는 파일 개방 등을 해제하지 않아 발생하는 리소스 누설을 검출하는 리소스 누설 검출 방법이 제공된다. 리소스 누설 검출 방법은 유저 프로그램의 실행 중 호출되는 리소스 할당 함수 또는 리소스 할당 해제 함수에 대한 리소스 할당 정보 또는 리소스 할당 해제 정보를 로그 기록에 저장하는 로그 기록 단계, 및 상기 유저 프로그램의 종료 후, 상기 로그 기록에서 임의의 리소스 할당 정보에 대한 리소스 할당 해제 정보가 기록되지 않은 경우 리소스 누설로 판정하는 리소스 누설 판정 단계를 포함하고, 상기 로그 기록 단계는 상기 리소스 할당 함수의 호출 시점까지의 콜스택을 상기 리소스 할당 정보와 연관시켜 상기 로그 기록에 저장하는 단계를 포함하고, 상기 리소스 누설 판정 단계는 상기 콜스택으로부터 상기 유저 프로그램에서 호출된 리소스 할당 API 함수를 찾아내는 단계를 포함한다.A resource leak detection method is provided for detecting resource leaks caused by not releasing memory allocation or file opening. The resource leak detection method includes a log recording step of storing resource allocation information or resource deallocation information for a resource allocation function or a resource allocation function that is called during execution of a user program, and a log after the user program is terminated. And a resource leak determination step of determining a resource leak when no resource de-allocation information for any resource allocation information is recorded in the recording, wherein the log recording step includes a call stack until the call point of the resource allocation function. Storing in the log record in association with allocation information, wherein the resource leak determination step includes finding a resource allocation API function called in the user program from the call stack.

Description

유저 프로그램 실행 후 미해제 리소스 검출을 위한 방법 및 장치{METHOD AND APPARATUS FOR DETECTING RESOURCE LEAK AFTER EXECUTING A USER PROGRAM}METHOD AND APPARATUS FOR DETECTING RESOURCE LEAK AFTER EXECUTING A USER PROGRAM}

본 발명은 컴퓨터 프로그램에서의 리소스 누설 검출 방법에 관한 것으로, 보다 상세하게는 메모리 할당 또는 파일 개방 등을 해제하지 않아 발생하는 리소스 누설을 검출하는 방법에 관한 것이다.The present invention relates to a method of detecting a resource leak in a computer program, and more particularly, to a method of detecting a resource leak caused by not releasing memory allocation or file opening.

컴퓨터 프로그램을 개발할 때 프로그램의 메모리 사용을 위하여 malloc() 함수 등의 메모리 할당 함수가 빈번히 호출된다. 메모리 할당 함수를 사용하고 난 뒤에는, free() 함수 등의 메모리 할당 해제 함수를 호출하여 메모리 할당을 해제하여야 한다.When developing computer programs, memory allocation functions such as the malloc () function are frequently called to use the program's memory. After using the memory allocation function, the memory allocation function, such as the free () function, must be called to deallocate the memory.

메모리 할당을 해제하지 않으면, 프로그램의 종료 후에도 메모리가 계속 할당된 상태로 존재하기 때문에 다른 프로그램에서 할당된 메모리를 재사용할 수 없는 메모리 누설이 발생하게 된다. 이 때문에 프로그래머는 할당된 메모리가 프로그램이 종료되기 이전에 해제될 수 있도록 프로그램을 작성하여야 한다.If you do not deallocate the memory, the memory will continue to be allocated after the program terminates, resulting in a memory leak that cannot be reused by other programs. Because of this, the programmer must write a program so that the allocated memory can be freed before the program terminates.

또한, 메모리뿐만 아니라, open(), fopen() 함수 등으로 파일을 개방하거나 기타 리소스를 할당한 경우에도, close() 함수 등으로 이를 해제하여야 한다.In addition, if the file is opened or other resources are allocated using the open () and fopen () functions as well as the memory, the close () function must be released.

그러나, 프로그램이 복잡하게 짜여지는 경우에는 프로그래머가 예측하지 못한 메모리 누설 등의 리소스 누설이 발생할 수도 있다. 그래서, 여러 프로그램 개발 툴들은 리소스의 할당이 일어나고 해제가 이루어지지 않는 것을 검출하는 디버깅 툴들을 제공한다. 이러한 디버깅 툴들은 프로그램의 특정 부분에서 리소스의 할당이 일어났으나 해제되지 않아 리소스 누설이 발생했음을 사용자에게 알린다.However, when a program is complicated, resource leaks such as memory leaks that are not predicted by the programmer may occur. Thus, several program development tools provide debugging tools to detect that resource allocations occur and are not released. These debugging tools inform the user that resource allocation has occurred in certain parts of the program but has not been freed.

한편, 프로그램의 개발은 널리 사용되는 기능에 대한 프로그램을 모아 놓은 각종 라이브러리를 이용하여 이루어지는 것이 일반적이다. 프로그래머는 라이브러리에서 제공하는 API(Application Program Interface) 함수를 호출함으로써 별도의 프로그램을 작성하지 않고도 라이브러리가 제공하는 기능을 구현할 수 있게 된다. 그런데, 이러한 라이브러리 내에서도 리소스 할당이 이루어지는 경우가 있다. 이러한 리소스 할당이 수반되는 API 함수가 호출된 경우에는, 리소스 할당을 해제하는 API 함수도 반드시 호출되어야 한다.On the other hand, the development of the program is generally made by using a variety of libraries that collect a program for a widely used function. Programmers can implement the functions provided by the library without writing a separate program by calling API (Application Program Interface) functions provided by the library. However, there are cases where resource allocation is made in such a library. When an API function involving such resource allocation is called, an API function that frees resource allocation must also be called.

만일, 라이브러리의 API 함수를 호출하였으나 리소스 할당을 해제하는 API 함수를 호출하지 않아서 리소스 누설이 발생하는 경우, 앞서 설명한 디버깅 툴을 이용하여 리소스 누설을 검출하면, 디버깅 툴은 라이브러리 내부의 리소스 할당 함수의 위치를 리소스 누설 위치로 사용자에게 알린다.If a resource leak occurs because the API function of the library is called but the API function to deallocate resources is not detected, if the resource leak is detected using the above-described debugging tool, the debugging tool may execute the resource allocation function of the library. Inform the user of the location as a resource leak location.

그러나, 라이브러리는 사용자가 작성한 것이 아니므로, 사용자는 디버깅 툴이 알려주는 위치에서 무엇이 어떻게 잘못되었는지를 알 수 없는 경우가 많다. 따라서, API 함수의 호출에 의해 리소스 누설이 발생하는 경우에 종래의 디버깅 툴으로는 리소스 누설의 원인을 정확하게 찾아낼 수 없는 어려움이 있다.However, because the library is not written by the user, the user often does not know what went wrong in the location indicated by the debugging tool. Therefore, when a resource leak occurs due to a call of an API function, there is a difficulty that a conventional debugging tool cannot pinpoint the cause of the resource leak.

본 발명은 상술한 문제점을 해결하기 위하여 안출된 것으로, API의 호출에 의해 리소스 누설이 발생한 경우라도 작성된 프로그램 내에서 리소스 누설을 야기한 API의 호출 위치를 찾아낼 수 있는 리소스 누설 검출 방법을 제공하기 위한 것이다.SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problem, and provides a resource leak detection method capable of finding a call location of an API causing a resource leak in a created program even when a resource leak occurs due to an API call. will be.

상술한 과제를 해결하기 위한 본 발명의 리소스 누설 검출 방법은, 유저 프로그램의 실행 중 호출되는 리소스 할당 함수 또는 리소스 할당 해제 함수에 대한 리소스 할당 정보 또는 리소스 할당 해제 정보를 로그 기록에 저장하는 로그 기록 단계, 및 상기 유저 프로그램의 종료 후, 상기 로그 기록에서 임의의 리소스 할당 정보에 대한 리소스 할당 해제 정보가 기록되지 않은 경우 리소스 누설로 판정하는 리소스 누설 판정 단계를 포함하고, 상기 로그 기록 단계는 상기 리소스 할당 함수의 호출 시점까지의 콜스택을 상기 리소스 할당 정보와 연관시켜 상기 로그 기록에 저장하는 단계를 포함하고, 상기 리소스 누설 판정 단계는 상기 콜스택으로부터 상기 유저 프로그램에서 호출된 리소스 할당 API 함수를 찾아내는 단계를 포함한다.In the resource leakage detection method of the present invention for solving the above problems, a log recording step of storing resource allocation information or resource allocation information for a resource allocation function or a resource allocation function that is called during execution of a user program in a log record; And a resource leak determination step of determining resource leakage when resource deassignment information for any resource allocation information is not recorded in the log record after the user program is terminated, wherein the log recording step includes the resource allocation. Associating a call stack up to the point of time of a function call with the resource allocation information and storing in the log record, wherein the resource leak determination step comprises: finding a resource allocation API function called in the user program from the call stack; It includes.

상술한 과제를 해결하기 위한 본 발명의 리소스 누설 검출 장치는, 사용자에 의해 작성된 유저 프로그램을 실행하는 프로그램 실행부, 상기 유저 프로그램의 실행 중 호출되는 리소스 할당 함수 또는 리소스 할당 해제 함수에 대한 리소스 할당 정보 또는 리소스 할당 해제 정보를 로그 기록에 저장하는 로그 생성부, 및 상기 유저 프로그램의 종료 후, 상기 로그 기록에서 임의의 리소스 할당 정보에 대한 리소스 할당 해제 정보가 기록되지 않은 경우 리소스 누설로 판정하는 리소스 누설 판정부를 포함하고, 상기 로그 생성부는 상기 리소스 할당 함수의 호출 시점까지의 콜스택을 상기 리소스 할당 정보와 연관시켜 상기 로그 기록에 저장하고, 상기 리소스 누설 판정부는 상기 콜스택으로부터 상기 유저 프로그램에서 호출된 리소스 할당 API 함수를 찾아내는 것을 특징으로 한다.The resource leak detection apparatus of the present invention for solving the above-described problems, resource allocation information for the program execution unit for executing a user program created by the user, the resource allocation function or resource allocation function called during execution of the user program Or a log generation unit that stores resource deassignment information in a log record, and a resource leak that is determined to be a resource leak when resource deassignment information for any resource allocation information is not recorded in the log record after the end of the user program. And a log generator for storing a call stack up to a call point of the resource allocation function in association with the resource allocation information in the log record, and the resource leak determination unit being called by the user program from the call stack. Find Resource Allocation API Functions It characterized by that.

본 발명에 따르면, 유저 프로그램 내에서 리소스 할당을 수반하는 API 함수가 호출되고, 상기 API 함수에 대응하는 리소스 할당 해제 함수를 호출하지 않은 경우에도, 리소스 누설을 일으킨 API 함수의 호출 위치를 사용자에게 알릴 수 있게 되어, 사용자가 리소스 누설 문제를 해결할 수 있게 된다.According to the present invention, an API function involving resource allocation is called in a user program, and even when a resource deallocation function corresponding to the API function is not called, the user is notified of the call position of the API function causing the resource leakage. This enables users to solve resource leakage problems.

도 1은 본 발명의 실시예에 따른 리소스 누설 검출 장치를 나타내는 블록도이다.
도 2는 본 발명의 실시예에 따른 리소스 누설 검출 방법에서 로그 기록을 생성하는 과정을 나타내는 흐름도이다.
도 3은 본 발명의 실시예에 따른 리소스 누설 검출 방법에서 로그 기록을 분석하여 리소스 누설을 검출하는 과정을 나타내는 흐름도이다.
도 4는 본 발명의 실시예에서의 로그 파일의 내용을 예시적으로 나타내는 예시도이다.
도 5는 본 발명의 실시예에서의 로그 파일의 내용을 예시적으로 나타내는 예시도이다.
1 is a block diagram illustrating an apparatus for detecting a resource leak according to an exemplary embodiment of the present invention.
2 is a flowchart illustrating a process of generating a log record in the resource leakage detection method according to an embodiment of the present invention.
3 is a flowchart illustrating a process of detecting a resource leak by analyzing a log record in the resource leak detection method according to an exemplary embodiment of the present invention.
4 is an exemplary view showing the contents of a log file in an embodiment of the present invention.
5 is an exemplary view showing the contents of a log file in an embodiment of the present invention.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다.Advantages and features of the present invention and methods for achieving them will be apparent with reference to the embodiments described below in detail with the accompanying drawings. The present invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. To fully disclose the scope of the invention to those skilled in the art, and the invention is only defined by the scope of the claims. Like reference numerals refer to like elements throughout the specification.

본 명세서에서 사용되는 '유저 프로그램'의 용어는, 사용자가 직접 작성한 프로그램을 의미하는 것으로, 미리 작성되고 배포되어 사용자가 필요한 기능만을 선택하여 사용할 수 있게 하는 라이브러리에 반대되는 개념이다.As used herein, the term 'user program' refers to a program written by a user, and is a concept opposite to a library that is pre-written and distributed to enable a user to select and use only necessary functions.

또한, 본 명세서에서 사용되는 '리소스 할당 함수'의 용어는 메모리, 파일, 기타의 리소스를 할당하는 함수, 메소드 또는 커맨드를 의미하고, 예를 들어 malloc(), calloc(), realloc(), kalloc(), open(), fopen(), openat(), dup() 함수 등이 될 수 있다.In addition, the term 'resource allocation function' as used herein refers to a function, method or command for allocating memory, files, and other resources, for example, malloc (), calloc (), realloc (), kalloc (), open (), fopen (), openat (), dup () functions, and so on.

또한, 본 명세서에서 사용되는 '리소스 할당 해제 함수'의 용어는 메모리, 파일, 기타의 리소스의 할당을 해제하는 함수, 메소드 또는 커맨드를 의미하고, 예를 들어, free(), close(), fclose() 함수 등이 될 수 있다.In addition, the term 'resource deallocation function' as used herein refers to a function, method or command for deallocating memory, files, and other resources, for example, free (), close (), fclose () Function, etc.

도 1은 본 발명의 실시예에 따른 리소스 누설 검출 장치를 나타내는 블록도이다. 도 1을 참조하면, 리소스 누설 검출 장치(100)는 프로그램 실행부(110), 로그 생성부(120), 리소스 누설 판정부(130) 및 라이브러리 목록(140)를 포함한다.1 is a block diagram illustrating an apparatus for detecting a resource leak according to an exemplary embodiment of the present invention. Referring to FIG. 1, the resource leak detection apparatus 100 includes a program execution unit 110, a log generation unit 120, a resource leakage determination unit 130, and a library list 140.

프로그램 실행부(110), 로그 생성부(120) 및 리소스 누설 판정부(130)는 각각 컴퓨터로 실행가능한 프로그램으로 구현되고, 리소스 누설 검출 장치(100)는 상기의 프로그램이 기록된 저장매체를 구비하여, 상기의 프로그램의 실행에 따라 동작하는 PC인 것이 바람직하다. 그러나, 상기 프로그램 실행부(110), 로그 생성부(120) 및 리소스 누설 판정부(130)는 하드웨어로 구현되어도 무방하다.The program execution unit 110, the log generation unit 120, and the resource leakage determination unit 130 are each implemented as a computer executable program, and the resource leakage detection apparatus 100 includes a storage medium on which the above program is recorded. Thus, it is preferable that the PC be operated according to the execution of the above program. However, the program execution unit 110, the log generation unit 120, and the resource leakage determination unit 130 may be implemented in hardware.

프로그램 실행부(110)는 사용자가 작성한 유저 프로그램을 실행하는 기능을 수행한다. 프로그램 실행부(110)는 통상의 프로그램 개발 툴과 동일하게 사용자의 편의를 위한 기능(예를 들어, 트레이스 기능, 변수 또는 파라미터 뷰어/에디터 기능, 메모리 뷰어/에디터 기능, 브레이크 기능 등)을 제공하며 유저 프로그램을 실행할 수 있다.The program execution unit 110 performs a function of executing a user program created by a user. The program execution unit 110 provides functions (for example, a trace function, a variable or parameter viewer / editor function, a memory viewer / editor function, a break function, etc.) for the user's convenience as in a general program development tool. You can run a user program.

로그 생성부(120)는 프로그램 실행부(110)가 유저 프로그램을 실행할 때에 리소스 할당 함수 또는 리소스 할당 해제 함수가 호출되는 것을 감시하며, 이에 대한 로그 기록을 작성하는 기능을 수행한다. 로그 생성부(120)는 프로그램 실행부(110)에 빌트인(built-in) 또는 플러그인(plug-in)되어 프로그램 실행부(110)에 종속되어 실행될 수도 있고, 프로그램 실행부(110)와는 독립적으로 메모리상에 상주하여 프로그램 실행부(110)에서의 유저 프로그램의 실행을 감시할 수도 있다.The log generator 120 monitors that a resource allocation function or a resource allocation function is called when the program execution unit 110 executes a user program, and performs a function of creating a log record thereof. The log generation unit 120 may be built-in or plug-in to the program execution unit 110 to be dependent on the program execution unit 110 to be executed, or independently of the program execution unit 110. It can also reside in the memory and monitor the execution of the user program in the program execution unit 110.

리소스 누설 판정부(130)는 프로그램 실행부(110)에서의 유저 프로그램의 실행이 종료되면, 생성된 로그 기록에 기초하여 리소스 누설을 검출하는 기능을 수행한다. 리소스 누설 판정부(130)는 로그 생성부(120)와 함께 프로그램 실행부(110)에 빌트인 또는 플러그인되어 프로그램 실행부(110)에 종속되어 실행될 수도 있고, 프로그램 실행부(110)와는 독립적으로 존재하여 프로그램 실행부(110)의 실행 완료 후에 실행될 수도 있다.When the execution of the user program in the program execution unit 110 ends, the resource leakage determination unit 130 detects resource leakage based on the generated log record. The resource leakage determination unit 130 may be built-in or plugged into the program execution unit 110 together with the log generation unit 120 to be dependent on the program execution unit 110 to be executed, or may exist independently of the program execution unit 110. It may be executed after the execution of the program execution unit 110.

라이브러리 목록(140)은 유저 프로그램이 사용하는 라이브러리의 명칭을 기록하고 있다. 라이브러리 목록(140)은 사용자에 의해 임포트(import)된 라이브러리의 명칭들을 기록하고 있을 수도 있고, 공개된 모든 라이브러리의 명칭들을 기록하고 있을 수도 있다. 또한, 라이브러리 목록(140)은 각 라이브러리에 포함된 함수들의 명칭을 함께 기록하고 있을 수 있다.The library list 140 records the names of the libraries used by the user program. The library list 140 may record names of libraries imported by a user or may record names of all published libraries. In addition, the library list 140 may record the names of functions included in each library.

도 2 및 도 3은 본 발명의 리소스 누설 검출 방법을 나타내는 흐름도이다. 이하, 도 2 및 도 3을 참조하여 본 발명의 리소스 누설 검출 장치 및 방법에 대하여 보다 상세하게 설명하기로 한다.2 and 3 are flowcharts illustrating a resource leak detection method of the present invention. Hereinafter, an apparatus and method for detecting resource leakage of the present invention will be described in more detail with reference to FIGS. 2 and 3.

프로그램 실행부(110)는 사용자가 작성한 유저 프로그램을 컴파일하고, 컴파일된 유저 프로그램을 실행한다(S110). 로그 생성부(120)는 실행되는 유저 프로그램에서 리소스 할당 함수 또는 리소스 할당 해제 함수가 호출되는지를 감시한다(S120).The program execution unit 110 compiles the user program created by the user, and executes the compiled user program (S110). The log generator 120 monitors whether a resource allocation function or a resource allocation function is called in the executed user program (S120).

유저 프로그램에서 리소스 할당 함수 또는 리소스 할당 해제 함수가 호출되면, 로그 생성부(120)는 로그 파일에 리소스 할당 정보 또는 리소스 할당 해제 정보를 기록한다(S130).When the resource allocation function or the resource allocation function is called in the user program, the log generating unit 120 records the resource allocation information or the resource allocation information in the log file (S130).

리소스 할당 정보는 호출된 리소스 할당 함수명 및 할당된 리소스의 정보를 포함할 수 있다. 할당된 리소스의 정보는 리소스 할당 함수에 의해 할당된 리소스를 특정하기 위한 정보로서, 리소스 할당 함수의 인자로 사용되거나 리소스 할당 함수의 결과값을 저장하는 변수 또는 포인터일 수 있다. 또한, 할당된 리소스의 정보는, 메모리 할당의 경우에는 메모리의 주소, 파일 개방의 경우에는 파일의 경로(path) 및 명칭일 수도 있다.The resource allocation information may include the called resource allocation function name and the information of the allocated resource. The information of the allocated resource is information for specifying a resource allocated by the resource allocation function, and may be a variable or a pointer used as an argument of the resource allocation function or storing a result of the resource allocation function. The allocated resource information may be an address of a memory in the case of memory allocation, a path and a name of the file in the case of file opening.

리소스 할당 해제 정보는 리소스 할당 해제 함수명 및 해제된 리소스의 정보를 포함할 수 있다. 해제된 리소스의 정보는, 리소스 할당 해제 함수의 인자로 사용되거나 리소스 할당 해제 함수의 결과값을 저장하는 변수 또는 포인터일 수 있다. 또한, 해제된 리소스의 정보는, 메모리 할당 해제의 경우에는 메모리의 주소, 파일 개방 해제의 경우에는 파일의 경로 및 명칭 등이 될 수도 있다.The resource deallocation information may include a resource deallocation function name and information of released resources. The information of the released resource may be a variable or a pointer used as an argument of the resource deallocation function or storing a result value of the resource deallocation function. The released resource information may be an address of a memory in the case of memory allocation release, a path and a name of a file in the case of file release release, and the like.

로그 생성부(120)는 리소스 할당 함수 또는 리소스 할당 해제 함수가 호출되는 때에, 그 시점의 콜스택(call stack)을 리소스 할당 정보 또는 리소스 할당 해제 정보와 함께 로그 파일에 저장할 수 있다(S140). 이때, 콜스택은 호출된 함수의 명칭, 호출된 함수가 포함된 바이너리(또는 파일)의 명칭 및 상기 바이너리(또는 파일) 내에서 함수가 호출된 위치를 포함하는 함수의 호출 정보를 가지고 있다. 또한, 로그 생성부(120)는 리소스 할당 함수가 호출되는 때에만, 그 시점의 콜스택을 리소스 할당 정보와 함께 저장할 수도 있다.When the resource allocation function or the resource allocation function is called, the log generation unit 120 may store a call stack at that time along with the resource allocation information or the resource allocation information in the log file (S140). In this case, the call stack has call information of a function including a name of a called function, a name of a binary (or file) including a called function, and a position where a function is called in the binary (or file). In addition, the log generator 120 may store the call stack at that time together with the resource allocation information only when the resource allocation function is called.

도 4는 본 발명의 실시예에서의 로그 파일의 내용을 예시적으로 나타내는 예시도이다. 도 4는 사용자가 작성한 유저 프로그램인 'app' 프로그램 내에서 'xmlParseFile' 함수가 호출되고, 이후, 'xmlFreeDoc' 함수가 호출되는 경우의 로그 파일을 나타낸다.4 is an exemplary view showing the contents of a log file in an embodiment of the present invention. 4 shows a log file when the 'xmlParseFile' function is called in the 'app' program, which is a user program created by the user, and then the 'xmlFreeDoc' function is called.

여기에서, 'xmlParseFile' 및 'xmlFreeDoc' 함수는 모두 'libxml2' 라이브러리에서 제공하는 API 함수이고, 'libxml2' 라이브러리에 포함되어 있다고 가정한다. 또한, 'xmlParseFile' 함수 내에서는 메모리 할당 함수인 'malloc' 함수가 호출되고, 'xmlFreeDoc' 함수 내에서는 메모리 할당 해제 함수인 'free' 함수가 호출되는 것으로 가정한다. 즉, 'xmlParseFile'은 리소스 할당을 수반하는 API 함수이고, 'xmlFreeDoc'은 'xmlParseFile'에서의 리소스 할당을 해제하는 API 함수이다.Here, 'xmlParseFile' and 'xmlFreeDoc' functions are assumed to be API functions provided by the 'libxml2' library and included in the 'libxml2' library. Also, it is assumed that the memory allocation function 'malloc' is called in the 'xmlParseFile' function, and the 'free' function, which is the memory deallocation free function, is called in the 'xmlFreeDoc' function. That is, 'xmlParseFile' is an API function that involves resource allocation, and 'xmlFreeDoc' is an API function that frees resource allocation in 'xmlParseFile'.

로그 생성부(120)는 'malloc' 함수가 호출되는 때에, 리소스 할당 정보(210a)를 로그 파일에 저장한다. 이때, 리소스 할당 정보(210a)는 함수명인 'malloc' 및 함수의 결과값을 저장하는 변수인 'ptr1'를 포함할 수 있다.The log generator 120 stores the resource allocation information 210a in a log file when the 'malloc' function is called. In this case, the resource allocation information 210a may include a function name 'malloc' and a variable 'ptr1' that stores a result value of the function.

또한, 로그 생성부(120)는 'malloc' 함수가 호출되는 때의 콜스택(220a)을 리소스 할당 정보(210a)와 함께 로그 파일에 저장한다. 도 3에 예시된 콜스택(220a)에서는, 'malloc' 함수가 콜스택의 최상부에 위치하고, 'malloc' 함수가 포함된 바이너리 명칭인 'glib'가 함께 기록되어 있다. 또한, 콜스택의 중간부분에는 'xmlParseFile' 함수와 'xmlParseFile' 함수가 포함된 바이너리 명칭인 'libxml2'가 함께 기록되어 있다.In addition, the log generator 120 stores the call stack 220a together with the resource allocation information 210a when the 'malloc' function is called in a log file. In the call stack 220a illustrated in FIG. 3, the 'malloc' function is located at the top of the call stack, and the binary name 'glib' including the 'malloc' function is recorded together. Also, in the middle of the call stack, the binary name 'libxml2' including 'xmlParseFile' and 'xmlParseFile' is recorded together.

마찬가지로, 로그 생성부(120)는 'free' 함수가 호출되는 때에, 리소스 할당 해제 정보(210b)를 로그 파일에 저장한다. 이때, 리소스 할당 해제 정보(210b)는 함수명인 'free' 및 인자값인 'ptr1'를 포함할 수 있다. 또한, 로그 생성부(120)는 'free' 함수가 호출되는 때의 콜스택(220b)을 리소스 할당 정보(210b)와 함께 로그 파일에 저장할 수 있다.Similarly, the log generator 120 stores the resource de-allocation information 210b in the log file when the 'free' function is called. In this case, the resource allocation release information 210b may include a function name 'free' and an argument value 'ptr1'. In addition, the log generator 120 may store the call stack 220b together with the resource allocation information 210b when the 'free' function is called in a log file.

로그 생성부(120)는 유저 프로그램이 종료될 때까지 리소스 할당 함수 또는 리소스 할당 해제 함수의 호출을 감시하고, 리소스 할당 정보 또는 리소스 할당 해제 정보를 로그 파일에 저장하는 과정을 반복한다(S150).The log generator 120 monitors the call of the resource allocation function or the resource allocation function until the user program is terminated, and repeats the process of storing the resource allocation information or the resource allocation information in the log file (S150).

유저 프로그램이 종료되면, 리소스 누설 판정부(130)는 로그 파일을 읽어 들이고(S210), 로그 기록을 분석하여 리소스 누설 여부를 판단한다. 리소스 누설 여부는 리소스 할당 정보에 대응되는 리소스 할당 해제 정보가 로그 파일에 존재하는지 여부로 판단한다(S220, S230). 도 4의 예에서는, 리소스 할당 정보(210a)인 'malloc, ptr1'에 대응하는 리소스 할당 해제 정보(210b)인 'free, ptr1'이 존재하므로 리소스 누설이 발생하지 않았다.When the user program is terminated, the resource leak determination unit 130 reads the log file (S210), and analyzes the log record to determine whether or not the resource is leaked. Whether the resource is leaked or not is determined based on whether resource allocation release information corresponding to the resource allocation information exists in the log file (S220 and S230). In the example of FIG. 4, since resource allocation information 210b corresponding to 'malloc, ptr1', resource free information 210b 'free, ptr1' exists, no resource leakage occurs.

도 5는 본 발명의 실시예에서 리소스 누설이 발생하는 경우의 로그 파일의 내용을 예시적으로 나타내는 예시도이다. 도 5는 사용자가 작성한 유저 프로그램인 'app2' 프로그램 내에서 'xmlParseFile' 함수가 호출되었으나, 이후 'xmlFreeDoc' 함수가 호출되지 않은 경우의 로그 파일을 나타낸다. 5 is an exemplary diagram illustrating the contents of a log file when resource leakage occurs in an embodiment of the present invention. 5 illustrates a log file when the 'xmlParseFile' function is called in the 'app2' program, which is a user program created by the user, but the 'xmlFreeDoc' function is not called.

도 5의 예에서는, 리소스 할당 정보(210c)인 'malloc, ptr1'에 대응하는 리소스 할당 해제 정보가 존재하지 않으므로 리소스 누설이 발생한 것으로 판정된다. 즉, 'App2' 프로그램에서는 'malloc' 함수가 할당한 'ptr1' 변수가 해제되지 않아 리소스 누설이 발생하였다.In the example of FIG. 5, since resource allocation information corresponding to 'malloc, ptr1', which is resource allocation information 210c, does not exist, it is determined that resource leakage has occurred. That is, in 'App2' program, 'ptr1' variable allocated by 'malloc' function was not released, causing resource leakage.

이 경우, 종래의 디버깅 툴은 해제되지 않은 'ptr1' 변수가 할당된 위치, 즉 'malloc' 함수가 호출된 위치를 리소스 누설이 발생한 위치로 하여 사용자에게 알려준다. 그러나, 이 'malloc' 함수는 'libxml2' 라이브러리 내에 존재하는 것이므로, 사용자가 작성한 것이 아니다. 따라서, 'malloc' 함수가 호출된 위치만을 알려주는 것만으로는 사용자가 리소스 누설의 원인을 알아낼 수 없게 된다.In this case, the conventional debugging tool informs the user of the location where the 'ptr1' variable is not released, that is, the location where the 'malloc' function is called, as the location of the resource leakage. However, this 'malloc' function exists in the 'libxml2' library, so it was not written by the user. Thus, simply telling the location where the 'malloc' function is called does not allow the user to determine the cause of the resource leak.

도 5에 나타난 예에서, 리소스 누설은 리소스 할당을 수반하는 'xmlParseFile' 함수가 호출되었으나, 리소스 할당을 해제하는 'xmlFreeDoc' 함수가 호출되지 않았기 때문에 발생하는 것이다. 따라서, 유저 프로그램 내에서의 'xmlParseFile' 함수가 호출된 위치, 즉 리소스 할당을 수반하는 API 함수(이하, '리소스 할당 API 함수'라 함)가 호출된 위치를 사용자에게 알려주는 것이 필요하다.In the example shown in FIG. 5, resource leakage occurs because the 'xmlParseFile' function involving resource allocation has been called, but the 'xmlFreeDoc' function for deallocating resources has not been called. Therefore, it is necessary to inform the user where the 'xmlParseFile' function is called in the user program, i.e., where the API function (hereinafter referred to as the 'resource allocation API function') called with resource allocation is called.

이를 위하여, 리소스 누설 판정부(130)는 리소스 누설을 발생시킨 'malloc' 함수가 호출된 때의 콜스택(220c)으로부터 리소스 할당 API 함수가 호출된 위치를 추적한다(S240).To this end, the resource leakage determination unit 130 tracks the position at which the resource allocation API function is called from the call stack 220c when the 'malloc' function that causes the resource leakage is called (S240).

콜스택(220c)에는 'malloc' 함수에 대한 호출 정보가 최상부에 위치하게 되고, 그 하부에는 함수가 호출된 순서의 역순에 따라 'libxml2' 라이브러리 내의 함수 또는 'libxml2' 라이브러리 내에서 이용한 다른 라이브러리 내의 함수에 대한 호출 정보가 위치하게 된다.In the call stack 220c, the call information for the 'malloc' function is located at the top, and at the bottom thereof, a function in the 'libxml2' library or another library used in the 'libxml2' library according to the reverse order of the functions are called. The call information for the function is located.

리소스 누설 판정부(130)는 유저 프로그램의 함수에 대한 호출 정보가 발견될 때까지 콜스택의 최상부로부터 차례로 함수의 호출 정보를 검사한다. 콜스택의 함수가 유저 프로그램의 함수인지 라이브러리의 함수인지 여부는 호출 정보에 포함된 바이너리 명칭 및/또는 함수의 명칭으로부터 알 수 있다.The resource leak determination unit 130 checks the call information of the function in order from the top of the call stack until the call information of the function of the user program is found. Whether the call stack function is a function of a user program or a library can be known from the binary name and / or the name of the function included in the call information.

리소스 누설 판정부(130)는 호출 정보에 포함된 바이너리 명칭과 라이브러리 목록(140)에 포함된 라이브러리 명칭을 비교하여, 콜스택의 함수가 유저 프로그램의 함수인지 라이브러리의 함수인지를 판단한다. 또는, 유저 작성 프로그램의 파일명이 우연히 라이브러리 명칭과 일치할 수도 있으므로, 리소스 누설 판정부(130)는 호출 정보에 포함된 바이너리 명칭 및 함수 명칭을 라이브러리 목록(140)에 포함된 라이브러리 명칭 및 함수 명칭과 비교하여, 콜스택의 함수가 유저 프로그램의 함수인지 라이브러리의 함수인지를 판단할 수도 있다.The resource leakage determination unit 130 compares the binary name included in the call information with the library name included in the library list 140 to determine whether the call stack function is a function of a user program or a library. Alternatively, since the file name of the user-written program may coincide with the library name, the resource leak determination unit 130 may compare the binary name and the function name included in the call information with the library name and the function name included in the library list 140. In comparison, it may be determined whether the function of the call stack is a function of a user program or a library.

콜스택의 최상부로부터 차례로 함수의 호출 정보를 검사하여, 최초로 유저 프로그램의 함수에 대한 호출 정보를 발견하면, 바로 그 상단의 호출 정보가 유저 프로그램에서 호출한 API 함수에 대한 호출 정보가 된다. 이로부터 유저 프로그램에서 호출한 리소스 할당 API 함수를 찾아낼 수 있게 된다.When the call information of the function is first found from the top of the call stack, and the first call information of the function of the user program is found, the call information of the uppermost level becomes the call information of the API function called from the user program. From this you can find the resource allocation API functions called by the user program.

이상에서는 콜스택의 최상부로부터 차례로 함수의 호출 정보를 검사하는 것으로 설명하였으나, 콜스택의 최하부로부터 차례로 함수의 호출 정보를 검사하는 것으로 하여도 무방하다.In the above description, the call information of the function is examined in order from the top of the call stack, but the call information of the function may be checked in order from the bottom of the call stack.

콜스택의 최하부에는 유저 프로그램에서 호출한 함수의 호출 정보가 위치한다. 리소스 누설 판정부(130)는 라이브러리의 함수에 대한 호출 정보가 발견될 때까지 콜스택의 최하부로부터 차례로 함수의 호출 정보를 검사한다. 콜스택의 최하부로부터 차례로 함수의 호출 정보를 검사하여, 최초로 라이브러리의 함수에 대한 호출 정보를 발견하면, 바로 그 호출 정보가 유저 프로그램에서 호출한 리소스 할당 API 함수에 대한 호출 정보가 된다.At the bottom of the call stack is the call information of the function called by the user program. The resource leak determination unit 130 checks the call information of the function in order from the bottom of the call stack until the call information of the function of the library is found. When the call information of a function is first found from the bottom of the call stack and the call information for the function of the library is first found, the call information becomes the call information for the resource allocation API function called by the user program.

리소스 누설 판정부(130)는 리소스 누설이 발생했음을 사용자에게 알리고, 상술한 방법으로 찾아낸 유저 프로그램에서 호출한 리소스 할당 API 함수에 대한 정보, 예를 들어, 리소스 누설 판정부(130)는 리소스 할당 API 함수의 명칭 및 유저 프로그램 내에서 상기 리소스 할당 API 함수가 호출된 위치를 사용자에게 제공한다.The resource leakage determination unit 130 notifies the user that a resource leakage has occurred, and information on the resource allocation API function called by the user program found by the above-described method, for example, the resource leakage determination unit 130 may determine the resource allocation API. Provide the user with the name of the function and the location where the resource allocation API function is called in the user program.

이로써, 유저 프로그램 내에서 직접 리소스 할당을 하지 않고, 리소스 할당 API 함수를 호출한 경우에도, 사용자는 리소스 누설 위치를 정확하게 알아낼 수 있게 되어 리소스 누설 문제를 해결할 수 있게 된다.As a result, even when resource allocation API functions are called without directly allocating resources in the user program, the user can pinpoint the location of the resource leakage and solve the resource leakage problem.

본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. 본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구의 범위에 의하여 나타내어지며, 특허청구의 범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.It will be understood by those skilled in the art that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. It is therefore to be understood that the above-described embodiments are illustrative in all aspects and not restrictive. The scope of the present invention is defined by the appended claims rather than the foregoing detailed description, and all changes or modifications derived from the meaning and scope of the claims and the equivalents thereof are included in the scope of the present invention Should be interpreted.

Claims (11)

유저 프로그램의 실행 중 호출되는 리소스 할당 함수 또는 리소스 할당 해제 함수에 대한 리소스 할당 정보 또는 리소스 할당 해제 정보를 로그 기록에 저장하는 로그 기록 단계, 및
상기 유저 프로그램의 종료 후, 상기 로그 기록에서 임의의 리소스 할당 정보에 대한 리소스 할당 해제 정보가 기록되지 않은 경우 리소스 누설로 판정하는 리소스 누설 판정 단계를 포함하는 리소스 누설 검출 방법으로서,
상기 로그 기록 단계는 상기 리소스 할당 함수의 호출 시점까지의 콜스택을 상기 리소스 할당 정보와 연관시켜 상기 로그 기록에 저장하는 단계를 포함하고,
상기 리소스 누설 판정 단계는
상기 콜스택의 호출정보에 포함된 바이너리의 명칭 및 함수 명칭을 라이브러리 목록에 포함된 라이브러리 명칭 및 함수 명칭과 비교하여, 상기 호출된 함수가 상기 유저 프로그램의 함수인지 라이브러리 함수인지 판단하는 단계,
상기 호출된 함수가 상기 유저 프로그램의 함수라면, 상기 유저 프로그램에서 호출된 리소스 할당 API 함수를 찾아내는 단계, 및
상기 찾아낸 리소스 할당 API 함수의 명칭 및 상기 유저 프로그램 내에서 상기 리소스 할당 API 함수가 호출된 위치를 사용자에게 제공하는 단계를 포함하는 것을 특징으로 하는 리소스 누설 검출 방법.
A log recording step of storing resource allocation information or resource deallocation information for a resource allocation function or resource deallocation function called during execution of the user program in a log record, and
12. A resource leakage detection method comprising: a resource leakage determination step of determining resource leakage when resource deassignment information for any resource allocation information is not recorded in the log record after the end of the user program;
The logging step may include storing the call stack up to the point of time of the resource allocation function in the log record in association with the resource allocation information.
The resource leak determination step
Comparing a name of a binary and a function name included in call information of the call stack with a library name and a function name included in a library list to determine whether the called function is a function of the user program or a library function;
If the called function is a function of the user program, finding a resource allocation API function called in the user program, and
And providing the user with the name of the found resource allocation API function and the location where the resource allocation API function is called in the user program.
제 1 항에 있어서,
상기 리소스 할당 함수는 메모리 할당 함수 및 파일 개방 함수 중 적어도 하나를 포함하고,
상기 리소스 할당 해제 함수는 메모리 할당 해제 함수 및 파일 개방 해제 함수 중 적어도 하나를 포함하는 것을 특징으로 하는 리소스 누설 검출 방법.
The method of claim 1,
The resource allocation function includes at least one of a memory allocation function and a file opening function,
The resource deallocation function includes at least one of a memory deallocation deallocation function and a file deallocation deallocation function.
제 1 항에 있어서,
상기 리소스 할당 API 함수를 찾아내는 단계는,
상기 콜스택의 최상부로부터 유저 프로그램의 함수가 최초로 발견될 때까지 차례로 추적하는 단계 및
상기 콜스택에서 상기 최초로 발견된 유저 프로그램의 함수의 바로 상부에 위치한 함수를 상기 리소스 할당 API 함수로 판정하는 단계를 포함하는 것을 특징으로 하는 리소스 누설 검출 방법.
The method of claim 1,
Finding the resource allocation API function,
Tracing sequentially from the top of the call stack until a function of a user program is first discovered; and
And determining a function located immediately above the function of the first found user program in the call stack as the resource allocation API function.
제 1 항에 있어서,
상기 리소스 할당 API 함수를 찾아내는 단계는,
상기 콜스택의 최하부로부터 라이브러리의 함수가 최초로 발견될 때까지 차례로 추적하는 단계 및
상기 최초로 발견된 라이브러리의 함수를 상기 리소스 할당 API 함수로 판정하는 단계를 포함하는 것을 특징으로 하는 리소스 누설 검출 방법.
The method of claim 1,
Finding the resource allocation API function,
Tracing sequentially from the bottom of the callstack until a function of the library is found first; and
And determining the function of the first found library as the resource allocation API function.
삭제delete 제 1 항 내지 제 4 항 중 어느 한 항의 방법을 수행하는 컴퓨터 프로그램을 저장한 컴퓨터로 읽을 수 있는 기록 매체.A computer-readable recording medium storing a computer program for performing the method of any one of claims 1 to 4. 사용자에 의해 작성된 유저 프로그램을 실행하는 프로그램 실행부,
상기 유저 프로그램의 실행 중 호출되는 리소스 할당 함수 또는 리소스 할당 해제 함수에 대한 리소스 할당 정보 또는 리소스 할당 해제 정보를 로그 기록에 저장하는 로그 생성부, 및
상기 유저 프로그램의 종료 후, 상기 로그 기록에서 임의의 리소스 할당 정보에 대한 리소스 할당 해제 정보가 기록되지 않은 경우 리소스 누설로 판정하는 리소스 누설 판정부를 포함하는 리소스 누설 검출 장치로서,
상기 로그 생성부는 상기 리소스 할당 함수의 호출 시점까지의 콜스택을 상기 리소스 할당 정보와 연관시켜 상기 로그 기록에 저장하고,
상기 리소스 누설 판정부는 상기 콜스택의 호출정보에 포함된 바이너리의 명칭 및 함수 명칭을 라이브러리 목록에 포함된 라이브러리 명칭 및 함수 명칭과 비교하여, 상기 호출된 함수가 상기 유저 프로그램의 함수인지 라이브러리 함수인지 판단하고,
상기 호출된 함수가 상기 유저 프로그램의 함수라면, 상기 유저 프로그램에서 호출된 리소스 할당 API 함수를 찾아내고,
상기 찾아낸 리소스 할당 API 함수의 명칭 및 상기 유저 프로그램 내에서 상기 리소스 할당 API 함수가 호출된 위치를 사용자에게 제공하는 것을 특징으로 하는, 리소스 누설 검출 장치.
A program execution unit that executes a user program created by a user,
A log generation unit for storing resource allocation information or resource allocation information for a resource allocation function or a resource allocation function called during execution of the user program in a log record; and
A resource leakage detection device including a resource leakage determination unit for determining resource leakage when resource allocation release information for any resource allocation information is not recorded in the log record after termination of the user program.
The log generation unit associates the call stack up to the point of time of the call to the resource allocation function with the resource allocation information and stores it in the log record.
The resource leakage determining unit compares the name of a binary and a function name included in the call stack information of the call stack with a library name and a function name included in a library list to determine whether the called function is a function of the user program or a library function. and,
If the called function is a function of the user program, find the resource allocation API function called in the user program,
And provide the user with the name of the found resource allocation API function and the position at which the resource allocation API function is called in the user program.
제 7 항에 있어서,
상기 리소스 할당 함수는 메모리 할당 함수 및 파일 개방 함수 중 적어도 하나를 포함하고,
상기 리소스 할당 해제 함수는 메모리 할당 해제 함수 및 파일 개방 해제 함수 중 적어도 하나를 포함하는 것을 특징으로 하는 리소스 누설 검출 장치.
The method of claim 7, wherein
The resource allocation function includes at least one of a memory allocation function and a file opening function,
And the resource de-allocation function includes at least one of a memory de-allocation function and a file de-allocation function.
제 7 항에 있어서,
상기 리소스 누설 판정부는,
상기 콜스택의 최상부로부터 유저 프로그램의 함수가 최초로 발견될 때까지 차례로 추적하고,
상기 콜스택에서 상기 최초로 발견된 유저 프로그램의 함수의 바로 상부에 위치한 함수를 상기 리소스 할당 API 함수로 판정하는 것을 특징으로 하는 리소스 누설 검출 장치.
The method of claim 7, wherein
The resource leak determination unit,
Tracking from the top of the call stack until the first function of the user program is found,
And determining a function located immediately above the function of the first user program found in the call stack as the resource allocation API function.
제 7 항에 있어서,
상기 리소스 누설 판정부는,
상기 콜스택의 최하부로부터 라이브러리의 함수가 최초로 발견될 때까지 차례로 추적하고,
상기 최초로 발견된 라이브러리의 함수를 상기 리소스 할당 API 함수로 판정하는 것을 특징으로 하는 리소스 누설 검출 장치.
The method of claim 7, wherein
The resource leak determination unit,
From the bottom of the call stack, track in order until the function of the library is found for the first time,
And determining the function of the first found library as the resource allocation API function.
삭제delete
KR1020120096269A 2012-08-31 2012-08-31 Method and apparatus for detecting resource leak after executing a user program KR101375142B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020120096269A KR101375142B1 (en) 2012-08-31 2012-08-31 Method and apparatus for detecting resource leak after executing a user program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020120096269A KR101375142B1 (en) 2012-08-31 2012-08-31 Method and apparatus for detecting resource leak after executing a user program

Publications (2)

Publication Number Publication Date
KR20140028902A KR20140028902A (en) 2014-03-10
KR101375142B1 true KR101375142B1 (en) 2014-03-17

Family

ID=50642208

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020120096269A KR101375142B1 (en) 2012-08-31 2012-08-31 Method and apparatus for detecting resource leak after executing a user program

Country Status (1)

Country Link
KR (1) KR101375142B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10269105A (en) * 1997-01-27 1998-10-09 N T T Data Tsushin Kk Trace system, resource release omission detection system, and recording medium
KR20030044319A (en) * 2001-11-29 2003-06-09 엘지전자 주식회사 Debugging method of memory allocation and deallocation for real-time operating system
US20070271418A1 (en) * 2006-05-22 2007-11-22 Microsoft Corporation Resource leak diagnosis

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10269105A (en) * 1997-01-27 1998-10-09 N T T Data Tsushin Kk Trace system, resource release omission detection system, and recording medium
KR20030044319A (en) * 2001-11-29 2003-06-09 엘지전자 주식회사 Debugging method of memory allocation and deallocation for real-time operating system
US20070271418A1 (en) * 2006-05-22 2007-11-22 Microsoft Corporation Resource leak diagnosis

Also Published As

Publication number Publication date
KR20140028902A (en) 2014-03-10

Similar Documents

Publication Publication Date Title
US8522209B2 (en) Method and system for integrating profiling and debugging
US6523141B1 (en) Method and apparatus for post-mortem kernel memory leak detection
US8245209B2 (en) Detecting dangling pointers and memory leaks within software
US20070150872A1 (en) Use of Memory Watch Points and a Debugger to Improve Analysis of Runtime Memory Access Errors
US20070180455A1 (en) Qualitatively Annotated Code
US20060085156A1 (en) Method and system for predicting memory leaks from unit testing
Kotzmann et al. Escape analysis in the context of dynamic compilation and deoptimization
US7096339B2 (en) System and method for detecting memory management programming errors
Jensen et al. MemInsight: platform-independent memory debugging for JavaScript
US10445020B2 (en) Computer-implemented method and a system for encoding a stack application memory state using shadow memory
Li et al. Detecting cross-language memory management issues in Rust
US20100262954A1 (en) Method for Locating Resource Leaks during Software Development
CN110688245B (en) Information acquisition method, device, storage medium and equipment
Bissyandé et al. Diagnosys: automatic generation of a debugging interface to the linux kernel
US7725771B2 (en) Method and system for providing enhanced memory error messages
CN113987507A (en) Heap memory vulnerability detection method and device, storage medium and electronic equipment
KR101375142B1 (en) Method and apparatus for detecting resource leak after executing a user program
Susskraut et al. Automatically finding and patching bad error handling
US20120005460A1 (en) Instruction execution apparatus, instruction execution method, and instruction execution program
Yan Program analyses for understanding the behavior and performance of traditional and mobile object-oriented software
US20130139133A1 (en) Information processing apparatus and program and method for adjusting initial array size
US8930420B2 (en) Orphan object tracking for objects having acquire-release semantics
Ravitch et al. Analyzing memory ownership patterns in C libraries
CN111356987B (en) Dynamic memory identification method and device
Toffalini et al. Static analysis of context leaks in android applications

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20170313

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20180312

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20190311

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20200305

Year of fee payment: 7