Facebook tackles race hate problem head on with programming tool

Clashing threads put in their place by RacerD

In Facebook's advertising business, a race condition might be construed as an ethnic descriptor used to prevent purchased ads from being displayed to a particular racial group.

Among its software engineers, it's a programming problem that arises when multiple operations run concurrently but are executed in an unexpected order. For example, if two threads running at the same time want to simultaneously increment the value of a shared integer, one of the threads may overwrite the other's change, and the variable will only be incremented once rather than twice.

Facebook deals with concurrency problems like this on a very large scale, and its computer scientists have invested considerable time and energy creating development tools to mitigate bugs of this sort.

In May, the social network's code boffins talked up their work on projects such as AL, a declarative language for writing bug checkers for Infer, a static code analyzer open sourced by the company.

On Thursday this week, they revealed RacerD, which rather than being an oblique reference to Speed Racer's older brother, Racer X turns out to be software for finding data races in Java code.


Data races and race conditions are both concurrency problems. Though they're not the same thing, there's often overlap. One distinction worth noting is that data races are more easily identified through automated analysis.

While perhaps best known among developers for its perverse affinity for PHP, Facebook also uses quite a bit of Java, particularly for its Android apps. Its engineers last year began rewriting News Feed for Android to move it from sequential processing to a multi-threaded model. It was a risky transition, recount Facebook research scientist Sam Blackshear and engineering manager Peter O'Hearn in a blog post, because concurrency errors tend to be difficult to diagnose and fix.

The social network's developer tools team had been exploring algorithms that would allow them to prove the absence of data races in code, to make concurrency more manageable at scale.

Asked for help by the News Feed for Android team, they shifted their focus to proving the opposite – the presence of data races under specific circumstances.

RacerD is the result. The now-publicly released open-source software looks for unsynchronized memory access, where write operations are involved. It works with Infer, which means it doesn't need to run code it is testing. Instead, it relies on symbolic reasoning to plot the possible paths through the app.

And it appears to work fairly well. After 10 months scouring Facebook's Android codebase, say Blackshear and O'Hearn, RacerD has caught more than 1,000 multi-threading issues, enabling Facebook engineers make fixes before deployment.

Now others who see a need for static concurrency analysis in Java code that uses locks or @ThreadSafe annotations can put RacerD to the test. ®

Other stories you might like

  • Robotics and 5G to spur growth of SoC industry – report
    Big OEMs hogging production and COVID causing supply issues

    The system-on-chip (SoC) side of the semiconductor industry is poised for growth between now and 2026, when it's predicted to be worth $6.85 billion, according to an analyst's report. 

    Chances are good that there's an SoC-powered device within arm's reach of you: the tiny integrated circuits contain everything needed for a basic computer, leading to their proliferation in mobile, IoT and smart devices. 

    The report predicting the growth comes from advisory biz Technavio, which looked at a long list of companies in the SoC market. Vendors it analyzed include Apple, Broadcom, Intel, Nvidia, TSMC, Toshiba, and more. The company predicts that much of the growth between now and 2026 will stem primarily from robotics and 5G. 

    Continue reading
  • Deepfake attacks can easily trick live facial recognition systems online
    Plus: Next PyTorch release will support Apple GPUs so devs can train neural networks on their own laptops

    In brief Miscreants can easily steal someone else's identity by tricking live facial recognition software using deepfakes, according to a new report.

    Sensity AI, a startup focused on tackling identity fraud, carried out a series of pretend attacks. Engineers scanned the image of someone from an ID card, and mapped their likeness onto another person's face. Sensity then tested whether they could breach live facial recognition systems by tricking them into believing the pretend attacker is a real user.

    So-called "liveness tests" try to authenticate identities in real-time, relying on images or video streams from cameras like face recognition used to unlock mobile phones, for example. Nine out of ten vendors failed Sensity's live deepfake attacks.

    Continue reading
  • Lonestar plans to put datacenters in the Moon's lava tubes
    How? Founder tells The Register 'Robots… lots of robots'

    Imagine a future where racks of computer servers hum quietly in darkness below the surface of the Moon.

    Here is where some of the most important data is stored, to be left untouched for as long as can be. The idea sounds like something from science-fiction, but one startup that recently emerged from stealth is trying to turn it into a reality. Lonestar Data Holdings has a unique mission unlike any other cloud provider: to build datacenters on the Moon backing up the world's data.

    "It's inconceivable to me that we are keeping our most precious assets, our knowledge and our data, on Earth, where we're setting off bombs and burning things," Christopher Stott, founder and CEO of Lonestar, told The Register. "We need to put our assets in place off our planet, where we can keep it safe."

    Continue reading

Biting the hand that feeds IT © 1998–2022