Data race detection and evidence generation method based on multithreaded program constraint building

A data competition and program constraint technology, which is applied in the field of data competition detection and evidence generation based on multi-threaded program constraints, and can solve problems such as sensitive thread interleaving, invalid alarms, and high lockset false positives.

Active Publication Date: 2014-10-01
XI AN JIAOTONG UNIV
View PDF3 Cites 24 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

1) The lockset-based method is not sensitive to thread interleaving, but there are false positives, that is, invalid competition
2) The happens-before method only detects data competition on a specific interleaving sequence. Although the detection result is reliable, it is sensitive to thread interleaving
3) The hybrid method combines the advantages of the two, and tries to reduce their respective shortcomings, but also faces problems such as the inability to search for hidden errors, invalid alarms caused by high lockset false positives, etc.

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
  • Data race detection and evidence generation method based on multithreaded program constraint building
  • Data race detection and evidence generation method based on multithreaded program constraint building
  • Data race detection and evidence generation method based on multithreaded program constraint building

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0063] Embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings and examples.

[0064] The program under test is as follows, x and y are shared variables, and thread 0 creates thread 1 and thread 2.

[0065]

[0066] Such as figure 1 As shown, the data competition detection and evidence generation method of the present invention includes the following steps:

[0067] Step S1): Implanting the monitoring code into the program under test to record the execution process of the program. Under the given input, execute the sample program and record the path π=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; then, identify the shared variable access points, including {1 , 5, 7, 9, 10}.

[0068] Step S2): According to the program execution semantics, the state transition and thread interweaving relationship in the execution path are converted into quantifier-free first-order logic expressions, and the constraint model F of the execu...

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 data race detection and evidence generation method based on multithreaded program constraint building. The data race detection problem is converted into a constraint solving problem by building a constraint expression according to the multithreaded program semanteme, a constraint solver is used for detecting possible data races and program execution paths triggering the data races are generated; the data race detection and evidence generation method comprises the steps of firstly, carrying out the instrumentation of the detected program, executing the program and obtaining an execution path, secondly, converting the execution path into a quantifier-free first-order logic expression covering all feasible thread interleaving according to the multithreaded program execution semanteme, thirdly, building a data race candidate set according to the sequential relationship of statements when a data race happens and generating candidate conditions for races, and finally, traversing the candidate set to determine whether the data race exists, and if so, generating a corresponding evidence sequence. The method is capable of finding out all data races in once operation without misinformation; for each data race, the evidence sequence indicating the trigger process of the data race is generated.

Description

technical field [0001] The invention relates to the field of trusted software and software testing, in particular to a method for data competition detection and evidence generation based on multi-threaded program constraints. Background technique [0002] With the popularity of multi-core processors, multi-threading technology has become an indispensable technology for improving CPU utilization in software programming. However, due to the uncertainty of interweaving between threads, some unpredictable behaviors may occur during the execution of multi-threaded programs, which may lead to program errors, such as data competition problems caused by failure to synchronize critical sections. A data race is when two different threads access a memory concurrently without synchronization protection and have at least one write operation. Data races do not necessarily lead to program errors, because some programmers deliberately let programs have data races to improve the efficiency ...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
CPCG06F11/36
Inventor 刘烃张晓东俞乐晨刘沛郑庆华
Owner XI AN JIAOTONG UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products