IP Library › Granted Patent US 10,922,209
Granted Patent B2
US 10,922,209 · App. 16/421,097 · Granted Feb 16, 2021

Device and method for automatically repairing memory deallocation errors

Inventors: Hakjoo Oh (Seoul, KR); Junhee Lee (Seoul, KR); Seongjoon Hong (Seoul, KR)
Assignee: KOREA UNIVERSITY RESEARCH AND BUSINESS FOUNDATION
G06F11/3612G06F8/65G06F8/75G06F11/3604G06F11/3608
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,922,209
App. No.
16/421,097
Granted
Feb 16, 2021
Kind
B2
Abstract

A device for automatically repairing memory deallocation errors is disclosed. The device includes: a static analysis unit configured to generate status information for each one of the objects included in the source code of a program by way of a static analysis of the source code, where the status information includes position information, pointer information, and patch information, the position information associated with allocation sites of the objects, the pointer information associated with pointers pointing to the objects, the patch information associated with deallocation statements capable of deallocating the objects; a decision unit configured to choose patch candidates from the patch information and decide on a combination of the patch candidates capable of deallocating each of the objects only once; and a repair unit configured to repair the source code according to the combination of patch candidates.

Claims (33)

1. A device for automatically repairing memory deallocation errors, the device comprising:

a static analysis unit configured to generate status information for each one of objects included in a source code of a program by way of a static analysis of the source code, the status information comprising position information, pointer information, and patch information, the position information associated with allocation sites of the objects, the pointer information associated with pointers pointing to the objects, the patch information associated with deallocation statements capable of deallocating the objects for each point of the source code;

a decision unit configured to choose patch candidates from the patch information and decide on a combination of the patch candidates capable of deallocating each of the objects only once; and

a repair unit configured to repair the source code according to the combination of patch candidates,

wherein

the static analysis unit generates the pointer information by way of point-to analysis, and

the pointer information comprises first pointer information, second pointer information, and third pointer information, and

the first pointer information is associated with information on pointers obtained by over-approximating all pointers possibly pointing to the one object, the second pointer information is associated with information on pointers pointing to the one object, and the third pointer information is associated with pointers not pointing to the one object.

2. The device for automatically repairing memory deallocation errors according to claim 1 , wherein the patch information comprises first patch information and second patch information, the first patch information associated with information on deallocation statements guaranteed to be capable of deallocating the objects without errors, and the second patch information associated with information on deallocation statements not guaranteed to be capable of deallocating the objects without errors.

3. The device for automatically repairing memory deallocation errors according to claim 2 , wherein for each point of the source code, the static analysis unit:

updates the second patch information with the first patch information and information regarding first deallocation statements (U) if the objects are usable at said each point, the first deallocation statements (U) including deallocation statements for pointer information obtained by excluding the second pointer information from the first pointer information, and

updates the second patch information with the information regarding first deallocation statements (U) and information regarding third deallocation statements (D) if the objects are not usable at said each point, the information regarding third deallocation statements (D) including information regarding deallocation statements included concurrently in both information regarding second deallocation statements (G) and the second patch information, the second deallocation statements (G) including deallocation statements for the second pointer information.

4. The device for automatically repairing memory deallocation errors according to claim 3 , wherein for each point of the source code, the static analysis unit:

updates the first patch information by excluding deallocation statements included in the first patch information from the first patch information, adding the information regarding second deallocation statements (G), and excluding deallocation statements included in the updated second patch information, if the objects are usable at said each point, and

updates the first patch information by adding the information regarding second deallocation statements (G) to the first patch information and excluding the deallocation statements included in the updated second patch information, if the objects are not usable at said each point.

5. The device for automatically repairing memory deallocation errors according to claim 1 , wherein the source code includes a branch, and the static analysis unit generates the status information for each of the objects along an execution path of the branch.

6. The device for automatically repairing memory deallocation errors according to claim 1 , wherein the decision unit decides on the combination of patch candidates by using a SAT (satisfiability) solver.

7. A method for automatically repairing memory deallocation errors, the method comprising:

generating status information for each one of objects included in a source code of a program by way of a static analysis of the source code, the status information comprising position information, pointer information, and patch information, the position information associated with allocation sites of the objects, the pointer information associated with pointers pointing to the objects, the patch information associated with deallocation statements capable of deallocating the objects for each point of the source code;

choosing patch candidates from the patch information and deciding on a combination of the patch candidates capable of deallocating each of the objects only once; and

repairing the source code according to the combination of patch candidates,

wherein

the generating of the status information further comprises generating the pointer information by way of point-to analysis,

the pointer information comprises first pointer information, second pointer information, and third pointer information, and

the first pointer information is associated with information on pointers obtained by over-approximating all pointers possibly pointing to the one object, the second pointer information is associated with information on pointers pointing to the one object, and the third pointer information is associated with pointers not pointing to the one object.

8. The method for automatically repairing memory deallocation errors according to claim 7 , wherein

the patch information comprises first patch information and second patch information, the first patch information associated with information on deallocation statements guaranteed to be capable of deallocating the objects without errors, and the second patch information associated with information on deallocation statements not guaranteed to be capable of deallocating the objects without errors.

9. The method for automatically repairing memory deallocation errors according to claim 8 , wherein the generating of the status information comprises, for each point of the source code:

updating the second patch information with the first patch information and information regarding first deallocation statements (U) if the objects are usable at said each point, the first deallocation statements (U) including deallocation statements for pointer information obtained by excluding the second pointer information from the first pointer information, and

updating the second patch information with the information regarding first deallocation statements (U) and information regarding third deallocation statements (D) if the objects are not usable at said each point, the information regarding third deallocation statements (D) including information regarding deallocation statements included concurrently in both information regarding second deallocation statements (G) and the second patch information, the second deallocation statements (G) including deallocation statements for the second pointer information.

10. The method for automatically repairing memory deallocation errors according to claim 9 , wherein the generating of the status information comprises, for each point of the source code:

updating the first patch information by excluding deallocation statements included in the first patch information from the first patch information, adding the information regarding second deallocation statements (G), and excluding deallocation statements included in the updated second patch information, if the objects are usable at said each point, and

updating the first patch information by adding the information regarding second deallocation statements (G) to the first patch information and excluding the deallocation statements included in the updated second patch information, if the objects are not usable at said each point.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 23, 2019
From: OH, HAKJOO; LEE, JUNHEE; HONG, SEONGJOON
To: KOREA UNIVERSITY RESEARCH AND BUSINESS FOUNDATION
Reel/Frame 049272/0483 →
Priority Claims (1)
KR 10-2018-0059843 · May 25, 2018 · national
Continuity (1)
Related Publication 20190361790A1 · Nov 28, 2019