Non-Deadlock Bugs

This lesson includes two frequent types of non-deadlock concurrency bugs: atomicity and ordering violation.

Non-deadlock bugs make up a majority of concurrency bugs, according to Lu’s study“Learning from Mistakes — A Comprehensive Study on Real World Concurrency Bug Characteristics” by Shan Lu, Soyeon Park, Eunsoo Seo, Yuanyuan Zhou. ASPLOS ’08, March 2008, Seattle, Washington. The first in-depth study of concurrency bugs in real software, and the basis for this chapter. Look at Y.Y. Zhou’s or Shan Lu’s web pages for many more interesting papers on bugs.. But what types of bugs are these? How do they arise? How can we fix them? We now discuss the two major types of non-deadlock bugs found by Lu et al.:

  • Atomicity violation bugs.
  • Order violation bugs.

Atomicity-violation bugs

The first type of problem encountered is referred to as an atomicity violation. Here is a simple example, found in MySQL. Before reading the explanation, try figuring out what the bug is. Do it!

Get hands-on with 1200+ tech skills courses.