A Study of Real-World Data Races in Golang

04/02/2022
by   Milind Chabbi, et al.
0

The concurrent programming literature is rich with tools and techniques for data race detection. Less, however, has been known about real-world, industry-scale deployment, experience, and insights about data races. Golang (Go for short) is a modern programming language that makes concurrency a first-class citizen. Go offers both message passing and shared memory for communicating among concurrent threads. Go is gaining popularity in modern microservice-based systems. Data races in Go stand in the face of its emerging popularity. In this paper, using our industrial codebase as an example, we demonstrate that Go developers embrace concurrency and show how the abundance of concurrency alongside language idioms and nuances make Go programs highly susceptible to data races. Google's Go distribution ships with a built-in dynamic data race detector based on ThreadSanitizer. However, dynamic race detectors pose scalability and flakiness challenges; we discuss various software engineering trade-offs to make this detector work effectively at scale. We have deployed this detector in Uber's 46 million lines of Go codebase hosting 2100 distinct microservices, found over 2000 data races, and fixed over 1000 data races, spanning 790 distinct code patches submitted by 210 unique developers over a six-month period. Based on a detailed investigation of these data race patterns in Go, we make seven high-level observations relating to the complex interplay between the Go language paradigm and data races.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/27/2020

Static Race Detection and Mutex Safety and Liveness for Go Programs (extended version)

Go is a popular concurrent programming language thanks to its ability to...
research
10/06/2022

Computing Race Variants in Message-Passing Concurrent Programming with Selective Receives

Message-passing concurrency is a popular computation model that underlie...
research
02/16/2021

C11Tester: A Race Detector for C/C++ Atomics Technical Report

Writing correct concurrent code that uses atomics under the C/C++ memory...
research
06/08/2022

Comparative Analysis of Dynamic Data Race Detection Techniques

The consequences of data races can be potentially very problematic [1], ...
research
04/27/2019

A Practical Analysis of Rust's Concurrency Story

Correct concurrent programs are difficult to write; when multiple thread...
research
09/15/2021

Dala: A Simple Capability-Based Dynamic Language Design For Data Race-Freedom

Dynamic languages like Erlang, Clojure, JavaScript, and E adopted data-r...
research
08/15/2023

Data Race Detection Using Large Language Models

Large language models (LLMs) are demonstrating significant promise as an...

Please sign up or login with your details

Forgot password? Click here to reset