Method and apparatus for finding bugs related to garbage collection in a virtual machine
Abstract
A method and apparatus for finding bugs related to garbage collection in a virtual machine. For each possible garbage collection point in a stream of execution, a compiler in the virtual machine provides a map that specifies live pointer locations in the stack. In addition, the map identifies those locations in the stack that contain other forms of live data, such as integers. All other locations are considered “dead,” i.e., no longer in use or never used. At each garbage collection point, “dead” locations in the stack are overwritten with an invalid pointer value. Because of the overwriting process, any bug in the compiler that causes a live pointer to be omitted from the map also causes the omitted pointer to be overwritten with the invalid pointer value. Regardless of whether garbage collection is actually performed at the garbage collection point where the pointer was omitted from the compiler-generated map, subsequent execution steps that reference the omitted pointer trigger an invalid pointer error. The invalid pointer error may be trapped and identified as a compiler bug related to map generation in the garbage collection process.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 23 · Forward citations: 36.
Claims (3 — 1 Independent, 2 Dependent)
- Claim 1Independent Claim
In a computer system, a method for finding program code bugs comprising: obtaining a map of a plurality of pointers to live objects and data; determining memory locations that do not contain at least one of said plurality of pointers based on a said map; overwriting said memory locations with an invalid pointer value; and issuing a warning if a resource attempts to access one of said memory locations containing said invalid pointer value.
- Claim 2Depends on #1
The method of claim 1 , further comprising implementing a trap for a reference made via said invalid pointer value.
- Claim 3Depends on #1
The method of claim 1 , further comprising generating said map in a compiler.
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (15 of 36 total)
References Cited — Backward Prior Art (23)
Non-Patent Literature (2)
- Title: Garbage Collection for Strongly type languages using run-time type reconstruction, Aditya et al, ACM, 1994.
- Title: Space Efficient Conservative Garbage Collection Author: Boehm, ACM, 1993.*