Skip to main content

Advertisement

Log in

Efficient data race detection for interrupt-driven programs via path feasibility analysis

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

Interrupt-driven programs are widely used in embedded systems with high security requirements. However, uncertain interleaving execution of tasks and interrupts may cause concurrency bugs, with data races being a significant factor in threatening security. Most of the previous research has focused on detecting data races in multi-threaded programs. And existing static analysis methods for interrupt-related data race detection often produce many false positives. This paper presents IntRace, an accurate and efficient static detection technique for interrupt data race. IntRace eliminates false data race by analyzing potential concurrency relationships and path reachability. It first identifies all race candidate pairs using access interleaving pattern matching. Then for each pair of operational accesses, IntRace analyzes potential concurrency relationships, including the special case of interrupt nesting, and uses this information to filter out access pairs that cannot concurrently access the same location. Finally, it checks the feasibility of events in the access pairs by constructing path constraints, which effectively eliminating infeasible paths in concurrent contexts. In addition, IntRace was evaluated on benchmark tests and 9 real embedded programs. The experimental results show that IntRace reduces the false positive rate by 73.2% compared to recent studies.

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

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Algorithm 1
Fig. 5
Algorithm 2
Algorithm 3
Fig. 6
Algorithm 4
Fig. 7
Fig. 8

Similar content being viewed by others

Data availability

Links to datasets during the current study period are available at https://github.com/chenruibuaa/racebench.

References

  1. Kotker J, Sadigh D, Seshia SA (2011) Timing analysis of interrupt-driven programs under context bounds. In: 2011 Formal methods in computer-aided design (FMCAD), pp 81–90. IEEE

  2. Mukherjee S, Kumar A, D’Souza D (2017) Detecting all high-level dataraces in an rtos kernel. In: Verification, Model Checking, and Abstract Interpretation: 18th International Conference, VMCAI 2017, Paris, France, January 15–17, 2017, Proceedings 18, pp 405–423. Springer

  3. Fu H, Wang Z, Chen X, Fan X (2018) A systematic survey on automated concurrency bug detection, exposing, avoidance, and fixing techniques. Softw Qual J 26:855–889

    Article  Google Scholar 

  4. Yu T, Cohen M (2015) Guided test generation for finding worst-case stack usage in embedded systems. In: 2015 IEEE 8th International Conference on Software Testing, Verification and Validation (ICST), pp 1–10. IEEE

  5. Poulsen K (2004) Software bug contributed to blackout. Security Focus

  6. Regehr J (2005) Random testing of interrupt-driven software. In: Proceedings of the 5th ACM International Conference on Embedded Software, pp 290–298

  7. Lai Z, Cheung S-C, Chan WK (2008) Inter-context control-flow and data-flow test adequacy criteria for nesc applications. In: Proceedings of the 16th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp 94–104

  8. Regehr J, Cooprider N (2007) Interrupt verification via thread verification. Electron Notes Theor Comput Sci 174(9):139–150

    Article  Google Scholar 

  9. Wu X, Wen Y, Chen L, Dong W, Wang J (2013) Data race detection for interrupt-driven programs via bounded model checking. In: 2013 IEEE Seventh International Conference on Software Security and Reliability Companion, pp 204–210. IEEE

  10. Schwarz MD, Seidl H, Vojdani V, Lammich P, Müller-Olm M (2011) Static analysis of interrupt-driven programs synchronized via the priority ceiling protocol. ACM SIGPLAN Not 46(1):93–104

    Article  Google Scholar 

  11. Wu X, Chen L, Miné A, Dong W, Wang J (2016) Static analysis of runtime errors in interrupt-driven programs via sequentialization. ACM Trans Embed Comput Syst (TECS) 15(4):1–26

    Google Scholar 

  12. Yu T, Srisa-an W, Rothermel G (2012) Simtester: a controllable and observable testing framework for embedded systems. In: Proceedings of the 8th ACM SIGPLAN/SIGOPS Conference on Virtual Execution Environments, pp 51–62

  13. Sun Y, Cheung S-C, Guo S, Cheng M (2019) Disclosing and locating concurrency bugs of interrupt-driven IoT programs. IEEE Internet Things J 6(5):8945–8957

    Article  Google Scholar 

  14. Wang Y, Gao F, Wang L, Yu T, Zhao J, Li X (2020) Automatic detection, validation, and repair of race conditions in interrupt-driven embedded software. IEEE Trans Softw Eng 48(1):346–363

    Article  Google Scholar 

  15. Sung C, Kusano M, Wang C (2017) Modular verification of interrupt-driven software. In: 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE), pp 206–216. IEEE

  16. Wang Y, Wang L, Yu T, Zhao J, Li X (2017) Automatic detection and validation of race conditions in interrupt-driven embedded software. In: Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis, pp 113–124

  17. Feng H, Yin L, Lin W, Zhao X, Dong W (2020) Rchecker: A cbmc-based data race detector for interrupt-driven programs. In: 2020 IEEE 20th International Conference on Software Quality, Reliability and Security Companion (QRS-C), pp 465–471. IEEE

  18. Chen R, Guo X, Duan Y, Gu B, Yang M (2011) Static data race detection for interrupt-driven embedded software. In: 2011 Fifth International Conference on Secure Software Integration and Reliability Improvement-Companion, pp 47–52. IEEE

  19. Chopra N, Pai R, D’Souza D (2019) Data races and static analysis for interrupt-driven kernels. In: Programming Languages and Systems: 28th European Symposium on Programming, ESOP 2019, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019, Prague, Czech Republic, April 6–11, 2019, Proceedings 28, pp 697–723. Springer

  20. Li C, Chen R, Wang B, Yu T, Gao D, Yang M (2022) Precise and efficient atomicity violation detection for interrupt-driven programs via staged path pruning. In: Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis, pp 506–518

  21. Engler D, Ashcraft K (2003) Racerx: effective, static detection of race conditions and deadlocks. ACM SIGOPS Oper Syst Rev 37(5):237–252

    Article  Google Scholar 

  22. Chen R (2019) Racebench website. https://github.com/chenruibuaa/racebench

  23. Praun C (2011) Race detection techniques

  24. Huang Y, Zhao Y, Shi J, Zhu H, Qin S (2012) Investigating time properties of interrupt-driven programs. In: Formal Methods: Foundations and Applications: 15th Brazilian Symposium, SBMF 2012, Natal, Brazil, September 23-28, 2012. Proceedings 15, pp 131–146. Springer

  25. Pratikakis P, Foster JS, Hicks M (2006) Locksmith: context-sensitive correlation analysis for race detection. Acm Sigplan Not 41(6):320–331

    Article  Google Scholar 

  26. Marek C (2021) DG website. https://github.com/mchalupa/dg

  27. Shi Q, Xiao X, Wu R, Zhou J, Fan G, Zhang C (2018) Pinpoint: Fast and precise sparse value flow analysis for million lines of code. In: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 693–706

  28. Lattner C (2008) Llvm and clang: next generation compiler technology. In: The BSD Conference, vol 5, pp 1–20

  29. De Moura L, Bjørner N (2008) Z3: an efficient smt solver. In: Tools and Algorithms for the Construction and Analysis of Systems: 14th International Conference, TACAS 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings 14, pp 337–340. Springer

  30. Corbet J, Rubini A, Kroah-Hartman G (2005) Linux device drivers. O’Reilly Media, Inc.

    Google Scholar 

  31. Bai J-J, Chen Q-L, Jiang Z-M, Lawall J, Hu S-M (2021) Hybrid static-dynamic analysis of data races caused by inconsistent locking discipline in device drivers. IEEE Trans Softw Eng 48(12):5120–5135

    Google Scholar 

  32. Wu X, Chen L, Miné A, Dong W, Wang J (2015) Numerical static analysis of interrupt-driven programs via sequentialization. In: 2015 International Conference on Embedded Software (EMSOFT), pp 55–64. IEEE

  33. Du X, Yin L, Feng H, Dong W (2021) Program verification enhanced precise analysis of interrupt-driven program vulnerabilities. In: 2021 28th Asia-Pacific Software Engineering Conference (APSEC), pp 253–263. IEEE

  34. Hsiao C-H, Yu J, Narayanasamy S, Kong Z, Pereira CL, Pokam GA, Chen PM, Flinn J (2014) Race detection for event-driven mobile applications. ACM SIGPLAN Not. 49(6):326–336

    Article  Google Scholar 

  35. Pan M, Chen S, Pei Y, Zhang T, Li X (2019) Easy modelling and verification of unpredictable and preemptive interrupt-driven systems. In: 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), pp 212–222. IEEE

  36. Schwarz MD, Seidl H, Vojdani V, Apinis K (2014) Precise analysis of value-dependent synchronization in priority scheduled programs. In: Verification, Model Checking, and Abstract Interpretation: 15th International Conference, VMCAI 2014, San Diego, CA, USA, January 19-21, 2014, Proceedings 15, pp 21–38. Springer

  37. Pai R, Singh A, D’Souza D, D’Souza M, Prakash P (2021) Static analysis for detecting high-level races in rtos kernels. Formal Methods Syst Des, 1–28

  38. Park S (2013) Fault comprehension for concurrent programs. In: 2013 35th International Conference on Software Engineering (ICSE), pp 1444–1446. IEEE

  39. Higashi M, Yamamoto T, Hayase Y, Ishio T, Inoue K (2010) An effective method to control interrupt handler for data race detection. In: Proceedings of the 5th Workshop on Automation of Software Test, pp 79–86

Download references

Acknowledgements

The authors would like to express appreciation for the financial support provided by the Heilongjiang Natural Science Foundation(JJ2019LH2160).

Author information

Authors and Affiliations

Authors

Contributions

Jingwen Zhao contributed to Conceptualization of this study, Methodology, Software, Writing—original draft. Yanxia Wu contributed to Supervision, Investigation, Methodology, Writing—review & editing. Jibin Dong contributed to Software, Validation.

Corresponding author

Correspondence to Yanxia Wu.

Ethics declarations

Competing interest

The authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhao, J., Wu, Y. & Dong, J. Efficient data race detection for interrupt-driven programs via path feasibility analysis. J Supercomput 80, 21699–21725 (2024). https://doi.org/10.1007/s11227-024-06189-4

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-024-06189-4

Keywords