Debugger Watchpoint Memory Overflow Detection Embedded Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing sanitizers used for desktop and server hardware are not suitable for embedded systems due to resource constraints and can interfere with the execution of computer programs, making it difficult to detect bugs like memory overflows in safety-critical systems.
Innovation Solution
A method that uses a debugger to implement memory monitoring by expanding memory regions with a protection zone and setting watchpoints, allowing for effective memory monitoring without the need for instrumentation or emulation, enabling the detection of bugs in embedded systems through fuzzing.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If sanitizers are used for memory monitoring on embedded systems, then bug detection capability is improved, but resource consumption increases and program execution is influenced
Solution Approach 1:
The patent extracts the memory monitoring functionality from the program code itself and implements it through the debugger's hardware capabilities (watchpoints). Instead of embedding sanitizer code that consumes resources, the monitoring is performed externally by the debugger using hardware-supported memory location watching, thereby achieving bug detection without increasing program resource consumption.
Solution Approach 2:
The debugger serves as an intermediary between the program and the memory monitoring function. Rather than the program directly performing memory monitoring (which would consume its resources), the debugger mediates by setting watchpoints on memory locations and triggering breakpoints when accesses occur, enabling monitoring without burdening the program's execution resources.
2Reliability
If code instrumentation is used to implement sanitizers, then memory monitoring is achieved, but source code availability or binary instrumentation is required which increases complexity
Solution Approach 1:
The patent leverages the debugger's inherent self-service capabilities to perform memory monitoring. The debugger already possesses the functionality to set breakpoints and monitor memory locations; this patent applies those existing capabilities to watch protected memory zones without requiring any additional instrumentation code or modifications to the program, thereby achieving monitoring with minimal added complexity.
Solution Approach 2:
The patent utilizes the debugger's universal functionality for multiple purposes: the same debugger mechanisms that control program execution are also used to set watchpoints and detect memory access violations. This multi-functional use of the debugger eliminates the need for separate instrumentation systems, reducing overall complexity while maintaining comprehensive memory monitoring capability.
3Reliability
If protection zones are set around memory regions, then memory overflow detection is improved, but additional memory locations are required
Solution Approach 1:
The patent applies partial monitoring by setting watchpoints selectively on critical memory locations at the boundaries of protected zones, rather than monitoring every memory location uniformly. This approach provides sufficient overflow detection capability while minimizing the number of watchpoints needed, thereby reducing the memory overhead associated with the monitoring mechanism itself.
Data Source
AI summary
A method for testing a computer program. The method includes: executing the computer program until a memory allocation command is activated for allocating a memory region; expanding the memory region by a protection zone having at least one memory location; allocating the expanded memory region; setting a watchpoint on each of one or more memory locations of the protection zone; continuing the execution of the computer program; and displaying, for each set watchpoint, that the computer program has a bug if the set watchpoint is triggered.
