IP Library Granted Patent US 9,575,831
Granted Patent B2
US 9,575,831 · App. 14/488,036 · Granted Feb 21, 2017

Detecting the use of stale data values due to weak consistency

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,575,831
App. No.
14/488,036
Granted
Feb 21, 2017
Kind
B2
Abstract

An apparatus and method detect the use of stale data values due to weak consistency between parallel threads on a computer system. A consistency error detection mechanism uses object code injection to build a consistency error detection table during the operation of an application. When the application is paused, the consistency error detection mechanism uses the consistency error detection table to detect consistency errors where stale data is used by the application. The consistency error detection mechanism alerts the user/programmer to the consistency errors in the application program.

Claims (35)

1. A method for detecting the use of stale data in an application, the method comprising the steps of:

building a consistency error detection table during the execution of the application, wherein the consistency error detection table is built with object code injected into the application; and

detecting the use of stale data due to weak consistency by analyzing the consistency error detection table.

2. The method of claim 1 wherein the step of detecting the use of stale data due to weak consistency by analyzing the consistency error detection table is performed while the application is paused.

3. The method of claim 1 further comprising the step of determining a consistency error where there is a match between a thread using a stored address to store a stored value and a thread loading a load value from the stored address at a later point in time where the load value is not consistent with the stored value.

4. The method of claim 1 wherein the step of detecting the use of stale data further comprises the steps of:

creating a first list of instances where a first thread stores a store value at an address and then stores that address;

creating a second list of instances where a second thread loads an address and then loads a load value from within that address;

comparing the first list with the second list to find a match where the store of the store value happens before the load of the load value, and

storing an error where there is a match in the compare and store value is not consistent with the load value.

5. The method of claim 1 further comprising the step of alerting the user to an error in the application where the application uses stale data.

6. The method of claim 1 wherein the consistency error detection table comprises records for a plurality of application threads where each record comprises a time, an instruction, an address and a value stored at the address.

7. A method for detecting the use of stale data in an application, the method comprising the steps of:

instrumenting at least two threads of the application by object code injection with additional code to build a consistency error detection table;

executing the application with the additional code to build the consistency error detection table;

pausing the application;

detecting the use of stale data due to weak consistency by analyzing the consistency error detection table comprising the steps of:

creating a first list of instances where a first thread stores a store value at an address and then stores that address;

creating a second list of instances where a second thread loads an address and then loads a load value from within that address;

comparing the first list with the second list to find a match where the store of the store value happens before the load of the load value,

storing an error where there is a match in the compare and the store value is not consistent with the load value;

alerting the user to an error in the application where the application uses stale data; and

wherein the consistency error detection table comprises records for a plurality of application threads where each record comprises a time, an instruction, an address and a value stored at the address.

8. A method for detecting the use of stale data in an application, the method comprising the steps of:

building a consistency error detection table during the execution of the application;

detecting the use of stale data due to weak consistency by analyzing the consistency error detection table; and

determining a consistency error where there is a match between a thread using a stored address to store a stored value and a thread loading a load value from the stored address at a later point in time where the load value is not consistent with the stored value.

9. The method of claim 8 wherein the step of detecting the use of stale data due to weak consistency by analyzing the consistency error detection table is performed while the application is paused.

10. The method of claim 8 wherein the step of detecting the use of stale data further comprises the steps of:

creating a first list of instances where a first thread stores a store value at an address and then stores that address;

creating a second list of instances where a second thread loads an address and then loads a load value from within that address;

comparing the first list with the second list to find a match where the store of the store value happens before the load of the load value, and

storing an error where there is a match in the compare and store value is not consistent with the load value.

11. The method of claim 8 further comprising the step of alerting the user to an error in the code where the code uses stale data.

12. The method of claim 8 wherein the consistency error detection table comprises records for a plurality of application threads where each record comprises a time, an instruction, an address and a value stored at the address.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 15, 2021
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: AIRBNB, INC.
Reel/Frame 056427/0193 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 16, 2014
From: BATES, CARY L.; HELGESON, LEE; KING, JUSTIN K.; SCHLICHT, MICHELLE A.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 033752/0969 →