  Software debugging has been shown to utilize upwards of half of developers'
time. Yet, machine programming (MP), the field concerned with the automation of
software (and hardware) development, has recently made strides in both research
and production-quality automated debugging systems. In this paper we present
ControlFlag, a self-supervised MP system that aims to improve debugging by
attempting to detect idiosyncratic pattern violations in software control
structures. ControlFlag also suggests possible corrections in the event an
anomalous pattern is detected. We present ControlFlag's design and provide an
experimental evaluation and analysis of its efficacy in identifying potential
programming errors in production-quality software. As a first concrete evidence
towards improving software quality, ControlFlag has already found an anomaly in
CURL that has been acknowledged and fixed by its developers. We also discuss
future extensions of ControlFlag.
