Conference Paper

Run-time detection of potential deadlocks for programs with locks, semaphores, and condition variables.

DOI: 10.1145/1147403.1147413 Conference: Proceedings of the 4th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, held in conjunction with the ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2006), PADTAD 2006, Portland, Maine, USA, July 17, 2006
Source: DBLP

ABSTRACT Concurrent programs are notorious for containing errors that are dicult to reproduce and diagnose. A common kind of concurrency error is deadlock, which occurs when some threads are permanently blocked. This paper denes a run- time notion of potential deadlock in programs with locks, semaphores, and condition variables. Informally, an execu- tion has potential for a deadlock if some feasible permuta- tion of the execution results in a deadlock. Feasibility of a permutation is determined by ordering constraints amongst events in the execution. Previous work on run-time detec- tion of potential deadlocks are for programs that use locks. This paper presents run-time algorithms to detect potential deadlocks in programs that use locks (block structured as well as non block structured), semaphores, and condition variables.

15 Reads
  • Source
    • "Another often used approach is to use dynamic analysis that tries to extrapolate the witnessed behaviour of a program and warn about errors whose occurrence under different scheduling circumstances seems possible from the observed behaviour of the program. There exist dynamic analysers for various concurrency errors like data races [13] [7], atomicity violations [9], or deadlocks [1]. A problem is that the extrapolation may introduce false alarms. "
    [Show abstract] [Hide abstract]
    ABSTRACT: This paper aims at allowing noise-based testing and dynamic analysis of multi-threaded C/C++ programs on the binary level. First, several problems of monitoring multi-threaded C/C++ programs on the binary level are discussed together with their possible solutions. Next, a brief overview of noise injection techniques is provided along with a proposal of improving them using a fine-grained combination of several noise injection techniques within a single program. The proposed ideas have been implemented in a prototype way using the PIN framework for Intel binaries and tested on a~set of multi-threaded C/C++ programs. The obtained experimental evidence justifying the proposed solutions and illustrating the effect of various noise settings in the context of multi-threaded C/C++ programs is discussed.
  • Source
    • "Yet, in the extensive literature on deadlock detection only little work (e.g. [1] [10]) addresses communication deadlocks. We initially set out to devise a dynamic analysis to predict communication deadlocks by checking an idiom analogous to that for resource deadlocks. "
    [Show abstract] [Hide abstract]
    ABSTRACT: We present an effective dynamic analysis for finding a broad class of deadlocks, including the well-studied lock-only deadlocks as well as the less-studied, but no less widespread or insidious, deadlocks involving condition variables. Our analysis consists of two stages. In the first stage, our analysis observes a multi-threaded program execution and generates a simple multi-threaded program, called a trace program, that only records operations observed during the execution that are deemed relevant to finding deadlocks. Such operations include lock acquire and release, wait and notify, thread start and join, and change of values of user-identified synchronization predicates associated with condition variables. In the second stage, our analysis uses an off-the-shelf model checker to explore all possible thread interleavings of the trace program and check if any of them deadlocks. A key advantage of our technique is that it discards most of the program logic which usually causes state-space explosion in model checking, and retains only the relevant synchronization logic in the trace program, which is sufficient for finding deadlocks. We have implemented our analysis for Java, and have applied it to twelve real-world multi-threaded Java programs. Our analysis is effective in practice, finding thirteen previously known as well as four new deadlocks.
    Proceedings of the 18th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2010, Santa Fe, NM, USA, November 7-11, 2010; 07/2010
  • Source
    • "Even so, Tanenbaum remarks [23] that even a quarter century after their introduction, research into semaphores continues. This is still true, for example, Agarwal and Stoller [1] examines potential deadlock detection in programs using semaphores. We will restrict our attention to semaphores as commonly implemented; that is the basic P and V primitives used for mutual exclusion, with a FIFO queue holding blocked processes to guarantee fairness [19]. "
    [Show abstract] [Hide abstract]
    ABSTRACT: Modern multiprocessor architectures have exacerbated problems of coordinating access to shared data, in particular as regards to the possibility of deadlock. For example semaphores, one of the most basic synchronization primitives, present difficulties. Djikstra defined semaphores to solve the problem of mutual exclusion. Practical implementation of the concept has, however, produced semaphores that are prone to deadlock, even while the original definition is theoretically free of it. This is not simply due to bad programming, but we have lacked a theory that allows us to understand the problem. We introduce a formal definition and new general theory of synchronization. We illustrate its applicability by deriving basic deadlock properties, to show where the problem lies with semaphores and also to guide us in finding some simple modifications to semaphores that greatly ameliorate the problem. We suggest some future directions for deadlock resolution that also avoid resource starvation.
    First International Conference on Networking and Computing, ICNC 2010, Higashi Hiroshima, Japan, November 17-19, 2010. Proceedings; 01/2010
Show more


15 Reads
Available from