Skip to content

Yellowly/deadlock_detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deadlock Detector

Basic python script for helping to check for deadlocks in C/C++ programs that use POSIX mutexes as the primary synchronization mechanism.

Requirements

Internally, this script calls the C/C++ program using GDB. As such, this script requires GDB to be installed, and that the program being debugged is compiled with the -g compiler flag. Additionally, this program will not work for multi-processed programs.

Usage

This script can be run from the command line or by importing in python

CLI

This script can be called from the command line:

python3 deadlock_detector [--print] <executable file> <executable arguments...>

Import

Use a context manager to open up a DeadlockDetector:

from deadlock_detector import DeadlockDetector

with DeadlockDetector({ executable file name }) as dd:
  dd.run({ executable arguments }) # Run the program using the deadlock detector
  dd.verify_lock_stacks() # Ensure all pthread_mutex_lock call stacks don't have deadlock

About

Python script for detecting deadlocks in C/C++ programs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages