Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Code static analysis based multithread deadlock detection method and system

A static analysis and deadlock detection technology, applied in software testing/debugging, etc., can solve the problems of manual confirmation, great difference in the ability to find errors, and the failure of the program to terminate normally, so as to achieve the effect of improving accuracy

Inactive Publication Date: 2011-05-25
BEIJING UNIV OF POSTS & TELECOMM
View PDF1 Cites 33 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Both dynamic testing and static testing have their own advantages and disadvantages: the advantage of dynamic testing is that the software errors found are very intuitive, and the disadvantage is that the design requirements for test cases are high, and the ability to find errors in different test case sets varies greatly. The fact that the test method needs to actually run the program under test is also a limitation
The disadvantage of dynamic testing is precisely the advantage of static testing. Static testing does not need to actually run the program under test, does not need to design related test cases, and is easy to automate.
The disadvantage of static testing is that the problems found are often not completely automatically determined as real errors, and manual confirmation is required, so static testing is also called static analysis
Once a deadlock occurs, it will cause the program to fail to terminate normally, and in severe cases, the system will crash
It is very difficult to detect or correct deadlock problems. Because the state space in which threads run is too large, it is impossible to test all possibilities of thread interleaving in the program during detection.
If a deadlock occurs in the program, there are still certain problems in trying to reproduce the deadlock, that is, the deadlock is sporadic
Also, fixing other concurrency issues (eg: data races) introduces new synchronizations that may lead to new deadlocks

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code static analysis based multithread deadlock detection method and system
  • Code static analysis based multithread deadlock detection method and system
  • Code static analysis based multithread deadlock detection method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0055] The method and system of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments of the present invention.

[0056] The basic idea of ​​the present invention is: first, read the software to be tested, perform lexical analysis, syntax analysis and semantic analysis on the source program of the software to be tested, and generate an abstract syntax tree and a control flow graph; secondly, by traversing the abstract syntax tree, generate the Point to the analysis graph to analyze the variable alias relationship; third, analyze the thread class in the program by traversing the abstract syntax tree, and generate a thread class concurrency feature set; fourth, make the program reachable by traversing the control flow graph Analyze, analyze the threads started in the program, and generate a thread concurrency feature set; fifth, analyze the thread concurrency feature set, generate a possession request feature...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a code static analysis based multithread deadlock detection method and system. The method comprises the following steps: analyzing morphology, grammar and semanteme of a software source program to be detected to generate an abstract syntax tree and a control flow graph; generating an orientation analysis graph of the program by traversing the abstract syntax tree, analyzing the thread in the program to generate a thread class concurrence set; performing reachability analysis on the program by traversing the control flow graph, generating and analyzing a thread concurrence set, generating and analyzing a possession request feature set and a lock graph, detecting a potential deadlock to find a door lock set of a lock object, deleting the deadlock in which the lock objects with different threads have the same door lock, and updating the potential deadlock set; deleting impossible deadlock conditions by concurrence and escape analysis to obtain a final deadlock set. By applying the method and system, the condition that two or more threads generate deadlocks can be effectively detected, and the testing accuracy and automation degree are improved.

Description

technical field [0001] The invention relates to software testing technology, in particular to a multi-thread deadlock detection method and system based on code static analysis. Background technique [0002] Software testing is the final review of software requirements analysis, design specifications and coding implementation before the software is put into operation, and is a key step in software quality assurance. Software testing is the process of executing programs in order to find errors. The fundamental purpose of analyzing or executing programs in a controlled software testing environment is to discover and correct potential faults and defects in the software with as little time and manpower as possible. , Improve the quality of the software. [0003] From the perspective of whether the software under test needs to be run during the test process, software testing methods can be divided into two categories: dynamic testing methods and static testing methods. The so-ca...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/36
Inventor 宫云战杨朝红王雅文白哥乐金大海肖庆姚欣洪
Owner BEIJING UNIV OF POSTS & TELECOMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products