ASE 2024
Sun 27 October - Fri 1 November 2024 Sacramento, California, United States

Interrupt-driven programs are widely used in safety-critical fields like aerospace and embedded systems. However, the unpredictable interleaving of Interrupt Service Routines (ISRs) can lead to concurrency bugs, particularly atomicity violations when ISRs preempt atomic sequences of instructions. Despite predetermined inputs, there is currently no dynamic detector that can efficiently and precisely identify these bugs. To address this, we propose a dynamic approach for detecting atomicity violations in interrupt-driven programs. This method extracts key operations on shared variables and potential preemption points from each task, followed by generating all feasible preemption schedules based on preemption relationships and synchronization mechanisms. These schedules are dynamically checked during execution, and a prefix-directed feedback mechanism guides further exploration towards uncovered paths, reducing redundant schedules. Our approach effectively detects atomicity violations on the fly by recognizing interleaving patterns of memory operations. Extensive experiments demonstrate that our method is more precise and efficient than related approaches.