Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
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)
Brotherston, J., Brunet, P., Gorogiannis, N., Kanovich, M.: A Compositional Deadlock Detector for Android Java. In: Proceedings of ASE 2021. IEEE (2021)
Cai, Y., Meng, R., Palsberg, J.: Low-Overhead Deadlock Prediction. In: Proc. of ICSE 2020. ACM (2020)
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). https://doi.org/10.1007/978-3-319-17524-9_1
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)
Distefano, D., Fähndrich, M., Logozzo, F., O’Hearn, P.: Scaling Static Analyses at Facebook. Commun. ACM 62(8), 62–70 (2019)
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
Engler, D., Ashcraft, K.: RacerX: Effective, static detection of race conditions and deadlocks. In: Proceedings of SOSP 2003. ACM (2003)
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)
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)
Flanagan, C., Freund, S.: FastTrack: efficient and precise dynamic race detection. In: Proceedings of PLDI 2009. ACM (2009)
Flanagan, C., Freund, S., Yi, J.: Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. In: Proceedings of PLDI 2008. ACM (2008)
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). https://doi.org/10.1007/10722468_15
Havelund, K., Pressburger, T.: Model checking java programs using java pathfinder. Inter. Jour. on STTT 2(4), 366–381 (2000)
Kildall, G.: A Unified Approach To Global Program Optimization. In: Proceedings of POPL1973. ACM (1973)
Kroening, D., Poetzl, D., Schrammel, P., Wachter, B.: Sound static deadlock analysis for c/pthreads. In Proc. of ASE 2016. ACM (2016)
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). https://doi.org/10.1007/978-3-540-70545-1_7
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)
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). https://doi.org/10.1007/978-3-319-46520-3_12
Reps, T., Horwitz, S., Sagiv, M.: Precise Interprocedural dataflow analysis via graph reachability. In Proceedings of POPL1995. ACM (1995)
Signoles, J., Cuoq, P., Kirchner, F., Kosmatov, N., Prevosto, V., Yakobowski, B.: FramaC A Software Analysis Perspective. Formal Asp. Comput. 27, 22 (2012)
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)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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. https://doi.org/10.1007/978-3-031-25312-6_31
Download citation
DOI: https://doi.org/10.1007/978-3-031-25312-6_31
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)