Skip to main content

Static Deadlock Detection in Low-Level C Code

  • Conference paper
  • First Online:
Computer Aided Systems Theory – EUROCAST 2022 (EUROCAST 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13789))

Included in the following conference series:

  • 726 Accesses


We present a novel scalable deadlock analyser L2D2 capable of handling C code with low-level unstructured lock manipulation. L2D2 runs along the call tree of a program, starting from its leaves, and analyses each function just once, without any knowledge of the call context. L2D2 builds function summaries recording information about locks that are assumed or known to be locked or unlocked at the entry, inside, and at the exit of functions, together with lock dependencies, and reports warnings about possible deadlocks when cycles in the lock dependencies are detected. We implemented L2D2 as a plugin of the Facebook/Meta Infer framework and report results of experiments on a large body of C as well as C++ code illustrating the effectiveness and efficiency of L2D2 .

The work was supported by the project 20-07487S of the Czech Science Foundation and the Brno Ph.D. Talent Scholarship Programme.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions


  1. 1.


  1. Blackshear, S., Gorogiannis, N., O’Hearn, P., Sergey, I.: RacerD: compositional static race detection. In: Proceedings of ACMPL (OOPSLA), vol. 2, pp. 144:1–144:28 (2018)

    Google Scholar 

  2. Brotherston, J., Brunet, P., Gorogiannis, N., Kanovich, M.: A Compositional Deadlock Detector for Android Java. In: Proceedings of ASE 2021. IEEE (2021)

    Google Scholar 

  3. Cai, Y., Meng, R., Palsberg, J.: Low-Overhead Deadlock Prediction. In: Proc. of ICSE 2020. ACM (2020)

    Google Scholar 

  4. Calcagno, C., et al.: Moving fast with software verification. In: Havelund, K., Holzmann, G., Joshi, R. (eds.) NFM 2015. LNCS, vol. 9058, pp. 3–11. Springer, Cham (2015).

    Chapter  Google Scholar 

  5. Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approx. of fixpoints. In Proceedings of POPL 1977. ACM (1977)

    Google Scholar 

  6. Distefano, D., Fähndrich, M., Logozzo, F., O’Hearn, P.: Scaling Static Analyses at Facebook. Commun. ACM 62(8), 62–70 (2019)

    Article  Google Scholar 

  7. Edelstein, O., Farchi, E., Goldin, E., Nir, Y., Ratsaby, G., Ur, S.: Framework for testing multi-threaded java programs. Concur. Computat. Pract. Exper. 15(3–5), 485–499 2003

    Google Scholar 

  8. Engler, D., Ashcraft, K.: RacerX: Effective, static detection of race conditions and deadlocks. In: Proceedings of SOSP 2003. ACM (2003)

    Google Scholar 

  9. Fiedor, J., Hrubá, V., Křena, B., Letko, Z., Ur, S., Vojnar, T.: Advances in noise-based testing of concurrent software. Softw. Test. Verif. Reliab. 25(3), 272–309 (2015)

    Article  Google Scholar 

  10. Fiedor, J., Mužikovská, M., Smrčka, A., Vašíček, O., Vojnar, T.: Advances in the ANaConDA Framework for Dynamic Analysis. In: Proceedings of ISSTA 2018. ACM (2018)

    Google Scholar 

  11. Flanagan, C., Freund, S.: FastTrack: efficient and precise dynamic race detection. In: Proceedings of PLDI 2009. ACM (2009)

    Google Scholar 

  12. Flanagan, C., Freund, S., Yi, J.: Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. In: Proceedings of PLDI 2008. ACM (2008)

    Google Scholar 

  13. Havelund, K.: Using Runtime analysis to guide model checking of java programs. In: Havelund, K., Penix, J., Visser, W. (eds.) SPIN 2000. LNCS, vol. 1885, pp. 245–264. Springer, Heidelberg (2000).

    Chapter  MATH  Google Scholar 

  14. Havelund, K., Pressburger, T.: Model checking java programs using java pathfinder. Inter. Jour. on STTT 2(4), 366–381 (2000)

    Article  MATH  Google Scholar 

  15. Kildall, G.: A Unified Approach To Global Program Optimization. In: Proceedings of POPL1973. ACM (1973)

    Google Scholar 

  16. Kroening, D., Poetzl, D., Schrammel, P., Wachter, B.: Sound static deadlock analysis for c/pthreads. In Proc. of ASE 2016. ACM (2016)

    Google Scholar 

  17. Lal, A., Reps, T.: Reducing concurrent analysis under a context bound to sequential analysis. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 37–51. Springer, Heidelberg (2008).

    Chapter  Google Scholar 

  18. Lerch, J., Späth, J., Bodden, E., Mezini, M.: Access-path abstraction: scaling field-sensitive data-flow analysis with unbound. Access Paths. In: Proceedings of ASE 2015. IEEE (2015)

    Google Scholar 

  19. Nguyen, T.L., Fischer, B., La Torre, S., Parlato, G.: Lazy sequentialization for the safety verification of unbounded concurrent programs. In: Artho, C., Legay, A., Peled, D. (eds.) ATVA 2016. LNCS, vol. 9938, pp. 174–191. Springer, Cham (2016).

    Chapter  Google Scholar 

  20. Reps, T., Horwitz, S., Sagiv, M.: Precise Interprocedural dataflow analysis via graph reachability. In Proceedings of POPL1995. ACM (1995)

    Google Scholar 

  21. Signoles, J., Cuoq, P., Kirchner, F., Kosmatov, N., Prevosto, V., Yakobowski, B.: FramaC A Software Analysis Perspective. Formal Asp. Comput. 27, 22 (2012)

    Google Scholar 

  22. Wu, J., Tang, Y., Cui, H ., Yang, J.: Sound and precise analysis of parallel programs through schedule specialization. In: Proceedings of PLDI 2012. ACM (2012)

    Google Scholar 

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Dominik Harmim .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Harmim, D., Marcin, V., Svobodová, L., Vojnar, T. (2022). Static Deadlock Detection in Low-Level C Code. In: Moreno-Díaz, R., Pichler, F., Quesada-Arencibia, A. (eds) Computer Aided Systems Theory – EUROCAST 2022. EUROCAST 2022. Lecture Notes in Computer Science, vol 13789. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-25311-9

  • Online ISBN: 978-3-031-25312-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics