# US 9,519,592 B2 · Stale pointer detection with overlapping versioned memory

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 9,519,592 B2
- Document ID: US9519592B2
- Status: Granted
- Kind: B2
- Application number: 13/691,467
- Filed: 2012-11-30
- Published: 2014-06-05
- Granted: 2016-12-13
- Earliest claimed: 2012-11-30
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Raj Prakash; Sheldon M. Lobo
- Web page: https://patentgrep.com/patent/US9519592B2

## CPC

- G06F 12/10: Address translation
- G06F 12/1416: {by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights (G06F12/1458 takes precedence)}
- G06F 2212/65: Details of virtual memory and virtual address translation
- G06F 2212/657: Virtual address space management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In general, in one aspect, the invention relates to a method for managing virtual memory (VM). The method includes receiving, from an application, a first access request comprising a first VM address identifying a VM location, obtaining a current VM location version value for the VM location, obtaining a first submitted VM location version value from the first VM address, and in response to a determination that the current VM location version value and the first submitted VM location version value match: servicing the first access request using the first VM address.

## Claims

### Claim 1

A method for managing virtual memory (VM) comprising:
incrementing, in response to updating a status of a VM location in a freed VM location list, a version of the VM location to generate a first VM location version value for the VM location;
generating a first versioned VM address based on the first VM location version value;
receiving, from an application, a first access request comprising the first versioned VM address identifying the VM location;
obtaining, in response to the first access request, the first VM location version value from the first versioned VM address;
comparing, in response to the first access request, a first current VM location version value and the first VM location version value to determine a match, wherein the first current VM location version value corresponds to the version of the VM location concurrent with the first access request; and
servicing, in response to the match, the first access request using the first versioned VM address.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
receiving, from the application, a second access request comprising a second versioned VM address identifying the VM location;
obtaining, in response to the second access request, a second VM location version value from the second versioned VM address;
comparing, in response to the second access request, a second current VM location version value and the second VM location version value to determine a mismatch, wherein the second current VM location version value corresponds to the version of the VM location concurrent with the second access request; and
sending, in response to the mismatch, an error to the application.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
receiving a notification that the VM location is no longer in use, wherein the notification comprises the second versioned VM address to identify the VM location,
wherein updating the status of the VM location in the freed VM location list comprises adding the VM location to the freed VM location list, and
wherein the second access request is received subsequent to the notification.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
receiving, from the application, an allocation request; and
returning, to the application in response to the allocation request, the first versioned VM address identifying the VM location,
wherein updating the status of the VM location in the freed VM location list comprises removing the VM location from the freed VM location list.

### Claim 5 (depends on 1)

The method of claim 1,
wherein updating the status of the VM location in the freed VM location list comprises at least one selected from a group consisting of adding the VM location to the freed VM location list and removing the VM location from the freed VM location list.

### Claim 6 (depends on 1)

The method of claim 1, wherein servicing the first access request comprises:
translating the first versioned VM address to obtain a physical memory address, wherein the physical memory address is mapped to the VM location.

### Claim 7 (depends on 6)

The method of claim 6,
wherein the first versioned VM address comprises the first VM location version value, and
wherein translating the first versioned VM address to obtain the physical memory address comprises disregarding the first VM location version value.

### Claim 8 (depends on 7)

The method of claim 7, wherein the first versioned VM address is translated directly without removing the first VM location version value.

### Claim 9 (depends on 1)

The method of claim 1, wherein servicing the first access request using the first versioned VM address comprises one selected from a group consisting of writing data at the VM location identified by the first versioned VM address and reading data from the VM location identified by the first versioned VM address.

### Claim 10

A non-transitory computer readable medium comprising instructions that, when executed by a processor, perform a method for managing virtual memory (VM), the method comprising:
incrementing, in response to updating a status of a VM location in a freed VM location list, a version of the VM location to generate a first VM location version value for the VM location;
generating a first versioned VM address based on the first VM location version value;
receiving, from an application, a first access request comprising the first versioned VM address identifying the VM location;
obtaining, in response to the first access request, the first VM location version value from the first versioned VM address;
comparing, in response to the first access request, a first current VM location version value and the first VM location version value to determine a match, wherein the first current VM location version value corresponds to the version of the VM location concurrent with the first access request; and
servicing, in response to the match, the first access request using the first versioned VM address.

### Claim 11 (depends on 10)

The non-transitory computer readable medium of claim 10, the method further comprising:
receiving, from the application, a second access request comprising a second versioned VM address identifying the VM location;
obtaining, in response to the second access request, a second VM location version value from the second versioned VM address;
comparing, in response to the second access request, a second current VM location version value and the second VM location version value to determine a mismatch, wherein the second current VM location version value corresponds to the version of the VM location concurrent with the second access request; and
sending, in response to the mismatch, an error to the application.

### Claim 12 (depends on 11)

The non-transitory computer readable medium of claim 11, the method further comprising:
receiving a notification that the VM location is no longer in use, wherein the notification comprises the second versioned VM address to identify the VM location,
wherein updating the status of the VM location in the freed VM location list comprises adding the VM location to the freed VM location list, and
wherein the second access request is received subsequent to the notification.

### Claim 13 (depends on 10)

The non-transitory computer readable medium of claim 10, the method further comprising:
receiving, from the application, an allocation request; and
returning, to the application in response to the allocation request, the first versioned VM address identifying the VM location,
wherein updating the status of the VM location in the freed VM location list comprises removing the VM location from the freed VM location list.

### Claim 14 (depends on 10)

The non-transitory computer readable medium of claim 10,
wherein updating the status of the VM location in the freed VM location list comprises at least one selected from a group consisting of adding the VM location to the freed VM location list and removing the VM location from the freed VM location list.

### Claim 15 (depends on 10)

The non-transitory computer readable medium of claim 10, wherein servicing the first access request using the first versioned VM address comprises:
translating the first versioned VM address to obtain a physical memory address, wherein the physical memory address is mapped to the VM location.

### Claim 16 (depends on 15)

The non-transitory computer readable medium of claim 15,
wherein the first versioned VM address comprises the first VM location version value, and
wherein translating the first versioned VM address to obtain the physical memory address comprises disregarding the first VM location version value.

### Claim 17 (depends on 16)

The non-transitory computer readable medium of claim 16,
wherein the first versioned VM address is translated directly without removing the first VM location version value.

### Claim 18 (depends on 10)

The non-transitory computer readable medium of claim 10, wherein servicing the first access request using the first versioned VM address comprises one selected from a group consisting of writing data at the VM location identified by the first versioned VM address and reading data from the VM location identified by the first versioned VM address.

### Claim 19

A system comprising:
physical memory;
a virtual memory (VM) manager configured to:
increment, in response to updating a status of a VM location in a freed VM location list, a version of the VM location to generate a VM location version value for the VM location;
generate a versioned VM address based on the VM location version value;
receive, from an application, an access request comprising the versioned VM address corresponding to the VM location;
obtain, in response to the access request, the VM location version value from the versioned VM address; and
compare, in response to the access request, a current VM location version value and the VM location version value to determine a match, wherein the current VM location version value corresponds to the version of the VM location concurrent with the first access request; and
a central processing unit configured to:
in response to the match, service the access request using the versioned VM address.

### Claim 20 (depends on 19)

The system of claim 19, further comprising:
a memory management unit (MMU) configured to:
translate the versioned VM address to obtain a physical memory address corresponding to a location in the physical memory, wherein the physical memory address is mapped to the VM location.
