针对"重复加锁解锁"和"volatile修饰符误用"两种数据访问冲突缺陷模式,提出基于编码规则的检测方法.首先,对缺陷模式的故障机理进行分析,提炼出3条编码规则用以在开发阶段避免缺陷发生,并基于一个静态代码检查工具SpaceCCH进行了规则检测方法研究和实现.在实际星上软件上的实验结果表明,扩展的SpaceCCH能够高效、低误报、低漏报地发现规则违反,从而有效避免这两种的数据访问冲突问题.本文的贡献在于将一类复杂缺陷的检测转换为相应的编码规则及其检测.
To solve pattern "double lock unlock"and pattern "misuse of volatile",a detection method based on coding rules is proposed. Firstly,the failure mechanism is analyzed,and then 3 coding rules are proposed to avoid corresponding defects in development stage. These rules and corresponding checking methods are researched and implemented by extending an existing static analysis tool named SpaceCCH. The evaluation result based on real world on-board software show that, the extended SpaceCCH can find rules violations efficiently with low false positive rate and low false negative rate,by which the data race bugs of pattern"double lock unlock"and pattern"misuse of volatile"can be avoided effectively. The main contribution of this paper is that the detection of a really complex bug is transformed to corresponding coding rules and their automatic detection.