Methods and systems to identify and reproduce concurrency violations in multi-threaded programs
First Claim
1. A method to identify threads responsible for causing a concurrency violation in a multi-threaded program comprising:
- executing, with a processor, at least one of a plurality of thread controllers inserted into respective threads of a plurality of threads of a multi-threaded program to be debugged, a first thread controller of the plurality of thread controllers controlling an order in which first operations of a first respective thread of the plurality of threads are executed relative to second operations of a second thread of the plurality of threads, the controlling of the order in which first operations are executed relative to second operations including, when a first condition is met in the first thread, the first thread controller causing the first thread to stall, the stalling of the first thread to cause the first condition to remain satisfied while the other threads of the multi-threaded program continue to execute;
causing the concurrency violation to occur based on a determination that a threshold number of a plurality of respective conditions defined in the respective thread controllers have been concurrently satisfied;
based on the occurrence of the concurrency violation, identifying the respective threads that define the respective conditions that have been satisfied as being responsible for causing the concurrency violation; and
when the threshold number of the plurality of respective conditions have not been satisfied within a threshold duration, halting the plurality of threads of the multithreaded program.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods and systems to identify and reproduce concurrency violations in multi-threaded programs are disclosed. An example method disclosed herein comprises determining whether a condition is met and serializing an operation of a first thread of a multi-threaded program relative to an operation of a second thread of the multi-threaded program. The serialization of the operations of the first and second threads results in a concurrency violation or bug thereby causing the multi-threaded program to crash. In this way, the operations of the first and second threads of the multi-threaded program that are responsible for the concurrency violation are identified and can be revised to remove the bug.
-
Citations
12 Claims
-
1. A method to identify threads responsible for causing a concurrency violation in a multi-threaded program comprising:
-
executing, with a processor, at least one of a plurality of thread controllers inserted into respective threads of a plurality of threads of a multi-threaded program to be debugged, a first thread controller of the plurality of thread controllers controlling an order in which first operations of a first respective thread of the plurality of threads are executed relative to second operations of a second thread of the plurality of threads, the controlling of the order in which first operations are executed relative to second operations including, when a first condition is met in the first thread, the first thread controller causing the first thread to stall, the stalling of the first thread to cause the first condition to remain satisfied while the other threads of the multi-threaded program continue to execute; causing the concurrency violation to occur based on a determination that a threshold number of a plurality of respective conditions defined in the respective thread controllers have been concurrently satisfied; based on the occurrence of the concurrency violation, identifying the respective threads that define the respective conditions that have been satisfied as being responsible for causing the concurrency violation; and when the threshold number of the plurality of respective conditions have not been satisfied within a threshold duration, halting the plurality of threads of the multithreaded program. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A tangible computer readable medium comprising computer readable instructions which, when executed, cause a computer to at least:
-
control an order in which first operations of a first thread of a multi-threaded program to be debugged are executed relative to operations of a second thread of the multi-threaded program by causing the first thread to stall upon a first determination that a first condition inserted into the first thread has been satisfied, the stalling of the first thread to cause the first condition to remain satisfied while the other threads of the multi-threaded program continue to execute; cause a concurrency violation to occur based on a second determination that a threshold number of a plurality of respective conditions defined in respective threads of the multi-threaded program have been concurrently satisfied; based on the occurrence of the concurrency violation, identify the respective threads that define the respective conditions that have been satisfied as being responsible for causing the concurrency violation; and halt the plurality of threads of the multi-threaded program based on a third determination that the threshold number of the respective conditions have not been satisfied within a threshold duration. - View Dependent Claims (7, 8)
-
-
9. An apparatus to identify threads responsible for causing a concurrency violation in a multi-threaded computer program, the apparatus comprising:
-
memory including computer readable instructions; and a processor to execute the computer readable instructions, the instructions, when executed to cause the processor to at least; control an order in which first operations of a first thread of a multi-threaded program are executed relative to operations of a second thread of the multi-threaded program by causing the first thread to stall upon a first determination that a first condition inserted into the first thread has been satisfied, the stalling of the first thread to cause the first condition to remain satisfied while the other threads of the multi-threaded program continue to execute; cause a concurrency violation to occur based on a second determination that a threshold number of a plurality of respective conditions defined in respective threads of the multi-threaded program have been concurrently satisfied; based on the occurrence of the concurrency violation, identify the respective threads that define the respective conditions that have been satisfied as being responsible for causing the concurrency violation; and halt the plurality of threads of the multi-threaded program based on a third determination that the threshold number of the respective conditions have not been satisfied within a threshold duration. - View Dependent Claims (10, 11, 12)
-
Specification