Memory Status Summaries for Low-Overhead Time-Type Bug Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for detecting time-type memory problems, such as memory leaks and use-after-free issues, are resource-intensive and suffer from high false and missing report rates, posing a significant challenge in the industry.
Innovation Solution
A method and apparatus that decouples memory behavior by analyzing source code into independent units, using summary information to analyze memory status iteratively, reducing the need for global analysis and constructing a call graph, thereby lowering resource overheads and improving detection accuracy.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If global analysis is performed to detect time-type memory problems, then detection accuracy is improved, but resource overheads increase
Solution Approach 1:
The patent divides the source code into multiple independent analysis units (functions or function groups) that can be analyzed separately. Each analysis unit processes its own memory operations independently, avoiding the need for comprehensive global analysis. This segmentation maintains detection accuracy for time-type memory problems while significantly reducing resource overheads by eliminating redundant analysis across the entire codebase.
2Measurement precision
If detailed memory behavior analysis is performed across all analysis units, then false and missing report rates are reduced, but analysis amount increases
Solution Approach 1:
The patent extracts and utilizes summary information from called analysis units, which contains pre-computed memory status data. When analyzing a caller unit, the system queries the summary information of the callee unit directly, avoiding redundant detailed analysis of the callee's internal memory behavior. This extraction approach reduces the analysis amount while maintaining low false and missing report rates through cross-unit memory behavior analysis.
3Productivity
If summary information is used for cross-analysis-unit memory behavior analysis, then analysis efficiency is improved, but information loss may occur
Solution Approach 1:
The patent performs preliminary analysis on each analysis unit to generate comprehensive summary information that captures all relevant memory statuses at entry and exit points. This preliminary action ensures that when summary information is used for cross-unit analysis, no critical information is lost. The summary information includes complete memory state data for input/output pointers, formal parameters, global variables, and return values, enabling efficient cross-unit analysis without information loss.
Data Source
Figure 1
Figure 2
Figure 3~4
AI summary
A time-type memory security detection method is disclosed, including: obtaining, based on source code, a plurality of analysis units each including a function or a function group; performing status analysis on a status of a memory block to which a pointer in the analysis unit points, where the plurality of analysis units include a first analysis unit and a second analysis unit, the first analysis unit includes a function call statement used to call the second analysis unit; and when the function call statement is analyzed, performing, based on summary information of the second analysis unit, status analysis on a status of a memory block to which a pointer associated with the function call statement points, where the summary information of the analysis unit is used to describe memory statuses present when a memory block to which an input/output pointer in the analysis unit points enters and exits the analysis unit; and generating summary information of the analysis unit based on a status analysis result corresponding to the analysis unit, and obtaining a detection result related to a time-type memory problem in the analysis unit. In this way, resource overheads and false and missing report rates are reduced when the time-type memory problem is detected.