Journal of Frontiers of Computer Science and Technology ›› 2015, Vol. 9 ›› Issue (8): 914-925.DOI: 10.3778/j.issn.1673-9418.1411052

Previous Articles     Next Articles

Data Race Detection Tool for Interrupt-Driven Embedded System

CHEN Yuanjun1,2, SHI Junjing1,2, WANG Linzhang1,2+, LI Xuandong1,2   

  1. 1. State Key Laboratory of Novel Software Technology, Nanjing University, Nanjing 210023, China
    2. Department of Computer Science and Technology, Nanjing University, Nanjing 210023, China
  • Online:2015-08-01 Published:2015-08-06

中断驱动的嵌入式系统数据竞争检测工具

陈园军1,2,石浚菁1,2,王林章1,2+,李宣东1,2   

  1. 1. 南京大学 计算机软件新技术国家重点实验室,南京 210023
    2. 南京大学 计算机科学与技术系,南京 210023

Abstract: Interrupt-driven embedded systems are widely used in very high reliable and stable fields. However, due to the design complexity and the running environment diversity, uncertain interrupt faults often happen, which cause serious consequence. Data race is one of these complex problems. Lots of work has been done to detect such races, but there is still no easy solution. To solve such problems, this paper introduces a static detection method based on control flow graph. Firstly this method detects the shared resources and interrupts in the source code by preprocessing, and then constructs the corresponding simple control flow graphs according to the preprocessing result. Secondly the method points out the potential data races and their execution paths by analyzing the preemption relationship on these control flow graphs. The experimental results show that this method can not only detect the data race problems in the code, but also trace and show their execution paths, which is quite helpful for the bug verification and fix.

Key words: interrupt, race, embedded system, interrupt-driven, testing

摘要: 中断驱动的嵌入式系统广泛应用于对安全和稳定性要求极高的领域,但因系统设计复杂,运行环境多样等原因,中断不确定性导致的严重故障时有发生,数据竞争是较为棘手的问题之一。已有工作对中断导致的数据竞争检测做了许多尝试,但目前还没有比较易用的解决方案。为了解决这类问题,提出了一种基于控制流图的静态检测方法。该方法通过对源程序进行预处理分析,检测出程序中使用的共享资源和中断使能操作;根据预处理的结果,构建出源程序对应的简要控制流图;通过对简要控制流图的抢占关系分析,得到可能会导致竞争关系的执行序列。实验结果表明,该方法能有效检测出程序中潜在的竞争关系,并指明该潜在竞争的发生路径,帮助软件测试人员对故障进行确认和修复。

关键词: 中断, 竞争, 嵌入式系统, 中断驱动, 测试