Crash consistency fault detection method and system for persistent memory concurrent programs

By performing compiler instrumentation and input parameter generation for persistent memory concurrent programs, controlling the memory access timing of write first and then reading, combined with thread scheduling and feedback mechanisms, the problem of existing tools being unable to detect crash consistency faults of persistent memory concurrent programs is solved. , achieving efficient and accurate fault detection and low false alarm rate.

CN113868124BActive Publication Date: 2024-10-22HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111078342.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2024-10-22
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

Existing fault detection tools cannot effectively detect crash consistency faults in persistent memory concurrent programs, especially under multi-threaded concurrent execution, and cannot support crash consistency fault detection in persistent memory.

Method used

The compiler is used to instrument persistent memory concurrent programs, generate input parameter sets, control the memory access timing of write first and then read, determine whether there are unpersisted data write operations in the memory access mode, and combine thread scheduling and feedback mechanisms. Detect and verify crash consistency failures.

Benefits of technology

It achieves efficient and accurate detection of consistency faults in persistent memory concurrent programs, reduces the false alarm rate, supports crash consistency fault detection under concurrent execution, and improves detection coverage and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113868124B_ABST
    Figure CN113868124B_ABST
Patent Text Reader

Abstract

The present invention discloses a crash consistency fault detection method and system for a persistent memory concurrent program, comprising: S1, inserting memory access instructions and persistent memory related interfaces in a persistent memory concurrent program to be tested by a compiler to obtain an executable program; S2, generating multiple input parameters as the input of the executable program to form an input parameter set according to the input rule of the persistent memory concurrent program to be tested; S3, respectively obtaining the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under each input parameter, and the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program after controlling the executable program to generate a write-before-read memory access timing; and judging whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode, and if so, determining it as a consistency fault; the present invention can efficiently and accurately detect consistency faults in persistent memory concurrent programs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer data storage, and more specifically, to a crash consistency fault detection method and system for persistent memory concurrent programs. Background Art

[0002] Unlike traditional memory technology DRAM, the new persistent memory technology has high density and near-zero leakage current, and is expected to significantly improve the performance of storage systems. Intel released its first generation of persistent memory products in 2019. Its single persistent memory capacity can reach 512GB, and each CPU can support up to 6 persistent memories, with a total capacity of up to 3TB, and the cost per GB is lower than that of large-capacity DRAM. However, under the asynchronous memory refresh (Asynchronous DRAM Refresh, ADR) mechanism of the persistent memory platform, the volatility of the on-chip cache (data is lost after power failure) and the non-volatility of the persistent memory require that the data stored in it can be restored to an overall consistent state after restart, which is called crash consistency. The crash consistency of persistent memory requires data to be persisted to persistent memory in a certain order, which requires the program to persist data correctly in order, so this programming mode is prone to errors.

[0003] Existing fault detection tools for persistent memory usually detect persistence operations in serial programs, without considering the many possible memory access timings under multi-threaded concurrent execution in concurrent programs, and thus miss consistency faults hidden in specific memory access timings. Current fault detection tools for DRAM concurrent programs do not consider the persistence state of data, and therefore do not support crash consistency fault detection under persistent memory. Summary of the invention

[0004] In view of the above defects or improvement needs of the prior art, the present invention provides a crash consistency fault detection method for persistent memory concurrent programs, which aims to support persistent memory concurrent programs, search for memory access timing under concurrent execution, and efficiently and accurately detect consistency faults in persistent memory concurrent programs.

[0005] In order to achieve the above object, in a first aspect, the present invention proposes a crash consistency fault detection method for a persistent memory concurrent program, comprising the following steps:

[0006] S1. Use a compiler to insert memory access instructions and persistent memory related interfaces in the persistent memory concurrent program to be tested to obtain an executable program; wherein the insert code is used for crash consistency fault detection;

[0007] S2. Generate multiple input parameters as inputs of the executable program according to the input rules of the persistent memory concurrent program to be tested, forming an input parameter set;

[0008] S3, respectively obtaining the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program under the input parameters in the input parameter set, and the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program after the executable program is controlled by the plug-in code to generate a write-before-read memory access timing; and in the above process, determining by the plug-in code whether there is a mode of writing persistent memory based on non-persistent data in each obtained memory access mode, and if so, determining it as a consistency failure;

[0009] Among them, the access mode corresponding to the persistent memory address is in the form of<Ix,Iy,Px,Py> , Ix and Iy represent two consecutive instructions that access the persistent memory address, Px represents the persistence state of the data after executing instruction Ix, and Py represents the persistence state of the data after executing instruction Iy; the mode of writing persistent memory based on non-persistent data is: when Ix is a write instruction, Px is the data in a non-persistent state after executing instruction Ix, and Iy is a read instruction, an operation of writing any data that has data dependency on the data obtained by executing instruction Iy to the persistent memory.

[0010] Further preferably, the above step S2 includes the following steps:

[0011] S21. Randomly generate input parameters according to the input rules of the persistent memory concurrent program to be tested, and record them as seeds.

[0012] S22, input the seed into the executable program, start running the executable program, and record the code branches executed during the running process through the stub code;

[0013] S23, determining whether all code branches in the persistent memory concurrent program to be tested have been executed, if so, the operation ends; otherwise, go to step S24;

[0014] S24. If a new code branch is executed under the currently input seed, save the current seed to the input parameter set and go to step S22; otherwise, update the seed by any of the following methods: modifying the parameter value in the seed, adding parameters in the seed, deleting parameters in the seed, and adjusting the order of parameters in the seed, and go to step S22.

[0015] Further preferably, the method for updating the seed by modifying the parameter value in the seed includes: changing the parameter values ​​of different operations in the seed to the same value, so as to increase the memory access mode for accessing the same data in the application.

[0016] Further preferably, when no new code branch appears after the seed is updated, a large number of data insertion operations are added to the seed, wherein the parameter values ​​of the insertion operations are different, so as to trigger the capacity expansion mechanism of the application and execute the relevant code branches.

[0017] Further preferably, the above step S3 comprises: for each input parameter in the input parameter set, performing the following steps respectively:

[0018] S31. Under the input parameter input in the input parameter set, run the executable program to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and determine whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode through the stub code. If so, it is determined to be a consistency failure, and the function call stack and the corresponding persistent memory mapping file are saved when the mode of writing persistent memory based on non-persistent data appears in the executable program;

[0019] S32, selecting a persistent memory address whose access times are greater than a preset access times from among the persistent memory addresses accessed by each memory access instruction in the above executable program, to obtain a selected persistent memory address set;

[0020] S33. For the selected persistent memory addresses in the selected persistent memory address set, perform the following operations respectively:

[0021] For each read and write instruction corresponding to the selected persistent memory address, a delay is added before each read instruction corresponding to the selected persistent memory address through the stub code until the corresponding write instruction is completed or the delay time reaches a preset duration, so as to realize a memory access timing of write first and read later; under the above input parameter input, the executable program is re-run to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and the stub code is used to determine whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode. If so, it is determined to be a consistency failure, and the function call stack and the corresponding persistent memory mapping file are saved when the mode of writing persistent memory based on non-persistent data appears in the executable program.

[0022] Further preferably, when a delay is added before the read instruction:

[0023] When all threads in the executable program are stuck in reading instructions, a thread is randomly selected to skip the delay of the current and subsequent read instructions;

[0024] When some threads in the executable program are stuck in reading instructions and the waiting time exceeds a preset waiting threshold, the delay of the current reading instruction is disabled, and the delay of the reading instruction is skipped in the subsequent running process.

[0025] Further preferably, the memory access mode corresponding to the persistent memory address at runtime is recorded via a hash table and a bitmap in the shared memory.

[0026] Further preferably, the above crash consistency fault detection method for a concurrent program in persistent memory further includes step S4 performed after step S3;

[0027] Step S4 includes: for each consistency failure detected in step S3, performing the following operations respectively:

[0028] Restart the executable program, load the persistent memory mapping file corresponding to the consistency failure, and use the instrumentation code to detect whether the data generated by the executable program will overwrite the inconsistent data generated in the mode of writing persistent memory based on non-persistent data when the consistency failure occurred before. If it can be overwritten, the consistency failure is determined to be a false alarm; otherwise, it is confirmed that the consistency failure will cause a program failure, and a corresponding fault detection report is generated.

[0029] In a second aspect, the present invention provides a crash consistency fault detection system for a persistent memory concurrent program, comprising:

[0030] The instrumentation module is used to instrument the memory access instructions and persistent memory related interfaces in the persistent memory concurrent program to be tested through the compiler to obtain an executable program; the instrumentation code is used for crash consistency fault detection;

[0031] An input parameter generation module, used to generate multiple input parameters as inputs of the executable program according to the input rules of the persistent memory concurrent program to be tested, so as to form an input parameter set;

[0032] A fault detection module is used to respectively obtain the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program under the input parameters in the input parameter set, and the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program after the executable program is controlled by the plug-in code to generate a write-before-read memory access timing sequence; and in the above process, the plug-in code is used to determine whether there is a mode of writing persistent memory based on non-persistent data in each obtained memory access mode, and if so, it is determined to be a consistency fault;

[0033] Among them, the access mode corresponding to the persistent memory address is in the form of<Ix,Iy,Px,Py> , Ix and Iy represent two consecutive instructions that access the persistent memory address, Px represents the persistence state of the data after executing instruction Ix, and Py represents the persistence state of the data after executing instruction Iy; the mode of writing persistent memory based on non-persistent data is: when Ix is a write instruction, Px is the data in a non-persistent state after executing instruction Ix, and Iy is a read instruction, an operation of writing any data that has data dependency on the data obtained by executing instruction Iy to the persistent memory.

[0034] In a third aspect, the present invention further provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the crash consistency fault detection method for persistent memory concurrent programs provided in the first aspect of the present invention.

[0035] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0036] 1. The present invention provides a crash consistency fault detection method for a concurrent program with persistent memory, which detects crash consistency faults of a concurrent program with persistent memory by detecting a memory access mode corresponding to a persistent memory address accessed by each memory access instruction in an executable program, and controlling the executable program to generate a write-before-read memory access timing by inserting code to determine whether there is a mode of writing persistent memory based on non-persistent data in the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program, so as to support concurrent programs with persistent memory. In the uncertain timing of concurrent execution, the memory access mode of write-before-read is preferentially examined by controlling the timing, triggering a non-persistent data read operation, and accurately detecting the inconsistency problem between non-persistent data and persistent data having data dependency on the non-persistent data during the running of the concurrent program, thereby efficiently and accurately detecting consistency faults in concurrent programs with persistent memory.

[0037] 2. The crash consistency fault detection method provided by the present invention obtains an executable program by inserting memory access instructions and persistent memory related interfaces in the persistent memory concurrent program to be tested through the compiler; and generates multiple input parameters as the input of the executable program according to the input rules of the persistent memory concurrent program to be tested; only a small amount of code needs to be modified and the input rules of the program need to be provided to automatically perform crash consistency fault detection, and the operation is simple.

[0038] 3. The crash consistency fault detection method provided by the present invention generates an input parameter set according to the input rules of the persistent memory concurrent program to be tested, which can cover the execution scenarios of all code branches in the persistent memory concurrent program to be tested. The test scenarios are comprehensive and the fault detection coverage is high.

[0039] 4. The crash consistency fault detection method provided by the present invention adopts thread scheduling technology and consistency detection technology with feedback mechanism. The detection method can efficiently search for crash consistency faults in different concurrency situations, greatly reducing fault detection time.

[0040] 5. The crash consistency fault detection method provided by the present invention verifies each consistency fault one by one after detecting the consistency fault, excludes the consistency fault that can be automatically recovered in the restart phase, and effectively reduces the false alarm rate of fault detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flow chart of a crash consistency fault detection method for a persistent memory concurrent program provided in Example 1 of the present invention;

[0042] Figure 2 A flowchart of a write operation based on non-persistent data provided in Example 1 of the present invention;

[0043] Figure 3 A timing flow chart for controlling concurrent persistent memory accesses provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0045] Embodiment 1,

[0046] A crash-consistent fault detection method for concurrent programs with persistent memory, e.g. Figure 1 As shown, the following steps are included:

[0047] S1. Use a compiler to insert memory access instructions and persistent memory related interfaces in the persistent memory concurrent program to be tested to obtain an executable program; wherein the insert code is used for crash consistency fault detection;

[0048] S2. Generate multiple input parameters as inputs of the executable program according to the input rules of the persistent memory concurrent program to be tested, forming an input parameter set;

[0049] Specifically, the above step S2 includes the following steps:

[0050] S21. Randomly generate input parameters according to the input rules of the persistent memory concurrent program to be tested, and record them as seeds.

[0051] S22, input the seed into the executable program, start running the executable program, and record the code branches executed during the running process through the stub code;

[0052] S23, determining whether all code branches in the persistent memory concurrent program to be tested have been executed, if so, the operation ends; otherwise, go to step S24;

[0053] S24. If a new code branch is executed under the currently input seed, save the current seed to the input parameter set and go to step S22; otherwise, update the seed by any of the following methods: modifying the parameter value in the seed, adding parameters in the seed, deleting parameters in the seed, and adjusting the order of parameters in the seed, and go to step S22.

[0054] Preferably, the method for updating the seed by modifying the parameter value in the seed includes: changing the parameter values ​​of different operations in the seed to the same value, so as to increase the memory access mode for accessing the same data in the application.

[0055] It should be noted that, if no new code branch appears after the seed is updated, a large number of data insertion operations are added to the seed, wherein the parameter values ​​of the insertion operations are different, so as to trigger the application's capacity expansion mechanism and execute the relevant code branches.

[0056] S3, respectively obtaining the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program under the input parameters in the input parameter set, and the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program after the executable program is controlled by the plug-in code to generate a write-before-read memory access timing; and in the above process, determining by the plug-in code whether there is a mode of writing persistent memory based on non-persistent data in each obtained memory access mode, and if so, determining it as a consistency failure;

[0057] Among them, the access mode corresponding to the persistent memory address is in the form of<Ix,Iy,Px,Py> , Ix and Iy represent two consecutive instructions that access the persistent memory address, Px represents the persistence state of the data after executing instruction Ix, and Py represents the persistence state of the data after executing instruction Iy; the mode of writing persistent memory based on non-persistent data is: when Ix is a write instruction, Px is the data in a non-persistent state after executing instruction Ix, and Iy is a read instruction, an operation of writing any data that has data dependency on the data obtained by executing instruction Iy to the persistent memory.

[0058] Since Ix and Iy are two consecutive instructions for the same persistent memory address, the non-persistent data m written by the write instruction Ix has a non-persistent state Px, so the read instruction Iy can read m, and the state Py of m is still non-persistent. Therefore, based on the non-persistent data m read by Iy, the operation of writing any data that has data dependency on m to the persistent memory can be determined as a consistency failure. Specifically, if Figure 2As shown, instructions for reading non-persistent data are detected at runtime, and then instructions for writing persistent memory based on the non-persistent data are further detected. If instructions for writing persistent memory based on non-persistent data are detected, it is determined to be a consistency failure, and the function call stack and the corresponding persistent memory mapping file are saved when the mode of writing persistent memory based on non-persistent data appears in the executable program.

[0059] Specifically, step S3 includes: for each input parameter in the input parameter set, performing the following steps respectively:

[0060] S31. Under the input parameter input in the input parameter set, run the executable program to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and determine whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode through the stub code. If so, it is determined to be a consistency failure, and the function call stack and the corresponding persistent memory mapping file are saved when the mode of writing persistent memory based on non-persistent data appears in the executable program;

[0061] Specifically, each time a memory access mode corresponding to a persistent memory address is obtained, the stub code is used to determine whether the memory access mode is a mode of writing persistent memory based on non-persistent data. If so, the current function call stack and the corresponding persistent memory mapping file are saved.

[0062] S32, selecting a persistent memory address whose access times are greater than a preset access times from among the persistent memory addresses accessed by each memory access instruction in the above executable program, to obtain a selected persistent memory address set;

[0063] In this embodiment, the number of accesses to each persistent memory address when running the executable program is counted respectively, and the number of accesses to each persistent memory address is sorted from large to small, and the first k persistent memory addresses are selected to form the selected persistent memory address set; wherein, the number of accesses corresponding to the kth persistent memory address is the above-mentioned preset number of accesses; specifically, in this embodiment, the value of k is 10.

[0064] S33. For the selected persistent memory addresses in the selected persistent memory address set, perform the following operations respectively:

[0065] For each read and write instruction corresponding to the selected persistent memory address, a delay is added before each read instruction corresponding to the selected persistent memory address through the plug-in code until the corresponding write instruction is completed or the delay time reaches the preset duration t, so as to realize the memory access timing of writing first and reading later; in this embodiment, the value of t is the average time required to run the program under test under 3 different small-scale input parameters; under the above input parameter input, the executable program is re-run to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and the plug-in code is used to determine whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode. If so, it is determined to be a consistency fault, and the function call stack and the corresponding persistent memory mapping file are saved when the mode of writing persistent memory based on non-persistent data appears in the executable program. Among them, the memory access mode corresponding to the persistent memory address at runtime is recorded through the hash table and bitmap in the shared memory.

[0066] Specifically, in order to ensure efficient testing of the program, such as Figure 3 As shown, the read and write instructions are grouped by address, and each round of testing adds a delay to the read and write instructions in the same group; and when a delay is added before the read instruction:

[0067] Selective pass: When all threads in the executable program are stuck in reading instructions, a thread is randomly selected to skip the delay of the current and subsequent read instructions;

[0068] Timer: When some threads in the executable program are stuck in reading instructions and the waiting time exceeds the above preset time length t, the delay of the current reading instruction is disabled and the delay of the reading instruction is skipped in the subsequent running process.

[0069] Preferably, the above crash consistency fault detection method for a concurrent program in persistent memory further includes step S4 performed after step S3;

[0070] Step S4 includes: for each consistency failure detected in step S3, performing the following operations respectively:

[0071] Restart the executable program, load the persistent memory mapping file corresponding to the consistency failure, and use the instrumentation code to detect whether the data generated by the executable program will overwrite the inconsistent data generated in the mode of writing persistent memory based on non-persistent data when the consistency failure occurred before. If it can be overwritten, the consistency failure is determined to be a false alarm; otherwise, it is confirmed that the consistency failure will cause a program failure, and a corresponding fault detection report is generated.

[0072] In summary, the present invention inserts memory access instructions and persistent memory related interfaces in concurrent programs through a compiler, and the inserted program is used for fault detection; the input generator automatically generates input that conforms to the grammatical rules of the executable program according to the input rules of the concurrent program; the executable program is run with the generated input, and the timing of the concurrent program is controlled by the thread scheduling module, and the memory access timing of writing first and reading later at the same address of the persistent memory is preferentially tested; if a mode of writing persistent memory based on non-persistent data is detected, it is determined to be a consistency fault, and the current function call stack and the persistent memory mapping file are saved, and the detected memory access timing is fed back to the thread scheduling module; finally, after the fault is detected, verification is performed, and the test program is restarted to eliminate the consistency fault that is automatically recovered in the restart phase, and reduce the false alarm rate of fault detection. The present invention is aimed at persistent memory concurrent programs, and can efficiently and accurately detect consistency faults hidden in concurrent programs through concurrent timing control, persistent memory access mode detection and fault verification.

[0073] It should be noted that the specific application scenarios of the present invention include but are not limited to application scenarios such as persistent concurrent indexes, persistent memory databases, and persistent memory file systems.

[0074] Embodiment 2,

[0075] A crash consistency fault detection system for persistent memory concurrent programs, comprising:

[0076] The stub module is used to stub the memory access instructions and persistent memory related interfaces in the persistent memory concurrent program to be tested through the compiler to obtain an executable program; the stub code is used for crash consistency fault detection;

[0077] An input parameter generation module, used to generate multiple input parameters as inputs of the executable program according to the input rules of the persistent memory concurrent program to be tested, so as to form an input parameter set;

[0078] A fault detection module is used to respectively obtain the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program under the input parameters in the input parameter set, and the memory access modes corresponding to the persistent memory addresses accessed by each memory access instruction in the executable program after the executable program is controlled by the plug-in code to generate a write-before-read memory access timing sequence; and in the above process, the plug-in code is used to determine whether there is a mode of writing persistent memory based on non-persistent data in each obtained memory access mode, and if so, it is determined to be a consistency fault;

[0079] Among them, the access mode corresponding to the persistent memory address is in the form of<Ix,Iy,Px,Py> , Ix and Iy represent two consecutive instructions that access the persistent memory address, Px represents the persistence state of the data after executing instruction Ix, and Py represents the persistence state of the data after executing instruction Iy; the mode of writing persistent memory based on non-persistent data is: when Ix is a write instruction, Px is the data in a non-persistent state after executing instruction Ix, and Iy is a read instruction, an operation of writing any data that has data dependency on the data obtained by executing instruction Iy to the persistent memory.

[0080] The relevant technical features are the same as those in Example 1 and will not be elaborated here.

[0081] Embodiment 3,

[0082] A machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the crash consistency fault detection method for persistent memory concurrent programs provided in Example 1 of the present invention.

[0083] The relevant technical features are the same as those in Example 1 and will not be elaborated here.

[0084] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A crash consistency fault detection method for a concurrent program in persistent memory, characterized in that: The following steps are involved: S1. Use the compiler to insert memory access instructions and persistent memory related interfaces in the persistent memory concurrent program to be tested to obtain an executable program; the inserted code is used for crash consistency fault detection; S2. Generate multiple input parameters as inputs of the executable program according to the input rules of the persistent memory concurrent program to be tested, forming an input parameter set; S3, respectively obtaining the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the input parameters in the input parameter set, and the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program after the executable program is controlled by the plug-in code to generate a write-before-read memory access timing; and in the above process, judging by the plug-in code whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode obtained, and if so, determining it as a consistency failure; The access mode corresponding to the persistent memory address is in the form of<Ix,Iy,Px,Py> , Ix and Iy represent two consecutive instructions for accessing the persistent memory address, Px represents the persistent state of the data after executing instruction Ix, and Py represents the persistent state of the data after executing instruction Iy; the mode of writing persistent memory based on non-persistent data is: when Ix is a write instruction, Px is the data in a non-persistent state after executing instruction Ix, and Iy is a read instruction, an operation of writing any data that has data dependency on the data obtained by executing instruction Iy to persistent memory; The step S3 comprises: for each input parameter in the input parameter set, performing the following steps respectively: S31. Run the executable program under the input parameter input in the input parameter set to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and determine through the plug-in code whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode. If so, determine it as a consistency failure, and save the function call stack and the corresponding persistent memory mapping file when the mode of writing persistent memory based on non-persistent data appears in the executable program; S32, selecting a persistent memory address whose access times are greater than a preset access times among the persistent memory addresses accessed by each memory access instruction in the executable program, to obtain a selected persistent memory address set; S33. For the selected persistent memory addresses in the selected persistent memory address set, perform the following operations respectively: For each read and write instruction corresponding to the selected persistent memory address, the stub code is used to add a delay before each read instruction corresponding to the selected persistent memory address until the corresponding write instruction is completed or the delay time reaches a preset duration, so as to realize a memory access timing of write first and read later; under the input parameter input, the executable program is re-run to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and the stub code is used to determine whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode; if so, it is determined to be a consistency failure, and the function call stack and the corresponding persistent memory mapping file are saved when the mode of writing persistent memory based on non-persistent data appears in the executable program.

2. The crash consistency fault detection method according to claim 1, characterized in that: The step S2 comprises the following steps: S21. Randomly generate input parameters according to the input rules of the persistent memory concurrent program to be tested, and record them as seeds; S22, inputting the seed into the executable program, starting to run the executable program, and recording the code branches executed during the running process through the stub code; S23, determining whether all code branches in the persistent memory concurrent program to be tested have been executed, if so, the operation ends; otherwise, go to step S24; S24. If a new code branch is executed under the currently input seed, the current seed is saved in the input parameter set and the process goes to step S22; otherwise, the seed is updated by any one of modifying the parameter value in the seed, adding the parameter in the seed, deleting the parameter in the seed, and adjusting the parameter order in the seed, and the process goes to step S22.

3. The crash consistency fault detection method according to claim 2, characterized in that: The method for updating the seed by modifying the parameter value in the seed includes: changing the parameter values ​​of different operations in the seed to the same value, so as to increase the memory access mode for accessing the same data in the application.

4. The crash consistency fault detection method according to claim 2, characterized in that: If no new code branch appears after the seed is updated, a large number of data insertion operations are added to the seed, where the parameter values ​​of the insertion operations are different to trigger the application's capacity expansion mechanism and execute related code branches.

5. The crash consistency fault detection method according to claim 1, characterized in that: When adding a delay before the read instruction: When all threads in the executable program are stuck in reading instructions, randomly selecting a thread to skip delays of current and subsequent reading instructions; When some threads in the executable program are stuck in reading instructions and the waiting time exceeds a preset waiting threshold, the delay of the current reading instruction is disabled, and the delay of the reading instruction is skipped in the subsequent running process.

6. The crash consistency fault detection method according to claim 1, characterized in that: The memory access mode corresponding to the persistent memory address at runtime is recorded through the hash table and bitmap in the shared memory.

7. The crash consistency fault detection method according to any one of claims 1 to 6, characterized in that: Also includes step S4 performed after step S3; The step S4 comprises: for each consistency failure detected in the step S3, performing the following operations respectively: Restart the executable program, load the persistent memory mapping file corresponding to the consistency failure, and use the plug-in code to detect whether the data generated by the executable program will overwrite the inconsistent data generated in the mode of writing persistent memory based on non-persistent data when the consistency failure occurred before. If it can be overwritten, it is determined that the consistency failure is a false alarm; otherwise, it is determined that the consistency failure will cause a program failure, and a corresponding fault detection report is generated.

8. A crash consistency fault detection system for concurrent programs in persistent memory, characterized in that: include: The instrumentation module is used to instrument the memory access instructions and persistent memory related interfaces in the persistent memory concurrent program to be tested through the compiler to obtain an executable program; the instrumentation code is used for crash consistency fault detection; An input parameter generation module, used to generate a plurality of input parameters as inputs of the executable program according to the input rules of the persistent memory concurrent program to be tested, so as to form an input parameter set; A fault detection module is used to respectively obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the input parameters in the input parameter set, and the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program after the executable program is controlled by the plug-in code to generate a write-before-read memory access timing sequence; and in the above process, the plug-in code is used to determine whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode obtained, and if so, it is determined to be a consistency fault; The access mode corresponding to the persistent memory address is in the form of<Ix,Iy,Px,Py> , Ix and Iy represent two consecutive instructions for accessing the persistent memory address, Px represents the persistent state of the data after executing instruction Ix, and Py represents the persistent state of the data after executing instruction Iy; the mode of writing persistent memory based on non-persistent data is: when Ix is a write instruction, Px is the data in a non-persistent state after executing instruction Ix, and Iy is a read instruction, an operation of writing any data that has data dependency on the data obtained by executing instruction Iy to persistent memory; The fault detection module specifically performs the following operations: for each input parameter in the input parameter set, respectively perform the following steps: S31. Run the executable program under the input parameter input in the input parameter set to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and determine through the plug-in code whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode. If so, determine it as a consistency failure, and save the function call stack and the corresponding persistent memory mapping file when the mode of writing persistent memory based on non-persistent data appears in the executable program; S32, selecting a persistent memory address whose access times are greater than a preset access times among the persistent memory addresses accessed by each memory access instruction in the executable program, to obtain a selected persistent memory address set; S33. For the selected persistent memory addresses in the selected persistent memory address set, perform the following operations respectively: For each read and write instruction corresponding to the selected persistent memory address, the stub code is used to add a delay before each read instruction corresponding to the selected persistent memory address until the corresponding write instruction is completed or the delay time reaches a preset duration, so as to realize a memory access timing of write first and read later; under the input parameter input, the executable program is re-run to obtain the memory access mode corresponding to the persistent memory address accessed by each memory access instruction in the executable program under the current running environment, and the stub code is used to determine whether there is a mode of writing persistent memory based on non-persistent data in each memory access mode; if so, it is determined to be a consistency failure, and the function call stack and the corresponding persistent memory mapping file are saved when the mode of writing persistent memory based on non-persistent data appears in the executable program.

9. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the crash consistency fault detection method according to any one of claims 1 to 7.