A Petri-net-based Method for Detecting Bugs in Multiple Threads
Jiaquan Sun,Guanjun Liu,Dongming Xiang,Changjun Jiang
DOI: https://doi.org/10.1109/icnsc.2019.8743177
2019-01-01
Abstract:A multi-thread program easily suffers from concurrent bugs such as livelock, deadlock and data inconsistency. The Petri-net-based methods are widely used to detect these errors. The existing models are good at modeling the logical structures such concurrency and synchronization locks, but short of modeling the changes of variables. However, some bugs are closely related with the changes of variables. In order to solve this problem, we put forward a new Petri net model called multi-thread net. This model can characterize overwriting, shared reading and synchronization locks. Moreover, we present a method to construct a reachability graph for every multi-thread net. Based on this graph, we develop an algorithm to detect concurrent bugs including deadlock, data race, order violation, and atomic violation. Furthermore, a Petri net tool is developed to model current programs and detect their concurrent bugs.