Table of Contents
Fetching ...

HardRace: A Dynamic Data Race Monitor for Production Use

Xudong Sun, Zhuo Chen, Jingyang Shi, Yiyu Zhang, Peng Di, Jianhua Zhao, Xuandong Li, Zhiqiang Zuo

TL;DR

This work addresses the challenge of detecting data races in production with minimal overhead and high accuracy. It introduces HardRace, a data race monitor that uses static selective instrumentation to prune memory accesses and Intel PTWRITE hardware tracing to record only essential events, followed by offline detection using established HB/lockset techniques. The key contributions include a sound interprocedural value-set analysis for multithreaded programs, a must-race-free pruning step, redundant register elimination, and a PTWRITE-based instrumentation and decoding pipeline, all validated against real-world benchmarks with superior overhead and detection performance. Practically, HardRace enables real-time production monitoring for data races without the heavy slowdown associated with prior dynamic detectors, making production-ready race detection feasible at scale.

Abstract

Data races are critical issues in multithreaded program, leading to unpredictable, catastrophic and difficult-to-diagnose problems. Despite the extensive in-house testing, data races often escape to deployed software and manifest in production runs. Existing approaches suffer from either prohibitively high runtime overhead or incomplete detection capability. In this paper, we introduce HardRace, a data race monitor to detect races on-the-fly while with sufficiently low runtime overhead and high detection capability. HardRace firstly employs sound static analysis to determine a minimal set of essential memory accesses relevant to data races. It then leverages hardware trace instruction, i.e., Intel PTWRITE, to selectively record only these memory accesses and thread synchronization events during execution with negligible runtime overhead. Given the tracing data, HardRace performs standard data race detection algorithms to timely report potential races occurred in production runs. The experimental evaluations show that HardRace outperforms state-of-the-art tools like ProRace and Kard in terms of both runtime overhead and detection capability -- HardRace can detect all kinds of data races in read-world applications while maintaining a negligible overhead, less than 2% on average.

HardRace: A Dynamic Data Race Monitor for Production Use

TL;DR

This work addresses the challenge of detecting data races in production with minimal overhead and high accuracy. It introduces HardRace, a data race monitor that uses static selective instrumentation to prune memory accesses and Intel PTWRITE hardware tracing to record only essential events, followed by offline detection using established HB/lockset techniques. The key contributions include a sound interprocedural value-set analysis for multithreaded programs, a must-race-free pruning step, redundant register elimination, and a PTWRITE-based instrumentation and decoding pipeline, all validated against real-world benchmarks with superior overhead and detection performance. Practically, HardRace enables real-time production monitoring for data races without the heavy slowdown associated with prior dynamic detectors, making production-ready race detection feasible at scale.

Abstract

Data races are critical issues in multithreaded program, leading to unpredictable, catastrophic and difficult-to-diagnose problems. Despite the extensive in-house testing, data races often escape to deployed software and manifest in production runs. Existing approaches suffer from either prohibitively high runtime overhead or incomplete detection capability. In this paper, we introduce HardRace, a data race monitor to detect races on-the-fly while with sufficiently low runtime overhead and high detection capability. HardRace firstly employs sound static analysis to determine a minimal set of essential memory accesses relevant to data races. It then leverages hardware trace instruction, i.e., Intel PTWRITE, to selectively record only these memory accesses and thread synchronization events during execution with negligible runtime overhead. Given the tracing data, HardRace performs standard data race detection algorithms to timely report potential races occurred in production runs. The experimental evaluations show that HardRace outperforms state-of-the-art tools like ProRace and Kard in terms of both runtime overhead and detection capability -- HardRace can detect all kinds of data races in read-world applications while maintaining a negligible overhead, less than 2% on average.

Paper Structure

This paper contains 21 sections, 4 figures, 4 tables, 2 algorithms.

Figures (4)

  • Figure 1: Workflow of HardRace
  • Figure 2: A toy example
  • Figure 3: A toy example for redundant register elimination
  • Figure 4: A trace example