DR.FIX: Automatically Fixing Data Races at Industry Scale

Farnaz Behrang, Zhizhou Zhang, Georgian-Vlad Saioc, Peng Liu, Milind Chabbi
4/22/2025
6 citations
cs.DCcs.AIcs.LG

Official code: uber-research/drfix (11 stars, Go, Apache-2.0, last commit 2025-05-27).

Abstract

Data races are a prevalent class of concurrency bugs in shared-memory parallel programs, posing significant challenges to software reliability and reproducibility. While there is an extensive body of research on detecting data races and a wealth of practical detection tools across various programming languages, considerably less effort has been directed toward automatically fixing data races at an industrial scale.

Show full abstract

In large codebases, data races are continuously introduced and exhibit myriad patterns, making automated fixing particularly challenging. In this paper, we tackle the problem of automatically fixing data races at an industrial scale. We present Dr.Fix, a tool that combines large language models (LLMs) with program analysis to generate fixes for data races in real-world settings, effectively addressing a broad spectrum of racy patterns in complex code contexts. Implemented for Go--the programming language widely used in modern microservice architectures where concurrency is pervasive and data races are common--Dr.Fix seamlessly integrates into existing development workflows. We detail the design of Dr.Fix and examine how individual design choices influence the quality of the fixes produced. Over the past 18 months, Dr.Fix has been integrated into developer workflows at Uber demonstrating its practical utility. During this period, Dr.Fix produced patches for 224 (55%) from a corpus of 404 data races spanning various categories; 193 of these patches (86%) were accepted by more than a hundred developers via code reviews and integrated into the codebase.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Data race skeletons from Uber's Go codebase for research in concurrency bug detection and analysis.

111Go, PythonApr 3, 20251 years agoApache-2.0

Similar Papers

Cite this paper

@article{behrang2025drfix,
  title  = {DR.FIX: Automatically Fixing Data Races at Industry Scale},
  author = {Farnaz Behrang and Zhizhou Zhang and Georgian-Vlad Saioc and Peng Liu and Milind Chabbi},
  year   = {2025},
  eprint = {2504.15637},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.15637v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.15637.svg)](https://codeofpaper.com/paper/2504.15637)

Discussion