Mocklinter: Linting Mutual Exclusive Deadlocks with Lock Allocation Graphs

Zhen Yu, Xiaohong Su, Tiantian Wang, Peijun Ma
2016 International Journal of Hybrid Information Technology  
Deadlocks are serious runtime bugs and are difficult to expose, reproduce and diagnose. Once suffering from them, programs may be afflicted with increasing response time, decreasing throughputs, or even crashes. We present Mocklinter, a dynamic deadlock detection tool to capture a deadlock as soon as it happens and spit out enough information to support source-level debugging. Mocklinter tracks the synchronization state of the target program by dynamically constructing and maintaining a lock
more » ... ocation graph. Mocklinter uses this graph to decide whether a deadlock is confronted or not. Mocklinter handles all types of pthread mutexes and can detect any number of deadlocks at a time. Each deadlock captured by Mocklinter can involve any number of threads. We implemented Mocklinter in Linux-3.2.0 and evaluated it with ten applications, including Dining-Philosophers, Sshfs, SQLite, OpenLDAP, MySQL and so on, whose sizes varies from 0.1K to 1021.0K in terms of LOC. The results demonstrate effectiveness against real or artificial deadlock bugs, while incurring modest performance overhead and scaling to more than one thousand of threads.
doi:10.14257/ijhit.2016.9.3.34 fatcat:yz4kgyeetjcwjpzseyk3v64fne