Efficient event generation for detecting races

  • Authors:
  • Scotte Zinn;Michael Coffin

  • Affiliations:
  • University of Waterloo;University of Waterloo

  • Venue:
  • CASCON '93 Proceedings of the 1993 conference of the Centre for Advanced Studies on Collaborative research: software engineering - Volume 1
  • Year:
  • 1993

Quantified Score

Hi-index 0.00

Visualization

Abstract

A data race is a situation during the execution of a parallel program where a variable is accessed concurrently by two independent threads and at least one of the accesses is a write operation. Races are a common cause of errors in parallel programs, so detecting them is an essential debugging task.A brute-force strategy used in many postmortem race detection methods involves instrumenting the program to record each inter-thread synchronization and each shared variable access in a log file. Races are then located by analyzing this event log after execution. The problem with this method is the volume of information involved: the time and space required to generate and store events can be prohibitive, even for fairly small programs.This paper describes a technique for using static program analysis to greatly reduce the number and size of events that are generated at run time. We focus on the program instrumentation phase of any post-mortem race detection method rather than actual race detection. The analysis technique involves extending a language grammar with four attributes and adding rules to each grammar production describing the interaction between these attributes. The parse tree is traversed during the compilation phase, and attribute values are computed at each node. These attribute values are then used to instrument the program far more sparsely than the brute-force strategy. A static-log file maintains the list of variables accessed between synchronization points. The result is that far fewer events, in conjuction with the static-log file, suffice to locate races.