Bytecode Memory Access Error Detection via Delay Injection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for detecting memory access errors in multi-threaded applications are inefficient, particularly when dealing with heterogeneous platforms, as they incur high runtime overhead and lack portability, making it difficult to reproduce and debug concurrency bugs.
Innovation Solution
The method involves converting the multi-threaded application to a bytecode representation, profiling to identify shared memory access points, injecting a delay time frame into memory access operations, and monitoring accesses during this delay to detect memory access errors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional dynamic data-race detectors track accesses to shared resources, then memory access errors can be detected, but the runtime overhead is high and the process is slow
Solution Approach 1:
The patent creates a virtualized execution environment that copies the multi-threaded application into a controlled runtime sandbox. This virtual copy allows the detector to monitor memory accesses without interfering with the original application's execution, reducing overhead while maintaining detection accuracy. The virtualized environment enables parallel monitoring of multiple threads without blocking their actual execution.
Solution Approach 2:
The patent introduces a virtualized runtime sandbox as an intermediary layer between the multi-threaded application and the memory access detection mechanism. This sandbox intercepts and monitors memory accesses to shared resources, providing detection capability without requiring direct instrumentation of the application code, thereby reducing runtime overhead.
2Reliability
If instrumentation of every raw memory access is performed, then detection coverage is maximized, but runtime overhead increases significantly
Solution Approach 1:
The patent applies selective instrumentation only to memory accesses that are likely to cause data races, rather than instrumenting every memory access. By analyzing the program structure and identifying shared memory access points, the detector focuses monitoring resources on critical locations, achieving high detection coverage with reduced overall overhead.
Solution Approach 2:
The patent implements partial instrumentation by monitoring only a subset of memory accesses that are identified as potential race conditions through static analysis or heuristics. This partial action approach maintains adequate detection coverage while significantly reducing the total instrumentation overhead compared to full memory access monitoring.
3Adaptability or versatility
If testing is performed on isolated test units, then portability issues are avoided, but the process becomes slow and inaccurate
Solution Approach 1:
The patent creates a universal detection framework that operates across multiple hardware platforms through virtualization. The virtualized runtime sandbox can emulate different hardware configurations and platforms, allowing the same detection process to test applications on diverse architectures without physical isolation. This enables both portability verification and efficient testing through virtual machine migration and configuration changes.
Data Source
AI summary
A method for detecting a memory access error in a multi-threaded application. The method includes: converting the multi-threaded application to a bytecode representation thereof; profiling the bytecode representation to determine at least one shared memory access point by at least two threads of the bytecode representation; injecting a delay time frame into a respective memory access operation to the shared memory access point by at least one thread of the at least two threads; monitoring accesses of the at least two threads to the shared memory access point during the delay time frame to detect the memory access error. A computer program, an apparatus, and a storage medium are also described.

