Versioned Virtual Memory Address Stale Pointer Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Programming errors often occur when one process attempts to access a location in virtual memory that has been freed and reallocated to a different process, leading to unexpected results or errors.
Innovation Solution
A method and system that utilize versioned virtual memory addresses to track and manage the allocation and deallocation of virtual memory locations, ensuring that only matching version values allow access to prevent access to freed locations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If virtual memory locations are freed and reallocated for reuse, then memory utilization and productivity are improved, but the risk of accessing freed memory locations increases leading to programming errors
Solution Approach 1:
The patent applies preliminary action by assigning a version number to each virtual memory location before it is freed. When memory is deallocated, the version number is captured and stored. Before allowing access to a freed memory location, the system checks whether the version number in the address matches the current version number of that location. This pre-established version tracking mechanism prevents access to incorrectly freed memory locations, thereby maintaining reliability while enabling memory reuse for improved productivity.
2Reliability
If version checking is performed on every memory access, then access safety is improved, but system complexity and processing overhead increase
Solution Approach 1:
The patent applies copying by creating a version number copy that is stored alongside the virtual memory address. Instead of implementing complex access validation logic, the system simply compares the version number embedded in the address with the current version number stored in the version table. This copying approach simplifies the access checking mechanism while maintaining high reliability, avoiding the need for complex data structure validation.
3Reliability
If version numbers are tracked for all virtual memory locations, then access safety is improved, but memory overhead increases
Solution Approach 1:
The patent applies local quality by implementing version number tracking selectively for freed virtual memory locations rather than for all memory locations uniformly. The version number is captured and stored only when memory is deallocated, and the checking mechanism is activated only for addresses that have been freed. This localized approach ensures access safety for freed memory while minimizing the overall memory overhead associated with version tracking infrastructure.
Data Source
AI summary
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.


